Comments (16)
Hi @DineeshDS ,
have you tried to set 'dry_run' to false in pushnotification.php/gcm config ?
from pushnotification.
yes i have tried with dry_run false
from pushnotification.
Could you show me the feedback after sending the notification?
You just can get it using getFeedback()
method
from pushnotification.
This is the response
#url: "https://android.googleapis.com/gcm/send"
#config: array:3 [
"priority" => "normal"
"dry_run" => false
"apiKey" => "AAAAzNWar6k:APA91bFifq79w9hjoEnuwDv1swLhG0GM0_bim2gfDoJZmg0gwKwqmH6byd5fUcAwfPwWsfJJ4Vy0JO2Ajf0d6c-hW5y70SIelBr5POAJOUDuHWesz_Bt5HOsBoe3Kum"
]
#feedback: {#6372
+"multicast_id": 7028173908884911686
+"success": 1
+"failure": 0
+"canonical_ids": 0
+"results": array:1 [
0 => {#6335
+"message_id": "0:1530786565588271%7b6555eff9fd7ecd"
}
]
}
}
#servicesList: array:3 [
"gcm" => "Edujugon\PushNotification\Gcm"
"apn" => "Edujugon\PushNotification\Apn"
"fcm" => "Edujugon\PushNotification\Fcm"
]
-defaultServiceName: "gcm"
#deviceTokens: array:1 [
0 => "APA91bGN-Ng4CaQyWqMfzcmu21kU-HWyLwIS8yoR2U7K_ZYRF6MS8ARqSkb3encMr2sxft8wtmZUbkrTUwZP0P8UURLwVgsLe3DU7UD-CjSvkPWMabKMGUXviTEjjfq4QLmqf7GtH6d5"
]
#message: array:2 [
"notification" => array:3 [
"title" => " test"
"body" => "test"
"sound" => "default"
]
"data" => array:2 [
"extraPayLoad1" => "value1"
"extraPayLoad2" => "value2"
]
]
from pushnotification.
After checking the above info, I can say that the notification was sent you.
This is the GCM message id confirming it was sent out successfully: 0:1530786565588271%7b6555eff9fd7ecd
Now, I would recommend to check your client implementation and confirm that it's really getting the notifications.
from pushnotification.
Yeah, I have check with my client device , but push notification is not getting, We have tried https://www.pushwatch.com/gcm/ with same api key and device id at that time getting notification.
from pushnotification.
are you using the same message structure as the package use? could you paste here the message you're sending through pushwatch?
The notification feedback is provide by the notification provider, so in this case by GCM server, and its response is successfully. I just can think of there could be some differences between the messages structure.
from pushnotification.
Yes, sure
$push = new PushNotification();
$push->setMessage([
'notification' => [
'title'=>'This is the title',
'body'=>'This is the message',
'sound' => 'default'
],
'data' => [
'extraPayLoad1' => 'value1',
'extraPayLoad2' => 'value2'
]
])
->setApiKey('AAAAzNWar6k:APA91bFifq79w9hjoEnuwDv1swLhG0GM0_bim2gfDoJZmg0gwKwqmH6byd5fUcAwfPwWsfJJ4Vy0JO2Ajf0d6c-hW5y70SIelBr5POAJOUDuHWesz_Bt5HOsBoe3Kum_O0sRiLbvIcZX')
->setDevicesToken(['APA91bGN-Ng4CaQyWqMfzcmu21kU-HWyLwIS8yoR2U7K_ZYRF6MS8ARqSkb3encMr2sxft8wtmZUbkrTUwZP0P8UURLwVgsLe3DU7UD-CjSvkPWMabKMGUXviTEjjfq4QLmqf7GtH6'])
->send();
from pushnotification.
I asked for the message you are sending via pushwatch :)
Since the notification response is successful, I just can think of the messages format don't match..
Could you debug the notification in your client app? just if receives something, log it. if you do so, do you see something in the log?
from pushnotification.
Sorry , In the client side they can only read those message which send from pushwatch, Client is a Xamarin mobile app, They reporting that they cant access log or message structure
from pushnotification.
Could you try to send the notification like below:
$push->setMessage([
'title'=>'This is the title',
'body'=>'This is the message'
]);
from pushnotification.
Hi @DineeshDS ,
Any luck with my previous message?
from pushnotification.
No, Status is same, Push triggering from my side , But not receiving in client side
from pushnotification.
$push = new PushNotification('fcm');
$push->setMessage([
'title'=>'This is the title',
'body'=>'This is the message'
])
->setApiKey(env('GOOGLE_FCM_KEY', false))
->setDevicesToken('f2_OPr9e5c4:APA91bHnw6e9NHm3z6bTo0pI0swdjas9h4P9uEgincvyNS0UXPHx071ZIyh3MmJvAjMm3yOYRh4-y16BrsqB08Zw9fzwxiBCDH9BSNuqsRQsikNVq-NRiLlqf4PM_03gA_BMkbNHFgUEy3agGf4s35Af4MlDBAWxKg')
->send();
Above sends the message successfully but crashes my app.
Following sends message successfully and the notifications appears on the same app normally.
$url = "https://fcm.googleapis.com/fcm/send";
$token = "f2_OPr9e5c4:APA91bHnw6e9NHm3z6bTo0pI0swdjas9h4P9uEgincvyNS0UXPHx071ZIyh3MmJvAjMm3yOYRh4-y16BrsqB08Zw9fzwxiBCDH9BSNuqsRQsikNVq-NRiLlqf4PM_03gA_BMkbNHFgUEy3agGf4s35Af4MlDBAWxKg";
$serverKey = env('GOOGLE_FCM_KEY', false);
$title = "Title";
$body = "Body of the message";
$notification = array('title' =>$title , 'text' => $body, 'sound' => 'default', 'badge' => '1');
$arrayToSend = array('to' => $token, 'notification' => $notification,'priority'=>'high');
$json = json_encode($arrayToSend);
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: key='. $serverKey;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST,"POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
//Send the request
$response = curl_exec($ch);
//Close request
if ($response === FALSE) {
die('FCM Send Error: ' . curl_error($ch));
}
curl_close($ch);
Any issues?
Thanks.
from pushnotification.
@Edujugon issue with push notification is solved , we have implemented FCM in client side. Thank you
from pushnotification.
@DineeshDS cool!
Happy to hear that :)
from pushnotification.
Related Issues (20)
- Unable to send notifications via FCM.
- Content-Type:" is not valid header name HOT 6
- Document breaking change in v4.5.1?
- [L 6.0]Testing push notification
- Breaking change in 4.5.1: Undefined index: headers HOT 2
- loc-key and loc-args on the payload
- Undefined index: headers HOT 7
- Need support of Voip
- Badge count not working with fcm
- Push notiication not working on Ios
- update to newer versions
- notifications not sendings HOT 2
- Installation issue with laravle9.2 HOT 4
- Issue in Laravel 9.2 HOT 7
- FCM Api Key HOT 2
- add support for huawei
- cannot send push notifications(ios, android)
- Error al crear $push = new PushNotification
- MissingTopic HOT 1
- Migrating from legacy FCM to HTTP v1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pushnotification.