Page 1 of 1

Android push notifications error

Posted: Sun Jun 28, 2015 11:23 am
by Uzhiel Bautista

Hello,

We are having problems getting push notifications to work for Android.

We are using our own database to manage tokens which is working in IOS, but not Android. The last two lines are outputted by our app, but everything above it suggests that there is an error getting a Push Notification token, even though we have set and double-checked our credentials.

Following our details of our Appery/android configuration and log output from logcat.

Thanks in advance.

Our configurations are:

Appery lib version: 2.2
Android Sender ID + API Key: Both are set and double checked
Android Certificate: Uploaded and set as default
Tested targets: 4.1.2 and 4.4.4

Using logcat we find the following:
D/CordovaLog(23419): file:///android_asset/www/files/resources/lib/cordova.js: Line 305 : Error in Error callbackId: PushNotification1450183506 : TypeError: Cannot read property 'length' of undefined
D/CordovaLog(23419): file:///android_asset/www/files/resources/lib/cordova.js: Line 1075 : processMessage failed: Error: TypeError: Cannot read property 'length' of undefined
D/CordovaLog(23419): file:///android_asset/www/files/resources/lib/cordova.js: Line 1076 : processMessage failed: Stack: TypeError: Cannot read property 'length' of undefined
D/CordovaLog(23419): at file:///android_asset/www/Start.js:372:54
D/CordovaLog(23419): at Object.callbackFromNative (file:///android_asset/www/files/resources/lib/cordova.js:288:52)
D/CordovaLog(23419): at processMessage (file:///android_asset/www/files/resources/lib/cordova.js:1070:21)
D/CordovaLog(23419): at file:///android_asset/www/files/resources/lib/cordova.js:1107:13
D/CordovaLog(23419): file:///android_asset/www/files/resources/lib/cordova.js: Line 1077 : processMessage failed: Message: F07 PushNotification1450183506 sInvalid action
D/CordovaLog(23419): null: Line 889 : Android User token
D/CordovaLog(23419): null: Line 891 : Android User token false


Android push notifications error

Posted: Tue Jun 30, 2015 2:16 pm
by Evgene Karachevtsev

Hello Uzhiel,

Could you please clarify are you able to send push notification from your app if you link it to Appery.io database?


Android push notifications error

Posted: Wed Jul 01, 2015 1:28 pm
by Uzhiel Bautista

Hi Evgene,

No, we haven't but we can try linking it to an Appery db. However we would prefer the Android push notifications to work with our own db as iOS is working fine.

We only need for the pushNotificationToken local storage variable to be populated at startup on Android.

Do the appery + cordova libs depend on a link to an Appery push database, to generate push tokens for Android?

Thanks for your help,

Uzhiel


Android push notifications error

Posted: Sun Jul 05, 2015 5:37 am
by Uzhiel Bautista

Hi Evgene,

We rolled back to the v2.1 libraries, linked to a test Appery.db and we were able to generate a push notification token.

Since we are using Google App Engine to manage tokens, we unlinked the Appery.db and we find that it still works after unlinking!

It was like the process of linking to the Appery.db made some kind of change to the source which now allows it to work even without the a db linked. Would this be correct?

Thanks,
Uzhiel


Android push notifications error

Posted: Sun Jul 05, 2015 1:31 pm
by Emmz

We are getting the exact same logcat error messages as Uzhiel Bautista.
There is no Appery push DB associated to App.
We use our own internal service, which works fine.
Lib ver 2.1


Android push notifications error

Posted: Mon Jul 06, 2015 12:03 pm
by Uzhiel Bautista

Hi Neil,

Just wondering if you managed to solve this one?

We were able to get tokens to generate in Android now after temporarily linking to an appery db, saving and exporting. After confirming the tokens are generated, we unlinked the db and saved and exported again.

We are using lib 2.1

Hopefully this will solve the issue if you are still experiencing it.

Uzhiel


Android push notifications error

Posted: Mon Jul 06, 2015 3:05 pm
by Emmz

Good to Know. Thanks.
I linked a Appery push db to app. Will create a new Eclipse project with changes and report back here with results.