Implement background auto download for newsstand app

722 views Asked by At

I want to have background auto download and I did the following steps but my app does not appear under Settings > Itunes & App Store > Automatic Downloads.

Here are my steps.

  1. Set Required background mode : newsstand-mode (it changed to "App processes Newsstand kit downloads")
  2. Application presents content in Newsstand : YES
  3. At my didFinishLaunchOptions

I have enable the NKDontThrottleNewsstandContentNotification for testing.

Urban Airship call:

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;

Am I missing something here?

0

There are 0 answers