我的生产/开发证书和provisionProfiles的每件事情都可以。以下代码成功被称为application:didRegisterForRemoteNotificationsWithDeviceToken:
,其中安装了iOS6系统设备
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
// my implementations
return YES;
}
但是当我使用iOS7安装的设备进行调试时,didRegisterForRemoteNotificationsWithDeviceToken
和didFailToRegisterForRemoteNotificationsWithError
都没有被调用。我使用Ad-hoc
发行版为测试人员分发了应用程序,并为iOS7设备分配了同样的问题。
可能与我的问题有什么关系?
P.S。我的XCode
版本:5.1(5B130a)
答案 0 :(得分:0)
它为我工作 希望能帮到你
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
return YES;
}
-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
NSLog(@"%@",deviceToken);
}
答案 1 :(得分:0)
检查您的Ad-Hoc配置文件并确保已启用推送通知