我正在尝试使用苹果提供的推送通知服务,但无法获取推送通知所需的设备令牌。我正在使用以下代码来检索设备令牌
- (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做点什么...
提前谢谢...