OneSignal with targetSdkVersion=26 getting error Background start not allowed: service Intent { cmp=***/com.onesignal.GcmIntentService(has extras) }

You cannot just select an SDK target with Corona. As @agramonte states, we are working on adding support for SDK version 26, but for now you should not be running apktool and making manual changes to your project.

Rob

OK i get it, so when you will add support to target version 26, then you will also fix OneSingal Plugin to support Android 8.0? Good to hear that you working on adding that support! 

@Rob: I know i shouldn’t make any manual changes in created .apk and i don’t do it. I was just curious what android:targetVersion is in .apk build by latest Corona Daily Build. My native project is working on old Corona version 2017.3079 so i wanted to check if newest daily build support version 26 already.

OneSignal maintains their own plugin. It will be up to them to update it after we enable SDK version 26.

Rob

@Rob. Good to know. Thank You very much for answering! So for now my topic is resolved. 

Will the warning from Google Play - that the App has to support SDK 28 in August - automatically disappear when I build with the new version of Corona SDK (when it appears) ?

Once we release support for that API level, if you rebuild your app, that warning should disappear.

Rob

We have encountered this and can’t see a way around it - has this bug seen any movement yet?

We have reached out to OneSignal to see if we can get an update. I’ll update here when I hear something. You probably should reach out to OneSignal as well.

Rob

Hi Rob, I have the same error of first post with onesignal plugin. The app crash if it’s on background and when receive a push from onesignal.

AndroidRuntime: java.lang.RuntimeException: Unable to start receiver com.onesignal.GcmBroadcastReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=xxx/com.onesignal.GcmIntentService (has extras) }: app is in background uid UidRecord{3ec248 u0a370 RCVR idle procs:1 seq(0,0,0)}

I have the latest version of corona sdk (daily build). The plugin is updated?

The OneSignal plugin is provided by OneSignal. It does not appear the plugin has been updated since January. We’ve reached out to them, but haven’t heard anything. Perhaps it would be more impactful if more community developers reached out to them to encourage them to update the plugin.

Rob

This is a serious disappointment. oneSignal’s Corona SDK plugin is causing a huge number of crashes and remains the most significant issue in our published app.

java.lang.IllegalStateException

com.onesignal.GcmBroadcastReceiver.processOrderBroadcast

Samsung Galaxy S8 (dreamlte), Android 8.0 (ONE OF MANY)

java.lang.RuntimeException :

at android.app.ActivityThread.handleReceiver (ActivityThread.java:3397)

at android.app.ActivityThread.-wrap18 (Unknown Source)

at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1780)

at android.os.Handler.dispatchMessage (Handler.java:105)

at android.os.Looper.loop (Looper.java:164)

at android.app.ActivityThread.main (ActivityThread.java:6938)

at java.lang.reflect.Method.invoke (Native Method)

at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

Caused by: java.lang.IllegalStateException :

at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1538)

at android.app.ContextImpl.startService (ContextImpl.java:1484)

at android.content.ContextWrapper.startService (ContextWrapper.java:663)

at android.content.ContextWrapper.startService (ContextWrapper.java:663)

at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService (WakefulBroadcastReceiver.java:99)

at com.onesignal.GcmBroadcastReceiver.processOrderBroadcast (GcmBroadcastReceiver.java:76)

at com.onesignal.GcmBroadcastReceiver.onReceive (GcmBroadcastReceiver.java:59)

at android.app.ActivityThread.handleReceiver (ActivityThread.java:3390)

I just reached out to oneSignal via their online chat. The response I received was “back tomorrow”

I believe Corona’s 2018 update to its Notifications Plugin will provide the best alternative to avoid this problem: https://marketplace.coronalabs.com/corona-plugins/notifications

I’m working to implement it now.

@Rob, @CoronaLabs, 1) does the latest CoronaLabs notifications plugin work on all Android version 5+? We have enjoyed using the oneSignal API to send notifications to specific devices? 2) Do you know if the GCM service can be used via an API to do the same thing? Of course I can research this, but I was just curious if you or anyone at CoronaLabs knew the answer to this. Thanks for all your help!

There are two versions of the notification plugin. The older version does Google’s GCM messaging. The newer version does Firebase messaging. Both should work on all supported versions of Android as long as Google still supports GCM on the platforms.

I’ve not used oneSignal, but basically when you use a service like Urban Airship, or Pushwoosh, what you’re getting is a web interface to send out push notification to your customers. They allow you to segment your audience and support other features. In other words, it’s what your customer would do to send the actual message.  I believe oneSignal provides this service.  iOS APNS and Google’s push services (GCM and FCM) job is to take messages that come in via there API which broadcasts the messages to the devices.

Now FCM may have a web interface to handle sending out messages. I’ve never used it.

We don’t have any direct API’s to broadcast messages through FCM, but I think they have a REST API for doing it.

Rob

No news from onesignal. I have written via chat online but no answers… Manual settings of notifications it’s too long for me. Do you have another service integrated in corona sdk?

https://www.pushwoosh.com/docs/corona-sdk

It’s active?

 @fixr, I’ve implemented pushwoosh before, then oneSignal - in both cases, I’ve had problems after they were initially working. My team is working to resolve the issues of Scott’s Firebase plugin (for analytics) and Corona’s Notifications plugin (recently updated) working together. We are hopeful to have the solution to this shortly, as our current LIVE app is crashing more than 1000 times a month (thanks to OneSignals failures) and publish a sample app for all. Stay tuned.

@troylyndon Thank you! I’ve also written a private message to https://forums.coronalabs.com/user/496106-josh-onesignal/

that it’s a member of onesignal

You might also want to look at PlayFab and/or GameSparks. I believe they both support sending push notifications. 

What might also be helpful is to understand how you’re using push notifications.

One common use, for instance, is a news organization would use a service like PushWoosh or Urban Airship to log in, write the text for a push, provide a URL to a story and blast that out to all app users. The push would arrive at the app and if interacted with, bring the app to the foreground and if reasonable, deep link to the article.

Turn-based games on the other hand, will send a message to the game server indicating that the player has completed the turn and the game server will send a targeted push to the other player. If the player is active, usually the game server will transmit the message. If the app is in the background a push notification would let the user interact with it and bring the game to the foreground and process the turn.

I’m sure there are other uses which is why I think it would be helpful to know how you plan to use push in your apps?