iOS推送通知不适用于临时分发与testing飞行

有一个奇怪的问题…

在我的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 { NSLog(@"Failed to get token, error: %@", error); [TestFlight passCheckpoint: [NSString stringWithFormat: @"Failed to register for remote notifications %@", error]]; } 

我的团队正在使用“ testing飞行”来分发开发者和利益相关者之间的临时构build。

当我在自己的iPhone 4上构build应用程序时,应用程序询问我是否允许推送通知,并且该应用程序还会显示在“设置”>“通知”>“通知中心”

到现在为止还挺好…

当我创build一个开发ipa并在团队之间分配时,其他用户不会被问到是否允许推送通知,并且这不会显示在设置>通知中。

谁能想到为什么会这样呢?

更新

对于分发,我正在使用Team Provisioning Profile创build应用程序,该应用程序使用捆绑ID而不是应用程序名称“*”,这可能是问题吗? 这是Apple自动生成的团队configuration文件。

是的,这是问题。 推送通知的应用程序标识符中不能有通配符(否则会推送到所有应用程序!)。