onesignal

react-native-onesignal receive push notification without opening notification

社会主义新天地 提交于 2019-12-06 04:10:23
问题 I have checked react-native-onesignal github README and it seems the only way to get the notification is to open which is through the onNotificationOpened() callback. Their documentation stated that: When any notification is opened or received the callback onNotification is called passing an object with the notification data. But onNotification clearly does not work. Is there any way to get the notification without opening the push notification or enabling the in-app alert notification? 回答1:

Swift - How sending a post notification from OneSignal SDK to specific username tag?

陌路散爱 提交于 2019-12-06 04:07:12
How Can I send a post notification to specific tag like (username: "@john") from Swift/iOS Native SDK. I have sendTag OneSignal before. I'm sending below a user with playerID. But It's not enough. Someone can login with different accounts. So same playerID will be for all of them. When I add tag line it doesn't work as I expect. How to work Player ID && username tag together. OneSignal.sendTag("username", value: "\(username)") If someone explain this, It would be great. DataService.ds.REF_USERS.child(userUUID).child("playerID").observeSingleEvent(of: .value, with: { snapshot in if let playerID

OneSignal Push Notification Click to open actiivty

我只是一个虾纸丫 提交于 2019-12-06 02:07:42
I have integrated one signal library for push notification. I want to open a particular activity from click of push notification while app is not running I am receiving push notification but while I am clicking on notification the app crashes. Here is my code for notification receiver public class ExampleNotificationOpenedHandler implements OneSignal.NotificationOpenedHandler { Context context; @Override public void notificationOpened(OSNotificationOpenResult result) { OSNotificationAction.ActionType actionType = result.action.type; JSONObject data = result.notification.payload.additionalData;

OneSignal-Pushnotification small icon not displayed on Android

≡放荡痞女 提交于 2019-12-05 19:40:41
We have a Cordova-App which contains a file 'icon.png' in every drawable-xy folder. We provide push notifications using OneSignal. The notifications are working as expected. Except the small icon. There is only a blank icon on the top bar of my phone, where app-symbols are displayed. I tried using the following snippet: { ... "small_icon" : "@android:drawable/icon.png" .... } I also tried lots and lots of other variations without "android", without "drawable", without slash, with .png and without .png. etc. etc. I found this in the documentation: ( https://documentation.onesignal.com/reference

Uncaught TypeError: Cannot read property 'OneSignal' of undefined\", source: file:///android_asset/www/js/app

跟風遠走 提交于 2019-12-05 18:20:53
I'm trying to initialize OneSignal to a PhoneGap application. I tried many ways. But always it gives following error, Uncaught TypeError: Cannot read property 'OneSignal' of undefined", source: file:///android_asset/www/js/app.js error. This is my app.js file document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { oneSignal(); checkConnection();} function oneSignal(){ console.log("It is calling"); var notificationOpenedCallback = function(jsonData) { console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData)); }; window.plugins.OneSignal

OneSignal Not calling didReceiveRemoteNotification

帅比萌擦擦* 提交于 2019-12-05 17:17:46
We migrated from UA to One Signal. We are sending push from cloud code like var pushInfo = { "app_id" : "xxxxxx", "data": { "objectId": objectId, "placeId": placeId, }, "included_segments": ["All Users"], "contents": {"en": message} }; var headers = { "Content-Type": "application/json; charset=utf-8", "Authorization": "Basic XXXXX" }; var options = { host: "onesignal.com", port: 443, path: "/api/v1/notifications", method: "POST", headers: headers, }; var https = require('https'); var req = https.request(options, function(res) { res.on('data', function(data) { console.log("Response:"); console

How to change default push notification icon to small icon in Onesignal in ionic 3?

送分小仙女□ 提交于 2019-12-05 17:10:40
I have a problem to change small icon push notification Onesignal in ionic 3, I have tried this tutorial https://documentation.onesignal.com/docs/customize-notification-icons , https://ionicframework.com/docs/native/onesignal/ and https://github.com/OneSignal/OneSignal-Cordova-SDK/issues/341#issuecomment-382648188 , but fail all, small icon in my push notification still default of onesignal. This is my folder structure and my script : My folder structure : copy_android_notification_icons.js : #!/usr/bin/env node var fs = require('fs'); var path = require('path'); var rootDest = 'platforms

Error:No such property: manifestPlaceholders for class: com.android.build.gradle.managed.ProductFlavor

血红的双手。 提交于 2019-12-05 13:47:13
I use 'gradle-experimental:0.4.0' and I want to use onesignal sdk for my project. when I try to build the project with the code which have been mentioned in the example here I get this error: Error:No such property: manifestPlaceholders for class: com.android.build.gradle.managed.ProductFlavor. Code in Sample android { defaultConfig { manifestPlaceholders = [manifestApplicationId: "${applicationId}", onesignal_app_id: "bbbbbb-324f-34fd-bed1-df8f05be55ba", onesignal_google_project_number: "11111111"] } } Code in my project model { android { compileSdkVersion = 23 buildToolsVersion = "23.0.2"

Android App crashes when OneSignal push notifications are sent

安稳与你 提交于 2019-12-05 09:15:28
Android app is crashing just after onesignal push notification is sent. I am getting this error. Tried looking at other stackoverflow answers but it didn't help. Please check the code (build.gradle) & error below. Dont understant why is it not working :P Please check the code (build.gradle) & error below. FATAL EXCEPTION: Firebase-FirebaseMessagingService Process: com.mario.childhood.game.videogame, PID: 30163 java.lang.AbstractMethodError: abstract method "void com.google.firebase.iid.zzb.zzd(android.content.Intent)" at com.google.firebase.iid.zzc.run(Unknown Source) at java.util.concurrent

Push Notifications take too long to arrive

蹲街弑〆低调 提交于 2019-12-05 04:55:54
问题 I'm having a weird problem with push notifications in an adobe air app for iOS and Android. I'm using the Easy Push ANE from Milkman Games along with the One Signal service. The problem is that notifications do arrive, but sometimes (randomly), it can take up to 15 minutes for the messages to arrive at the device after they are sent. This is critical for my app (a taxi booking app), since i'm relying on the push notifications for the communication between the taxi app and the users app. So,