Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Push Notification Data not available in Android #437

Closed
baltejsingh88 opened this issue Dec 17, 2015 · 15 comments
Closed

Push Notification Data not available in Android #437

baltejsingh88 opened this issue Dec 17, 2015 · 15 comments

Comments

@baltejsingh88
Copy link

I am building an app where i am using Parse Push Notifications.
I did successfully add this plugin without any issues.
I sent some pushes from Parse and testing on both devices iOS and Android.

push.on('notification', function(data) {

// OVER here i am having things frmo additionalData to send the user to the apprpriate screens based on the Push Data. This works perfectly in iOS but not in Android, in Android it deosnot even enter here and show any data from Push Notificaton, not even a blank.
])

Framework i am using: Ionic Framework
Push Notification Service i am using: Parse

More Details:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.8.11
Gulp local:
Ionic Version: 1.1.0
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.3
ios-sim version: 3.1.1
OS: Mac OS X El Capitan
Node Version: v4.2.3
Xcode version: Xcode 7.0 Build version 7A220

@baltejsingh88
Copy link
Author

Please help!

@baltejsingh88
Copy link
Author

@macdonst Please help me in resolving this issue!

@baltejsingh88
Copy link
Author

Why is it not working for Android.. whereas for iOS it works perfectly!

@baltejsingh88
Copy link
Author

@macdonst Simon can you please help me with this? If you cannot please just message!

@nicoabie
Copy link

@codecrab-studios do you have any adb output?

@baltejsingh88
Copy link
Author

adb output like?

@smdvdsn
Copy link
Collaborator

smdvdsn commented Dec 18, 2015

Also how are you sending the push message? Using the Parse REST api or from the Parse dashboard?
What does your message payload look like?

Also make sure that the android senderID you use in the PushNotifcation.init call matches what you are have in the GCMSenderID for your install on Parse.com or you are initialising the push plugin with Parse's senderid

@baltejsingh88
Copy link
Author

I was sending pushes from Parse Dashboard wiht Additional Data and reading it from app. Everything works smoothly on iOS but not on Android! It doesnot even show data in push.on('notification')

@baltejsingh88
Copy link
Author

push.on('notification', function(data) {
console.log(angular.toJson(data, true));
})

For iOS it works well! and not in Android! Also I am able to recieve Push in Android, but it just doesnot enter into the above push function so i can read the Push Data!

@baltejsingh88
Copy link
Author

@smdvdsn Yes! I added SenderID in Parse.com to that have in PushNotification.init

@nicoabie
Copy link

@codecrab-studios can you query the result of the sending of that message in the dashboard? To check if it could reach the device?

@baltejsingh88
Copy link
Author

@nicoabie Yes! it does reaches the device and i see in top status bar, but what i am saying is: If i have the app Open or Click the Push Notification, it should enter push.on('notification', function(data) { and process other things from Push Notification Data, but it doesn't, whereas in iOS its working perfectly!

@nicoabie
Copy link

Looking here I see that maybe you need to add a content-available flag.
Here is where the message is received on android. Hope that helps @codecrab-studios

@macdonst
Copy link
Member

macdonst commented Jan 6, 2016

Possibly the same issue as #469

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants