Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 关于relayRemotePushNotificationPayload的澄清如下:_Ios_Sinch - Fatal编程技术网

Ios 关于relayRemotePushNotificationPayload的澄清如下:

Ios 关于relayRemotePushNotificationPayload的澄清如下:,ios,sinch,Ios,Sinch,在文档中指出,[client relayLocalNotification:][/code>应使用check[client isStarted]进行保护,但在[client relayRemotePushNotificationPayload:][/code>中未提及(我通过自己的套接字传递远程推送通知负载,而不是Apple推送通知) 我的问题是: [client relayRemotePushNotificationPayload:会自动调用start,还是我最好检查并缓冲clientDid

在文档中指出,
[client relayLocalNotification:][/code>应使用check
[client isStarted]
进行保护,但在
[client relayRemotePushNotificationPayload:][/code>中未提及(我通过自己的套接字传递远程推送通知负载,而不是Apple推送通知)

我的问题是:

  • [client relayRemotePushNotificationPayload:
    会自动调用
    start
    ,还是我最好检查并缓冲
    clientDidStart
    委托消息中要使用的有效负载
  • 在日志中,远程推送通知负载似乎在远程用户不在线时被多次请求和生成。这是设计的吗
  • 多次调用
    [\u client start]
    安全吗
  • 当我的应用程序转到后台时,我是否应该调用
    [\u client stop]
    ?(我使用自己的套接字传递远程推送通知负载)
1)
[客户端relayRemotePushNotificationPayload:
在传递需要启动客户端的负载(例如调用)时,将在内部调用
启动

2) 如果同一用户有多个实例(例如,您登录了多个设备),这是预期的,因为它们应该有不同的推送数据

3) 是的,多次调用
start
是安全的


4) 通常,当应用程序即将终止时,您应该只调用
stop
,如果您不希望连接在后台运行(并且因为您已经实现了自己的唤醒机制),您可以调用
stopListeningOnActiveConnection

[客户端关系RemotePushNotificationPayload:]
invoke
start
,将调用
clientDidStart:
delegate方法,对吗?谢谢@wangii是将调用委托方法