为报亭应用实施后台自动下载

时间:2014-09-19 12:16:51

标签: ios background download urbanairship.com newsstand-kit

我想要后台自动下载,但我执行了以下步骤,但我的应用未显示在Settings > Itunes & App Store > Automatic Downloads下。

以下是我的步骤。

  1. 设置所需的背景模式:报亭模式(更改为“App 流程报亭套件下载“)
  2. 应用程序在报亭中显示内容:是
  3. 在我的didFinishLaunchOptions
  4. 我已启用NKDontThrottleNewsstandContentNotification进行测试。

    Urban Airship电话:

    curl -v -X POST -u “<app key>:<master secret>" -H "Content-type: application/json" -H "Accept: application/vnd.urbanairship+json; version=3;" --data '{"audience":"all", "device_types" : ["ios"], "notification": {"ios": {"content-available":true, "sound": "default", "badge": 1, "priority":5}}}' https://go.urbanairship.com/api/push/
    

    Background Modes

    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NKDontThrottleNewsstandContentNotifications"];
      [[NSUserDefaults standardUserDefaults] synchronize];
    
       [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeNewsstandContentAvailability];
    
    if ([launchOptions objectForKey:UIApplicationLaunchOptionsNewsstandDownloadsKey]) {
    
    [self handleNewsStandUpdatePush];
    }
    
    NSDictionary *_remoteNotifUserInfo = [launchOptions  objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
    if (_remoteNotifUserInfo != nil) {
      [self responseToRemoteNotificationWithUserInfo:_remoteNotifUserInfo];
     }
    
     for (NKAssetDownload *asset in [[NKLibrary sharedLibrary] downloadingAssets]) {
      [asset downloadWithDelegate:self];
     }
    
    //Latest Urban Airship
     UAConfig *config = [UAConfig defaultConfig];
     [UAirship takeOff:config];
     [UAPush shared].userNotificationTypes = (UIUserNotificationTypeAlert |
                                             UIUserNotificationTypeBadge |
                                             UIUserNotificationTypeSound |
                                             UIRemoteNotificationTypeNewsstandContentAvailability);
     [UAPush shared].userPushNotificationsEnabled = YES;
    

    我在这里错过了什么吗?

0 个答案:

没有答案