RMS推送通知捆绑包中不支持gcm

时间:2014-11-09 19:21:37

标签: notifications bundle push

我正在尝试使用带有gcm Android的RMSPushNotificationsBundle发送消息。 我收到了这个错误:

Uncaught exception 'RuntimeException' with message 'OS type rms_push_notifications.os.android.gcm not supported'

它将在发送消息时在Notifications类中添加一个处理程序:

    $notifPush = new RMS\PushNotificationsBundle\Service\Notifications();
use RMS\PushNotificationsBundle\Message\AndroidMessage;
$message = new AndroidMessage();
$message->setMessage('oh it\s a new Week');
$message->setDeviceIdentifier('xxxxxxx');
$message->setGCM(true);
$notifPush->addHandler('android','gcm');
$notifPush->send($message);

1 个答案:

答案 0 :(得分:0)

当您将symfony用作捆绑包时,如果您在config.ymlsee docs)中配置了操作系统,则会自动添加处理程序。

如果没有,每个操作系统都有一个处理程序类;你需要实例化,配置和添加它。

示例:

$iosHandler = new \RMS\PushNotificationsBundle\Service\OS\AppleNotification(ADD_CONFIG_PARAMS_HERE);
$notifPush->addHandler('rms_push_notifications.os.ios', $iosHandler);
相关问题