2014-11-09 7 views
0

gcm Android를 사용하여 RMSPushNotificationsBundle을 사용하여 메시지를 보내려고합니다. 그것은 메시지를 보낼 때 클래스 공지 사항에서, 핸들러를 추가하려고입니다gcm RMSPushNotificationsBundle에서 지원하지 않습니다

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

: 이 오류 받고 있어요 당신이 번들로 심포니와 함께 사용할 때

$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); 

답변

0

config.yml (see docs)에 os를 구성한 경우 처리기가 자동으로 추가됩니다.

그렇지 않은 경우 모든 OS에 대한 처리기 클래스가 있습니다. 그것을 인스턴스화하고 구성하고 추가해야합니다.

예 :

$iosHandler = new \RMS\PushNotificationsBundle\Service\OS\AppleNotification(ADD_CONFIG_PARAMS_HERE); 
$notifPush->addHandler('rms_push_notifications.os.ios', $iosHandler); 
관련 문제