Skip to content
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

Game crashes when send notification message from firebase to game using token #96

Open
sahanasalim opened this issue Feb 22, 2017 · 6 comments

Comments

@sahanasalim
Copy link

sahanasalim commented Feb 22, 2017

->Got event token by using below code;
var push: PushNotification = PushNotification.getInstance();
if (push.isPushNotificationSupported) {
push.registerForPushNotification("XXXXXXXXXXXX"); //App ID
}
push.addEventListener(PushNotificationEvent.PERMISSION_GIVEN_WITH_TOKEN_EVENT, onRegistered);
function onRegistered(event: PushNotificationEvent): void {
txtMsg.text = "" + event.token;
}

->My XML file is ;

xml.docx

->I am using below ANE & not using SDK ;
https://github.com/freshplanet/ANE-Push-Notification/blob/master/bin/AirPushNotification.ane
->I am using firebase for sending notification message to game.
Game crashes when send notification message from firebase to game using token & i am not getting any notification. i want to send notification message from firebase to game ... please Help!!! for solve this problem.

@esdebon
Copy link

esdebon commented Mar 1, 2017

A wrong structure in the incomming message (JSON) cause a crash in the apps,

{
"tickerText ":"asdf @ asdfasdf",
"contentText ":"asdf @ asdfasdf",
"collapse_key":"do_not_collapse",
"from":"570916618362",
"contentTitle ":"PromoScope"
}

check:
#32 (comment)

@maheenkhalid
Copy link

It still does not work.

@maheenkhalid
Copy link

I can see the notification that I am getting from the server in the console. But Application just crashes. It is so disappointing.

@yokoboko
Copy link

yokoboko commented Apr 7, 2017

I'm having the same problem. If anyone knows how to fix this please share.

@yokoboko
Copy link

yokoboko commented Apr 10, 2017

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

@AmirSmarty
Copy link

Not working for me.Can you help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants