我正在尝试在使用Twilio IP消息传递的应用上获取推送通知。遵循twilio指南的说明。
注册远程通知的AppDelegate功能运行良好 - iOS设备成功地将设备令牌提供给Twilio客户端。但是,TwilioIPMessagingClient在注册令牌时没有给出成功或失败的指示。我也使用了代理,而且,当发送消息时,我没有得到任何推送通知的迹象。
我已经检查了日志,在那里我可以看到正确的日志:
TNNotificationClient | Starting registration..., id: <....>
TNRegTransport | Creating registration: apn - <....>
TNRegTransport | Registration is created, location: https://ers.us1.twilio.com/v1/registrations/<...>
我到底错过了哪里?经过多次研究后我得知的一点是,在服务器PHP应用程序中,我需要启用推送IPMesaging服务客户端,因为默认情况下禁用它。如果是,我必须启用它的确切地或在哪个.php文件中?
参考: https://www.twilio.com/docs/api/ip-messaging/guides/push-notification-configuration
答案 0 :(得分:0)
其他人最近解决了这个问题,意识到他们没有将PHP New Message
notification type设置为显式启用,如下所示:
// Update the service webhooks
$service = $client->services->get("YOUR_IP_MESSAGING_SERVICE_SID");
$response = $service->update(array(
"Notifications.NewMessage.Enabled" => "true",
"Notifications.NewMessage.Template" => "A New message in ${CHANNEL} from ${USER}: ${MESSAGE}",
));
?>
这会为你解决吗?