Skip to content

Commit

Permalink
Fix newsstand with application close
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Gavagnin committed Nov 9, 2011
1 parent 5a2f493 commit 26a10fe
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions Classes/KioskApp/FastPDFKit_KioskAppDelegate.m
Expand Up @@ -17,11 +17,8 @@ @implementation FastPDFKit_KioskAppDelegate
@synthesize menuVC_Kiosk;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {


//Uncomment the line below to enable NewsStand remote Notification



//Comment the line below to disable NewsStand remote Notification
NSString *filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist",@"FastPdfKit_Kiosk-Info"]];

NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
Expand All @@ -37,6 +34,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
} else {
[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert];
}

if([launchOptions objectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"]){
[self application:application didReceiveRemoteNotification:[launchOptions objectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"]];
}

NSLog(@"FastPdfKit Version: %@",[MFDocumentManager version]);

Expand Down Expand Up @@ -77,15 +78,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(


- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
UIRemoteNotificationType type = [application enabledRemoteNotificationTypes];
if (type > 0) {
NSString *deviceTokenStr = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""];

NSLog(@"Device Token: %@", deviceTokenStr);

}
UIRemoteNotificationType type = [application enabledRemoteNotificationTypes];
if (type > 0) {
NSString *deviceTokenStr = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""];

NSLog(@"Device Token: %@", deviceTokenStr);
}
}



- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{
Expand Down

0 comments on commit 26a10fe

Please sign in to comment.