我想在设备上启动我的应用程序.它在模拟器上成功启动.
我试过了:
我能做些什么才能让它发挥作用?
它可能是代码签名的东西吗?
目前我把它设置为'Dont Code Sign'
到目前为止,我使用了开发推送证书,推送通知效果很好.
现在我想将我的应用程序提交给Apple,因此我创建了一个生产证书并将其设置为"代码签名身份" - >"发布"
我还将.p12文件放在我的生产服务器中.
但推动现在不起作用.
当我从xcode运行时,它是否可以工作?或者从App Store下载应用程序时它会起作用吗?如果是这样我该怎么测试呢?
有点奇怪的问题......
在我的AppDelegate.m中,我有以下内容:
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
// Override point for customization after application launch.
// Enable test flight reporting; https://testflightapp.com/sdk/doc/0.8.3/
[TestFlight takeOff:@"myTestFlightToken"];
// Let the device know we want to receive push notifications
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
return YES;
}
-(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
NSString *tokenAsString = [[deviceToken description]
stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
NSLog(@"Device token: %@", deviceToken);
User.currentUserPushNotificationToken = tokenAsString;
[TestFlight passCheckpoint: [NSString stringWithFormat: @"Registered for remote notifications %@", deviceToken]];
}
-(void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{ …Run Code Online (Sandbox Code Playgroud) xcode push-notification apple-push-notifications ios testflight