English 中文(简体)
缩略语 《多时报》登记
原标题:iPhone PushNotification Registering Multiple Times

我正在用普什诺特语作我的发言。 斜体是,每当申请装上时,就会产生该装置。 因此,在我的服务器中,我有许多重复装置标记。

我是否需要在把装置添加到数据库之前检查该装置,还是想一去做一些与安装有关的错误?

在我使用的法典部分之后。

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

 // launchOptions has the incoming notification if we re being launched after the user tapped "view"
 NSLog( @"didFinishLaunchingWithOptions:%@", launchOptions );

 // [self.viewController handleDidReceiveRemoteNotification:userInfo];


 // other setup tasks here.... 
    [[UIApplication sharedApplication] 
  registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | 
           UIRemoteNotificationTypeSound |
           UIRemoteNotificationTypeAlert)]; 

    // [self updateWithRemoteData];  // freshen your app!

 // RESET THE BADGE COUNT
    application.applicationIconBadgeNumber = 0; 

    // ... 
 // call the original applicationDidFinishLaunching method to handle the basic view setup tasks
 [self applicationDidFinishLaunching:application];

 return YES;
}



- (void)application:(UIApplication *)app 
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken { 
    [self sendDeviceTokenToRemote:devToken]; // send the token to your server 
}

谁能帮助? 我如何在服务器上储存独特的装置标识?

thanks, Nikil

问题回答
  1. In most cases, this APNs token assigned to each device is unique and constant. You can view it as another kind of UDID. So once a device is registered in your server s database, you don t have to register it again.
  2. (This is the tricky part) However, according to Apple s documentation, APNs token could change, let s say, if the device has been updated to a higher version of OS or has some of its hardware be replaced with a new one. However, this doesn t happen that often.
  3. As for converting and storing this APNs token in your app and in your server, check this post, iPhone pushNotification DeviceToken - How to "decrypt"

希望会有所助益。





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签