onesignal

Cancel notification

Deadly 提交于 2019-12-24 00:52:35
问题 I use Onesignal to push notification and need to cancel all notification of onPause and onResume, NotificationManager notificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE); if (notificationManager!=null) notificationManager.cancelAll(); but it's not work correctly. When app restarted I get all old notifications. I restard my app and these old notifications need to not showing. Please help to fix this!! 回答1: You need to use this

HandleNotificationOpened are not handled if app is closed before i open the notification

喜欢而已 提交于 2019-12-23 04:56:29
问题 HandleNotificationOpened is working perfectly if App is on the background or running but it's not fired if i open the notification when app is closed. I've tried to persist the data from event with SecureStorage, because i'm not sure if the event run but in the wrong time or it doesn't run at all. public App() { OneSignal.Current.StartInit("onesignal-id").HandleNotificationOpened(HandleNotificationOpened).HandleNotificationReceived(HandleNotificationReceived).EndInit(); } private async void

Open application on notification click in OneSignal

让人想犯罪 __ 提交于 2019-12-23 03:57:08
问题 I am getting notification using this through OneSignal , but I want to open the application when I click on notification private static class ExampleNotificationOpenedHandler implements OneSignal.NotificationOpenedHandler { @Override public void notificationOpened(String message, JSONObject additionalData, boolean isActive) { try { if (additionalData != null) { if (additionalData.has("actionSelected")) Log.d("OneSignalExample", "OneSignal notification button with id " + additionalData

Using OneSignal with Flutter

强颜欢笑 提交于 2019-12-22 14:04:11
问题 I notice that I can use Firebase for push notification feature. But my project requires using OneSignal. Is it possible to achieve it in Flutter? I can't find any post nor article talking about that. Thanks. 回答1: EDIT: There is an official plugin now for OneSignal https://github.com/OneSignal/OneSignal-Flutter-SDK Unfortunately, there is no plugin for flutter to use OneSignal. You can write one yourself, though. Since OneSignal exists for iOS and Android, what you have to do is write a

How posting One Signal notification's additional data and receiving that?

为君一笑 提交于 2019-12-22 03:46:36
问题 I checked OneSignal documentation but I couldn't understand clearly as beginner how setting dictionary as a post notification's additional data (like postID, userID, type) in iOS Native SDK using Swift to decide and redirect when user interacted with notification. For posting I'm doing only like that: OneSignal.sendTag("username", value: "\(user)") OneSignal.postNotification(["contents": ["en": "@\(user) added an additive to your '\(title)' experience: \"\(strLast)\""], "include_player_ids":

Tapping a Notification from OneSignal does not open a result activity!!!! - Android

杀马特。学长 韩版系。学妹 提交于 2019-12-21 05:45:53
问题 Now I know there are lot of questions on this, but I have faced no luck at all and thought to ask a question here. I have an application which just runs a splashscreen followed by a MainActivity(Which is just a WebView) Now I integrated this with OneSignal for receiving push notifications. Everything works good, I mean I get a notification when sent through the onesignal website to my phone - but the thing I am facing is, tapping the notification does not get my ResultActivity(Just a activity

Send Notification to specific user using onesignal

家住魔仙堡 提交于 2019-12-21 05:35:11
问题 I'm using onesignal for first time in my project. I have to send notification to specific users (wherever user is logged in either on chrome or android device) on some events like whatsapp sends notification on mobile as well as website too and only if user is logged in. I have successfully sent notification to all users. After some R&D on OneSignal, I come to know that I have to send notifications to specific playerId for this purpose. But here are some my questions/doubts. I think player Id

How to Send push notifications using One Signal + PHP + Server API?

好久不见. 提交于 2019-12-18 12:37:12
问题 I am using one signal to send push notification for android app. My question is How Can I setup send push notifications using server rest api? 回答1: <?PHP function sendMessage(){ $content = array( "en" => 'Testing Message' ); $fields = array( 'app_id' => "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx", 'included_segments' => array('All'), 'data' => array("foo" => "bar"), 'large_icon' =>"ic_launcher_round.png", 'contents' => $content ); $fields = json_encode($fields); print("\nJSON sent:\n"); print(

OneSignal iOS issue “No Push Token” with SDK 2.0.7

与世无争的帅哥 提交于 2019-12-18 09:52:14
问题 I am confronting a weird error from OneSignal and push notifications. I have 3 devices (2 iPhones, 1 mini iPad). After i completed the entire process of Push notifications, only my iPad receives push notifications from OneSignal. All my devices are registered in my Developer Account and what i found is the most weird situation is that i NSLOG the didRegisterForRemoteNotificationsWithDeviceToken to see if each device connected receives a token and they all indeed get a token but for some

Google.JarResolver.ResolutionException: Cannot resolve com.google.firebase:firebase-analytics-unity:1.0.0()

纵然是瞬间 提交于 2019-12-18 07:03:51
问题 In my Unity project, I used some assets like FacebookSDK, OneSignal etc. Whenever I import OneSignal, this error will be shown. Google.JarResolver.ResolutionException: Cannot resolve com.google.firebase:firebase-analytics-unity:1.0.0() I had tried many things, these are what I remember: Using 'Play Service Resolver' does not solve the problem. Importing Unity Firebase. When I import Firebase, the error turn into another error, which is building error called CommandInvokationFailure , related