miku
Aspiring developer
Profile
Posts: 405
Reg: Feb 20, 2014
zagorje ob savi
10,600
07/21/16 12:13 AM (8 years ago)

OneSignal PN in Android Studio

I use OneSignal PN in iOS apps and works fine, but in Android it doesn't. I followed manuals: https://www.dropbox.com/s/65w171glhwld32f/OneSignal%20GCM%20BT%203%20Android.pdf?dl=0 Compiling works, but app doesn't. I asked people from OneSignal and they send me this: -------------------------- 07-20 14:08:40.334 343-343/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.vagapolitike, PID: 343 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vagapolitike/com.vagapolitike.BT_activity_host}: java.lang.IllegalStateException: No receivers for action com.google.android.c2dm.intent.REGISTRATION at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.IllegalStateException: No receivers for action com.google.android.c2dm.intent.REGISTRATION at com.google.android.gcm.GCMRegistrar.checkReceiver(GCMRegistrar.java:184) at com.google.android.gcm.GCMRegistrar.checkManifest(GCMRegistrar.java:169) at com.vagapolitike.BT_activity_host.configureEnvironment(BT_activity_host.java:298) at com.vagapolitike.BT_activity_host.onCreate(BT_activity_host.java:132) at android.app.Activity.performCreate(Activity.java:6251) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Our SDK does not use `com.google.android.c2dm.intent.REGISTRATION` so this must be coming from another SDK/plugin in your app. --------------------------------- In my manifest I commented this: <!-- Google Cloud Messaging --> <!-- <receiver android:name="com.vagapolitike.BT_gcmReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="com.vagapolitike" /> </intent-filter> </receiver> <service android:name=".BT_gcmIntentService" />--> --------------------- but still nothing better. I think OneSignal is really good solution for PN and would be very fine to have it in all my apps. If you guys can make it work, all BT community will be much happier.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.