0

我正在尝试使用苹果提供的推送通知服务,但无法获取推送通知所需的设备令牌。我正在使用以下代码来检索设备令牌

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken
{
     const void *devTokenBytes = [devToken bytes];
     NSLog(@"devToken=%@",devTokenBytes);
     //[self alertNotice:@"" withMSG:[NSString stringWithFormat:@"devToken=%@",devToken] cancleButtonTitle:NSLocalizedString(@"OK",@"") otherButtonTitle:@""];
    //self.registered = YES;
    //[self sendProviderDeviceToken:devTokenBytes]; // custom method    
}

- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err
{
    NSLog(@"Error in registration. Error: %@", err);
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{   
    for (id key in userInfo)
    {
         NSLog(@"key: %@, value: %@", key, [userInfo objectForKey:key]);
    }    
}

我正在使用以下代码注册远程通知

[[UIApplication sharedApplication] 
 registerForRemoteNotificationTypes:
 (UIRemoteNotificationTypeAlert | 
  UIRemoteNotificationTypeBadge | 
  UIRemoteNotificationTypeSound)];

谁能帮我这个...

我在控制台窗口中收到以下警告消息

warning: Unable to read symbols for "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).

是不是用越狱的iphone做点什么...

提前谢谢...

4

1 回答 1

2

看来你已经自己回答了。据我所知,越狱的 iPhone 在接收推送通知时会遇到问题,但我不确定。您是否能够使用此 iPhone 的 UDID 获得开发/生产证书来安装应用程序?

于 2010-01-27T12:44:42.010 回答