我知道有很多这样的问题,但是我已经尝试了很多东西,我似乎仍然无法通过Parse安装通过测试航班安装的应用程序获得推送通知.
如果我连接手机并通过Xcode下载应用程序,它的工作非常完美.但是,如果我将相同的构建上传到Testflight并尝试发送推送,则没有任何反应.
有人说有生产证书和开发证书.或者它可能是沙盒令牌.但我不确定如何解决这些问题.
我已经将生产和开发SSL证书添加到Parse.
PS.我使用开发人员配置文件和我导出AD HOC开发人员.
我的应用代表代码是..
#import "AppDelegate.h" #import <Parse/Parse.h> @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [Parse setApplicationId:@"----I have mine in----" clientKey:@"----I have mine in----"]; //-- Set Notification if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; [[UIApplication sharedApplication] registerForRemoteNotifications]; } else { [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; } //--- your custom code return YES; } - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { // Store the deviceToken in the current installation and save it to Parse. PFInstallation *currentInstallation = [PFInstallation currentInstallation]; [currentInstallation setDeviceTokenFromData:deviceToken]; [currentInstallation saveInBackground]; } - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [PFPush handlePush:userInfo]; }