Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
#3 redirect url not handled when redirected from Google+ app on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Oct 12, 2014
1 parent 66b6c35 commit 931c315
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="nl.x-services.plugins.googleplus"
version="1.0.1">
version="1.0.2">

<name>Google+</name>

Expand Down
1 change: 1 addition & 0 deletions src/ios/GooglePlus.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@interface GooglePlus : CDVPlugin<GPPSignInDelegate>

@property (nonatomic, copy) NSString* callbackId;
@property (nonatomic, assign) BOOL isSigningIn;

- (void) login:(CDVInvokedUrlCommand*)command;
- (void) trySilentLogin:(CDVInvokedUrlCommand*)command;
Expand Down
7 changes: 5 additions & 2 deletions src/ios/GooglePlus.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ - (BOOL)identity_application: (UIApplication *)application
sourceApplication: (NSString *)sourceApplication
annotation: (id)annotation {

if (url && [url.path rangeOfString:@"oauth2callback"].location != NSNotFound) {
GooglePlus* gp = (GooglePlus*)[[self.viewController pluginObjects] objectForKey:@"GooglePlus"];

if ([gp isSigningIn]) {
gp.isSigningIn = NO;
return [GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation];
} else {
// call super
return [self identity_application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
}

@end

@implementation GooglePlus

- (void) login:(CDVInvokedUrlCommand*)command {
self.isSigningIn = YES;
[[self getGooglePlusSignInObject:command] authenticate];
}

Expand Down

0 comments on commit 931c315

Please sign in to comment.