1

我注册了 apns 服务。我正在获取设备令牌,我想将其发送到我的服务器。如果此设备 ID 已经存在于我的服务器中,我不想再次发送它。

      - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
    {
         NSLog(@"My token is: %@", deviceToken);//so from here i want to send my   token to server using service.if got same device token when user runs app in the same phone i will

          get device id,i want to send it only at first time if it is same phone 
     }

如何进行 谢谢

4

1 回答 1

1

您可以将其本地存储在手机上。如果您获得的设备令牌didRegisterForRemoteNotificationsWithDeviceToken等于本地存储的设备令牌,则您不会将其发送到您的服务器。如果您没有本地存储的设备令牌,或者本地存储的令牌与新收到的不同,请将其发送到您的服务器并更新本地存储的令牌。

于 2013-07-12T14:00:03.760 回答