NOT MAINTAINED! ⛔️ Push notifications/messages for mobile devices. Supports iOS, Android (C2DM, GCM), Blackberry and Windows Mobile (toast only). A Symfony2 bundle.
MIT License
321
stars
152
forks
source link
IOS Push Notifications for multiple Apps from one server #113
I am sending pushNotifications to multiple apps from one server. I am using setAPNSPemAsString method which pick right certificate. But push notification is sent only first time. Can anyone tell me why? Thank you!
public function sendIOS($appName){
$notifications = $this->container->get('rms_push_notifications');
$message = new iOSMessage();
$message->setMessage($this->message);
$message->setData($this->getData());
$message->setAPSSound("default");
$message->setDeviceIdentifier($this->pushToken);
if ($appName !="appName") {
$pemFile = $this->container->getParameter("rms_push_notifications.ios.".$appName.".pem");
$passphrase = $this->container->getParameter("rms_push_notifications.ios.".$appName.".passphrase");
$pemContent = file_get_contents($pemFile);
$notifications->setAPNSPemAsString($pemContent, $passphrase);
}
return $notifications->send($message);
}
I am sending pushNotifications to multiple apps from one server. I am using setAPNSPemAsString method which pick right certificate. But push notification is sent only first time. Can anyone tell me why? Thank you!