【问题标题】:Push notification support in Twilio IOS sdkTwilio IOS sdk 中的推送通知支持
【发布时间】:2016-07-23 09:29:32
【问题描述】:

我正在尝试在使用 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

【问题讨论】:

    标签: objective-c twilio twilio-php


    【解决方案1】:

    其他人最近解决了这个问题,意识到他们没有将New Message notification type 设置为显式启用,如下 PHP 示例所示:

    // 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}",
    ));
    ?>
    

    这会为你解决吗?

    【讨论】:

      猜你喜欢
      • 2018-05-06
      • 1970-01-01
      • 2012-08-09
      • 1970-01-01
      • 2018-10-10
      • 2017-03-17
      • 1970-01-01
      • 1970-01-01
      • 2018-01-20
      相关资源
      最近更新 更多