-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crashes after receiving push message #88
Comments
I think it depends on what version of google play services you have, for me it crashed because of .setColor with google play services from lilili87222’s admob so I use admob without gps with my google play services (updated in december) and my fork for push notification |
Some post says that the ios is working fine. So it could be any issue with changing config file? bcoz there is nothing to do with the ane in ios as per the documentation. |
your app crashes on ios or android? |
Its in android. |
the android and ios code are different so a bug in one will not affect the other, to track the issue you can look at the logcat when the app get the notification and crashes to see what's wrong |
Thank you, I have checked using logcat. It is not showing the reason for app crash. It just displays the recieving message. I tried the debug using usb method. But not sure where to trace the details. I found an actionscript file in folder "PushNotification.as". If I tried to add a trace statement inside it, it wont be showing as I may need to recompile the ane. Am not sure how it is. :( |
post the logcat if you can |
swarajcs - Are you setup to compile the ANE yourself? If so try adding debug comments to the .java source. By having the android SDK installed you can run 'monitor' from the command line and see the DDMS logcat for the device. It will show you the full stack trace of your issue. I was able to work around these issues in a fork of the code. It depends on what keys are being sent in your bundle. They are not doing a good job of checking for null values when building the notification.
I found that my Push Notification service did not use "contentTitle" and "contentText" so the app would crash when trying to create the notification. I had to run a check to see what the keys actually were: I was then able to handle the keys properly. Same thing in the NotificationActivity.onCreate() they are assuming that: |
sorry. Am not sure about how to do that. is there anything wrong in my code? Do I have to recompile ane ? Or just to change the path in build.config? |
Does it mean that this ANE has to be adapted to particular Push Provider? I've recently switched from Parse to OneSignal. Trying to figure out how to adapt the ANE to fit my needs. OneSignal sends a push object wrapper in "custom" property holding JSON data, e.g. "custom":"{ |
@swarajcs My suggestion was to modify the ANE to add some additional logging into the following classes:
In the onPostExecute(), I had to modify the string params coming in since they did not match what was hard coded into the ANE. My function ended up looking like this:
the rest didn't change For me this little debug output helped me track down the differences in what my push services was sending vs what the ANE was expecting.
@skolesnyk Looks like you are seeing the same thing, that the data being returned isn't in the expected format. I would expect you would need to also need to modify the intent parameters. |
I fixed it. You can download ANE from here: You should send: {"contentTitle":"Title..","contentText":"Message...","tickerText":"...","priority":"2"} You will need AIR 25+ To change the icons:
|
Hi,
am getting the message
[StatusEvent type="status" bubbles=false cancelable=false eventPhase=2 code="LOGGING" level="Received push notification with parameters: {"tickerText":"Test","collapse_key":"do_not_collapse","from":"xxxxxxxxxxxx","contentTitle":"Offer","contentText":"Testing"}"] Received push notification with parameters: {"tickerText":"Test","collapse_key":"do_not_collapse","from":"xxxxxxxxxxxx","contentTitle":"Offer","contentText":"Testing"}
but the app crashes after that. What could be the reason? Am using flash cs6 . How can I track the issue and fix it?
I have changed the build.config .
name=AirPushNotification
useMultiMsg=false
flex.sdk=/path/to/your/flexsdk/folder
bin.ext=
ios.sdkversion=iphoneos
android.sdk= D:\android_sdk_install\platforms\android-23
android.res= E:\efolder\test_android\ANE-Push-Notification-master(1)\ANE-Push-Notification-master\android\res\drawable-xhdpi
Just saved the path and do I have to make any changes or do anything for ane?
This is how I editted the xml file.
< uses-permission android:name="android.permission.INTERNET"/>
< uses-permission android:name="android.permission.READ_PHONE_STATE"/>
< uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
< uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
< uses-permission android:name="xxxxxxxxxxxxxxxxxxxxxxxxxx.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
< uses-permission android:name="xxxxxxxxxxxxxxxxxxxxxxxxxx.permission.C2D_MESSAGE" />
< uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
< application>
< activity android:name="com.freshplanet.nativeExtensions.NotificationActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
< receiver android:name="com.freshplanet.nativeExtensions.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
< intent-filter>
< action android:name="com.google.android.c2dm.intent.RECEIVE"/>
< category android:name="xxxxxxxxxxxxxxxxxxxxxxxxxx"/>
< /intent-filter>
< intent-filter>
< action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
< category android:name="xxxxxxxxxxxxxxxxxxxxxxxxxx"/>
< /intent-filter>
</ receiver>
< service android:name="com.freshplanet.nativeExtensions.LocalNotificationService"/>
< receiver android:name="com.freshplanet.nativeExtensions.LocalBroadcastReceiver" android:process=":remote"/>
< /application>
any bug in xml?
Please help. Hope I could get an option to how track the issues..
Thanks,
The text was updated successfully, but these errors were encountered: