-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Google cloud messaging GCM - Push Notification not being sent (Server Side) #110
Comments
This may be related: #101 @dummyltpl try to put your app in foreground and try again. Also use the command "adb logcat" to see if your mobile receive the push (it may receive it but not displaying it) |
trying to put app in foreground and its not working.Unable to figure out the issues. |
@dummyltpl when you send the push, give the logs of Without the logs you don't help to resolve the issue. Also give the code in your app where you listen for notifications. Also, try using curl instead of your php code and don't forget to put a title/body:
Also test both in background/foreground (and give logcat logs for both) You can also give a try to this fork which solved an issue I had: |
@slorber thank you for responding to issues and contributing code, it is greatly appreciated. Also, I just pushed 1.2.3 to npm so you don't need to use the url to the master branch. |
np ok thanks i'll use this version instead :) |
same problem for me, i get registered id but i do not get any push. |
@roysG how are you sending the push? Need some details if I can debug. |
i am sending the push through node js, this code worked great with previous(deprecated) version of the push plugin. Code below:
//API Server Key // Value the payload data to send...
//message.collapseKey = 'demo';
|
@roysG I see no reason why that wouldn't work. My test gcm.js file is very similar. Are you remembering to updated your registration ID you get from the registration event in the Other than that run |
i did the test with adb logcat | grep PushPlugin, but i get nothing, there is no any message. can you send me your gcm.js test ? and write my your steps, i do not understand why is happen, i follow the steps for the installation. |
@macdonst, many thanks, |
This thread has been automatically locked. |
Hi,
'here is a message. message', 'title' => 'This is a title. title', 'subtitle' => 'This is a subtitle. subtitle', 'tickerText' => 'Ticker text here...Ticker text here...Ticker text here', 'vibrate' => 1, 'sound' => 1, 'largeIcon' => 'large_icon', 'smallIcon' => 'small_icon' ); $fields = array ( 'registration_ids' => $registrationIds, 'data' => $msg ); $headers = array ( 'Authorization: key=' . API_ACCESS_KEY, 'Content-Type: application/json' ); $ch = curl_init(); curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' ); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) ); $result = curl_exec($ch ); curl_close( $ch ); echo $result; ?>I am able to get the device id and save it to my database, and when something happens, I try to send the push notification and get the response
"{"multicast_id":5913087252880472009,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1441610705462116%d477807af9fd7ecd"}]}"
but it does not get delivered to the phone.
Here is what I do in my PHP:
Please help me to resolve this issue.
The text was updated successfully, but these errors were encountered: