I am trying to send Push notification to android app through php. I setup amazon sns account and created SNS Platform using Google Server key for GCM API.
Using AWS credentials, i wrote a cron which reads notification message from database and publishes to sns service using amazon php api. I am getting Amazon endpoint in cron on which i publish notification.
I am receiving status as pass and a requestid for notification. But actual notification is not receiving on device.
Array ( [data] => Guzzle\Service\Resource\Model Object ( [structure:protected] => [data:protected] => Array ( [MessageId] => ac9e1d0c-43a4-5d1a-833d-50c94465421d [ResponseMetadata] => Array ( [RequestId] => c1da8997-2e32-50d0-a092-c45229f36fd7 ) ) ) )
Steps I followed:
Created google API credentials for GCM. Used projectid in app and Server key for Amazon platform
Created user in aws and added policies with all access for sns
Used amazon user credentials in php aws api
Created amazon sns application platform form Android/GCM and used google server key there.
Added Application ARN received from above steps to php api calls.
In php cron, created AmazonEndpoint for device using registration_id received from GCM.
Published notification message on amazon endpoint.
and stuck ......not receiving notification on device even after getting success status in api call
Can anyone tell me exact steps? Am i missing anything?
I used Firabase and AWS SNS service for sending from php. I did it step by step according to this video tutorial https://youtu.be/iBTFLu30dSg (on russian but with English subtitles). It works well for me now and I successfully receive push notification from my php code on the mobile devices
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With