Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Commit

Permalink
Logs app activation. Fixes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
jeduan committed Sep 7, 2015
1 parent b872530 commit 42b55a6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ios/FacebookConnectPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ - (void)pluginInitialize {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidFinishLaunching:)
name:UIApplicationDidFinishLaunchingNotification object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidBecomeActive:)
name:UIApplicationDidBecomeActiveNotification object:nil];
}

- (void) applicationDidFinishLaunching:(NSNotification *) notification {
Expand All @@ -39,9 +43,14 @@ - (void) applicationDidFinishLaunching:(NSNotification *) notification {
//launchOptions is nil when not start because of notification or url open
launchOptions = [NSDictionary dictionary];
}

[[FBSDKApplicationDelegate sharedInstance] application:[UIApplication sharedApplication] didFinishLaunchingWithOptions:launchOptions];
}

- (void) applicationDidBecomeActive:(NSNotification *) notification {
[FBSDKAppEvents activateApp];
}

#pragma mark - Cordova commands

- (void)getLoginStatus:(CDVInvokedUrlCommand *)command {
Expand Down Expand Up @@ -436,7 +445,7 @@ - (void) loginWithPermissions:(NSArray *)permissions withHandler:(void(^)(FBSDKL
NSDictionary *userInfo = @{
FBSDKErrorLocalizedDescriptionKey: @"Cannot ask for both read and publish permissions.",
};
NSError *error = [NSError errorWithDomain:nil code:-1 userInfo:userInfo];
NSError *error = [NSError errorWithDomain:@"facebook" code:-1 userInfo:userInfo];
handler(nil, error);

} else if (publishPermissionFound) {
Expand Down

0 comments on commit 42b55a6

Please sign in to comment.