iOS推送通知不适用于使用Test Flight的临时分发

bod*_*ous 9 xcode push-notification apple-push-notifications ios testflight

有点奇怪的问题......

在我的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]];    
}
Run Code Online (Sandbox Code Playgroud)

我的团队正在使用Test Flight在开发人员和利益相关者之间分发临时构建.

当我在自己的iPhone 4上构建应用程序时,应用程序会询问我是否允许推送通知,该应用程序也会出现在"设置">"通知">"通知中心"中

到现在为止还挺好...

当我创建一个开发ipa并在团队中分发它时,不会询问其他用户是否希望允许推送通知,这不会出现在设置>通知中...

任何人都可以想到为什么会这样吗?

更新

对于分发,我正在使用团队配置文件构建应用程序,该配置文件的包ID为"*"而不是应用程序名称 - 这可能是问题吗?这是Apple自动生成的Team Provisioning Profile.

MGA*_*MGA 7

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