xcode – 使用TestFlight通过Parse推送通知

xcode – 使用TestFlight通过Parse推送通知,第1张

概述我知道有很多这样的问题,但是我已经尝试了很多东西,我似乎仍然无法通过Parse安装通过测试航班安装的应用程序获得推送通知. 如果我连接手机并通过Xcode下载应用程序,它的工作非常完美.但是,如果我将相同的构建上传到Testflight并尝试发送推送,则没有任何反应. 有人说有生产证书和开发证书.或者它可能是沙盒令牌.但我不确定如何解决这些问题. 我已经将生产和开发SSL证书添加到Parse. P 我知道有很多这样的问题,但是我已经尝试了很多东西,我似乎仍然无法通过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 *)applicationdIDRegisterForRemoteNotificationsWithDevicetoken:(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 *)applicationdIDReceiveRemoteNotification:(NSDictionary *)userInfo {    [PFPush handlePush:userInfo];}

如果您需要我将提供的其他代码.
如何通过测试飞行获得推送通知

解决方法 我在回答我自己的问题: 您的配置文件必须包含用于生产/分发的推送证书(但仍然必须是开发人员配置文件). 由于测试飞行在生产级别上工作,因此仅使用开发人员推送证书(添加两者)不起作用. 关于此的任何其他问题只是问.我经历了很多麻烦 总结

以上是内存溢出为你收集整理的xcode – 使用TestFlight通过Parse推送通知全部内容,希望文章能够帮你解决xcode – 使用TestFlight通过Parse推送通知所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1022601.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存