苹果推送通知服务做在iPhone上使用城市飞艇在生产版本没有作品? [英] Apple Push Notification Service doesn't works in Production Build using Urban Airship in iPhone?

查看:260
本文介绍了苹果推送通知服务做在iPhone上使用城市飞艇在生产版本没有作品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用苹果推送通知我的应用程序,它在即席分配工作正常。我已经提交了我的应用程序到AppStore的,但推送通知不工作我的应用程序和收到的消息,如苹果拒绝您的设备令牌。我已经使用单独的.p12文件的开发和生产,并建立在城市飞艇上传。

I have used Apple Push Notification in my apps and it works fine in Adhoc Distribution. I have submitted my apps into the AppStore, But push notification is not working for my apps and received message like "Apple rejected your device tokens". I have used separate .p12 files for development and production builds and uploaded in the Urban Airship.

请注意:

但我已经用于开发和生产同一个应用程序键和应用主密钥。因此,它并不适用于该推送通知。如果我创建分发一个单独的按键,并有我的分布建立使用这些密钥。这样它会解决这个问题。当创建城市飞艇一个应用程序键,然后我得到三个键像应用程序键,应用密钥和应用主密钥。我用我的应用程序的应用程序键和主键。它是否正确?所以,请指导我。

But i have used the same application key and application master key for development and production. So that it didn't works for the push notification. If i create a separate keys for distribution and have to use those keys for my distribution builds. So that it will solve the problem. When a creating a application keys in urban airship, then i get the three keys like Application Key, Application Secret and Application Master secret. I have used the application key and Master key in my apps. Is this correct? So please guide me.

感谢

问候,结果
Pugal

Regards,
Pugal

推荐答案

您需要有:


  1. 在苹果的iOS配置门户网站

    • 应用的ID

      • 生成发展推SSL证书

      • 生成生产推送SSL证书


  • 创建一个发展应用

    • 使用应用程序开发推送SSL证书在苹果推证书项

    • 复制关闭程序键(发展)

    • 复制关闭应用程序的秘密(开发)


    • 使用应用程序生产推送SSL证书在苹果推证书项

    • 复制关闭程序键(生产)

    • 复制关闭应用程序的秘密(生产)

    我用下面的code设置基于宏在编译时城市飞艇键:

    I use the following code to set the Urban Airship Keys at compile time based on macros:

    - (void)urbanAirshipTakeoffWithLaunchOptions:(NSDictionary *)launchOptions {
    
    // Init Airship launch options
    NSMutableDictionary *takeOffOptions = [[NSMutableDictionary alloc] init];
    [takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey];
    
    // Build the Urban Airship TakeOffOptions
    // Create Airship singleton that's used to talk to Urban Airship servers.
    NSMutableDictionary *airshipConfigOptions = [[NSMutableDictionary alloc] init];
    
    //Set up the Push keys
    NSLog(@"Appdelegate_Pad:didFinishLaunchingWithOptions - TARGET_1");
    [airshipConfigOptions setValue:@"xxx" forKey:@"DEVELOPMENT_APP_KEY"];
    [airshipConfigOptions setValue:@"xxx" forKey:@"DEVELOPMENT_APP_SECRET"];
    [airshipConfigOptions setValue:@"xxx" forKey:@"PRODUCTION_APP_KEY"];
    [airshipConfigOptions setValue:@"xxx" forKey:@"PRODUCTION_APP_SECRET"];
    
    // If CONFIGURATION_Debug is defined, then use the development servers, else use the production servers
    #ifdef CONFIGURATION_Debug
    [airshipConfigOptions setValue:@"NO" forKey:@"APP_STORE_OR_AD_HOC_BUILD"];
    NSLog(@"Using Development Servers at Urban Airship");
    #else
    [airshipConfigOptions setValue:@"YES" forKey:@"APP_STORE_OR_AD_HOC_BUILD"];
    NSLog(@"Using Production Servers at Urban Airship");
    #endif
    
    // Set and start Urban Airship
    [takeOffOptions setValue:airshipConfigOptions forKey:UAirshipTakeOffOptionsAirshipConfigKey];
    [UAirship takeOff:takeOffOptions];
    
    // Register for push notifications
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
                                                                           UIRemoteNotificationTypeSound |
                                                                           UIRemoteNotificationTypeAlert)];
    

    }

    一个关于这个设置的最好的事情是,我可以给我的beta测试者推我的生产用户不能看到(即:在TestFlight新公测!)消息。

    One of the best things about this set up is that I can send my beta testers push messages that my production users can not see (i.e.: New beta on TestFlight!).

    这篇关于苹果推送通知服务做在iPhone上使用城市飞艇在生产版本没有作品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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