I have an iOS app which is live on the app store. I am able to send push notifications to iOS devices which have the app installed, but only when I send them from the Fireba
There were two issues:
notification section in the payload instead of dataIn the end I used the PHP function shell_exec() to do a cURL request over SSH instead. This isn't ideal but it got the job done.
Example code:
shell_exec('curl -X POST --header "Authorization: key=" --header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"to\":\"'.$to.'\",\"priority\":\"high\",\"notification\":{\"body\": \"'.stripslashes($message).'\"}}"');