iosipadnotificationsatom-feednewsstand-kit

Newsstand atom feed use and limitations


After some guides and references I've read, I still have some questions about how newsstand works.

  1. First of all (I just want to be sure), is the atom feed only for the app store use or is it also used for the app? Does the app has to read this when in foreground to fill out the nkissue objects? or do I have to make my own customized feed for this (an xml, a plist, or whatever). I don't see any key inside entry that stores the URL for the issue. Should I do the same or something similar as this tutorial http://www.viggiosoft.com/blog/blog/2011/10/17/ios-newsstand-tutorial/ ?

  2. How does the notification "UIRemoteNotificationTypeNewsstandContentAvailability" works if you only have to send "content-available=1" on the payload? does it download the newest issue in the atom feed? and how should I proceed with the download in background (a code snippet would be nice).

  3. Is atom feed optional? If I have my own customized feed for the issue downloads, is the atom feed optional since its probably only used for the app store?

EDIT: Seems like atom is optional and is only for itunes, I should use another service for the app I suppose. What I still dont understand is where should I implement the background loading... in the

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions inside an "if" that looks like this if ([launchOptions objectForKey:UIApplicationLaunchOptionsNewsstandDownloadsKey] || [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {}

or

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

or both options? Am I right?


Solution

    1. Yes, the Atom Feed is only to update the App Store with the new issue information. The way to get your issues info is up to you.

    2. You can send other data with content-available:1, for example a unique id of the issue that was just released. For example:

      {"aps":{"content-available": 1, "sound":"silent.wav"}, "issue_id":"latest_issue_id"}

      (I've added the sound component because of a bug in iOS 7 silent push notifications, read here.)

    3. Yes, it's optional.

    The background loading should be called on both - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions and -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo. One will be called when the app is awaken (after not active state), and the other while it is in active or background state. (again be careful when testing with iOS7, it doesn't work exactly like that for now, waiting for iOS7.1...)