Skip to content

Instantly share code, notes, and snippets.

@jtowle
Created August 26, 2011 18:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtowle/1174024 to your computer and use it in GitHub Desktop.
Save jtowle/1174024 to your computer and use it in GitHub Desktop.
Newsstand App Delegate's applicationDidFinishLaunchingWithOptions
/***********************************************
* 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