iOS的推送通知不工作特设的分布与飞行测试 [英] iOS Push notifications not working on for ad hoc distributions with Test Flight

查看:155
本文介绍了iOS的推送通知不工作特设的分布与飞行测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Having a bit of a weird issue...

在我AppDelegate.m我有以下几点:

In my AppDelegate.m I have the following:

-(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]];    
}

我的团队正在使用试飞来分发特设开发商和利益相关者之间的基础之上。

My team are using Test Flight to distribute ad hoc builds between the developers and stakeholders.

当我建立我自己的iPhone 4应用程序在App问我,如果我想允许推送通知和应用也出现在设置>通知>在通知中心

When I build the app on my own iPhone 4 the App asks me if I wish to allow push notifications and the app also appears in Settings > Notifications > In Notification Center

到目前为止,一切都很好...

So far, so good...

当我创建了一个发展的ipa和发布这一跻身球队,其他用户没有,如果他们希望允许推送通知要求,这不会出现在设置>通知...

When I create a development ipa and distribute this amongst the team, the other users are not asked if they wish to allow Push Notifications and this doesn't appear in Settings > Notifications...

任何人都可以想到,为什么这可能是?

Can anybody think of why this may be?

有关分配,我建设使用工作组发放模板里面有一个*为包ID而不是应用程序名称的应用程序 - 会这样的问题?这是球队发放模板,苹果自动生成。

For distribution, I'm building the app using the Team Provisioning Profile which has an "*" for the bundle ID instead of the app name - could this be the issue? This is the Team Provisioning Profile that Apple generates automatically.

推荐答案

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

Yes that is the issue. You cannot have a wildcard character in an app identifier for push notification (otherwise it would push to all apps!).

这篇关于iOS的推送通知不工作特设的分布与飞行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆