Question

m searching for the solution to automatic background downloading with iOS 5.

I have seen in Settings of iPad, there are newsstand apps in the category of

Store - Automatic Downloads

apps like Popular Mechanics, etc.

I want to know,how to add my app in this category? Mine is also a newsstand app but even after making all the changes in plist for newsstand, m not getting my app in the automatic downloads.

Was it helpful?

Solution

First, what you must do is tell the application that you have a required background mode. This allows your application to download issues in the background. So go into your application's Info.plist and add the following (Assumes you right-click and open the plist as 'Source Code'):

<key>UIBackgroundModes</key>
<array>
    <string>newsstand-content</string>
</array>

Now, the next part requires you to have push notifications enabled for your application and a server which will execute your pushes. If you don't have one, then I suggest you look at Urban Airship. It seems to be quite simple and easy to incorporate into your applications. I have never used it, but I have heard it has good free options.

After you have a way to deliver push notifications, then you must register your application to accept remote notifications. Place the following code in your AppDelegate's application:didFinishLaunchingWithOptions method.

// Register the automatic download remote notification
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeNewsstandContentAvailability];

This should cause your application to prompt the user when the app first launches and asks if they want to enable automatic downloading.

After all this, you must then code how you will handle a push notification. How you will handle them, is entirely up to you, but this is where you would tell the user they have a new issue or start the download automatically. This must be handled in two places. 1) in your AppDelegate's UIApplicationDelegate application:didReceiveRemoteNotification: method. 2) the AppDelegate's application:didFinishLaunchingWithOptions: method, checking for the launch option of UIApplicationLaunchOptionsRemoteNotificationKey.

That is pretty much a quick summary of how you can get started. If you need some more direction, I highly recommend these tutorials (I didn't write them): iOS Newsstand Tutorial and Newsstand and Subscriptions.

Good luck!

OTHER TIPS

You need to register for the push type to get the entry in Store / Automatic Downloads.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top