Can OneSignal handle background/silent notifications using the SDK?

Has anyone been able to use the plugin to handle background/quiet notifications with the SDK? The documentation states that OneSignal CAN, but it seems to require permissions or changes to the android manifest that can only be done with Enterprise. The generic documentation discusses this with a Java example, but nothing with the SDK. And the documentation for use with the SDK is severely lacking. I have asked this repeatedly through their chat system but dont get a straight answer.

I can understand the message showing when the app is not running, and it is necessary to swipe so it can start the app, and they have a variable in the DidReceiveNotification callback that gives the impression you can, but the notification still displays. I want to use this to pass data quietly between users.

If it cannot be handled through the SDK a straight yes or no would be nice. If it can, a brief, straight forward example - using the plugin, not a reference to non-Corona/Lua code - would be appreciated.

I am also hanging while posting a notification. I have their debug level messaging set with everything showing success until, of course, it hangs. adb logcat OneSignal:v s:* doesn’t show much.

Thanks in advance.

followup: I have asked for confirmation from OneSignal, but it seems that the Corona plugin is not a complete implementation of what OneSignal offers. While I have been able to perform direct user to user pushes with embedded data, the corona implementation does not permit the app to manage the notification (the dialog appears in all cases).  Their support has also indicated that a backgrounded app will not be processed by a notification and I am gathering from what little they’ve said that swiping a notification for an app that is not running, will not start the app and allow that notification to be processed.     If anyone has had any luck doing this and OneSignal’s support is incorrect, please let me know,  I really find it frustrating to work through an implementation only to find that the company’s documentation is inaccurate and specified functionality is missing.

Do you have any notice about this? This would be very useful.

followup: I have asked for confirmation from OneSignal, but it seems that the Corona plugin is not a complete implementation of what OneSignal offers. While I have been able to perform direct user to user pushes with embedded data, the corona implementation does not permit the app to manage the notification (the dialog appears in all cases).  Their support has also indicated that a backgrounded app will not be processed by a notification and I am gathering from what little they’ve said that swiping a notification for an app that is not running, will not start the app and allow that notification to be processed.     If anyone has had any luck doing this and OneSignal’s support is incorrect, please let me know,  I really find it frustrating to work through an implementation only to find that the company’s documentation is inaccurate and specified functionality is missing.

Do you have any notice about this? This would be very useful.

FYI : I was able to get this working.  I have a custom Web API that my Corona (Android) app calls via REST. The web api then makes a call to OneSignals REST API using another user(s) playerID(s).  

In main.lua after OneSignal.Init() I set OneSignal.EnableVibrate(false) and OneSignal.EnableSound(false).  This allows me to handle the notification silently in the OneSignal listener (DidReceiveRemoteNotification).  Here you can extract the message and any additional data you sent and act accordingly.  I’m using my Web API to do some other processing, but I see no reason why you couldn’t simply call their endpoint from your app and achieve the same result.

The device does, however, still display a notification; which isn’t ideal but it at least fulfills my needs.

Let me know if you want some code snippets.

So could you use the DidReceiveRemoteNotificationCallBack on android?

Yes.

Yesterday I learned that I can pass additional information as “data” to their API and access it via “additionalData” in my app, so I don’t have to rely on the message text. Also, according to their documentation, if you leave “contents” empty no alert will be displayed on the device, making it truly silent. I haven’t gotten around to trying it yet though.

FYI : I was able to get this working.  I have a custom Web API that my Corona (Android) app calls via REST. The web api then makes a call to OneSignals REST API using another user(s) playerID(s).  

In main.lua after OneSignal.Init() I set OneSignal.EnableVibrate(false) and OneSignal.EnableSound(false).  This allows me to handle the notification silently in the OneSignal listener (DidReceiveRemoteNotification).  Here you can extract the message and any additional data you sent and act accordingly.  I’m using my Web API to do some other processing, but I see no reason why you couldn’t simply call their endpoint from your app and achieve the same result.

The device does, however, still display a notification; which isn’t ideal but it at least fulfills my needs.

Let me know if you want some code snippets.

So could you use the DidReceiveRemoteNotificationCallBack on android?

Yes.

Yesterday I learned that I can pass additional information as “data” to their API and access it via “additionalData” in my app, so I don’t have to rely on the message text. Also, according to their documentation, if you leave “contents” empty no alert will be displayed on the device, making it truly silent. I haven’t gotten around to trying it yet though.