richsage / RMSPushNotificationsBundle

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

Closed gasperhafner closed 8 years ago

gasperhafner commented 8 years ago

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);
}
andreichirkunovgoon commented 8 years ago

Did you manage to fix the problem?

gasperhafner commented 8 years ago

Yes, thank you.