Created
August 26, 2011 18:13
-
-
Save jtowle/1174024 to your computer and use it in GitHub Desktop.
Newsstand App Delegate's applicationDidFinishLaunchingWithOptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************** | |
* In application:DidFinishLaunchingWithOptions: | |
************************************************/ | |
// Set up newsstand helper | |
// newsstand is an ivar - you will need to declare it in your header and | |
// release it in dealloc | |
newsstand = [[UANewsstandHelper alloc] init]; | |
// Add newsstand helper as observer | |
[[UASubscriptionManager shared] addObserver:newsstand]; | |
// Resume existing downloads | |
for (NKAssetDownload *asset in [[NKLibrary sharedLibrary] downloadingAssets]) { | |
[asset downloadWithDelegate:newsstand]; | |
} | |
// For debugging - allow multiple pushes per day | |
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NKDontThrottleNewsstandContentNotifications"]; | |
// Handle incoming pushes | |
NSDictionary *userInfo = [launchOptions valueForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"]; | |
[newsstand handleNewsstandPushInfo:userInfo]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment