freshplanet / ANE-Push-Notification

Air Native Extension (iOS and Android) for Push Notification
Apache License 2.0
205 stars 104 forks source link

app crashes after receiving push message on android. #90

Open emreayaydin opened 8 years ago

emreayaydin commented 8 years ago

Hello there! Thank you for your ane. It works on ios perfectly but on android doesn't. When I sent a push notification from server app crashes suddenly. Please help!

mrfrasier commented 8 years ago

I'm seeing the same on android

Image

Laur3nt1u commented 8 years ago

Read issue #88

mrfrasier commented 8 years ago

Thanks, I did after this one, but there doesn't seem to be a resolution there. I did see your post and worked to remove google services, but because it's used by more than one ANE, it's not exactly practical in our situation.

skolesnyk commented 8 years ago

I've managed to compile the ANE to be compatible with OneSignal. I'll make a few changes to remove project specific icons and will push to my repo.

One thing, though, it only works specifically through my rest server. For full onesignal compatibility one should purchase Milkman's ANE.

redsparrowWang commented 8 years ago

i had recompile ANE , when receive notification i got this error

08-31 08:45:48.410 12608-12608/? E/dalvikvm: Could not find class 'android.support.v4.app.NotificationCompat$Builder', referenced from method com.freshplanet.nativeExtensions.CreateNotificationTask.onPostExecute 08-31 08:45:48.410 12608-12608/? W/dalvikvm: VFY: unable to resolve new-instance 164 (Landroid/support/v4/app/NotificationCompat$Builder;) in Lcom/freshplanet/nativeExtensions/CreateNotificationTask; 08-31 08:45:48.420 12608-12608/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41ef5438) 08-31 08:45:48.430 12608-12608/? E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NullPointerException at com.freshplanet.nativeExtensions.CreateNotificationTask.onPostExecute(Unknown Source) at com.freshplanet.nativeExtensions.CreateNotificationTask.onPostExecute(Unknown Source) at android.os.AsyncTask.finish(AsyncTask.java:631) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4903) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:559) at dalvik.system.NativeStart.main(Native Method)

yokoboko commented 7 years ago

I fixed it. You can download ANE from here: https://www.dropbox.com/s/mvjgx0tg1cmz9e1/AirPushNotification.ane?dl=0

You should send: {"contentTitle":"Title..","contentText":"Message...","tickerText":"...","priority":"2"} *priority is optional(-2 <---> +2) ** it will not crash if you don't send all params

You will need AIR 25+

To change the icons: 1) Rename to .zip 2) Open with WinRar(don't extract!) 3) Drag and drop your icons to "\META-INF\ANE\Android-ARM\res\drawable-xhdpi" to replace files 4) Close WinRar and change file name back to .ane