Reputation: 1068
Setup app to share using Google+ Platform for iOS but after share web page opens in Safari pressing the "Share" or "Cancel" buttons result in an error message and never returns to my app.
To see screen images look at this link: screen images
Pressing the share button does post a message to the google plus account but does not return to the app that launched it. Any help getting the share process to return to my app is greatly appreciated.
My view controller header file:
#import "UIKit/UIKit.h"
#import "GooglePlus/GooglePlus.h"
#import "GoogleOpenSource/GoogleOpenSource.h"
@interface TViewController : UIViewController <GPPShareDelegate>
- (IBAction)buttonClick:(id)sender;
@end
My View Controller .m file with google client id x'ed out:
#import "TViewController.h"
@interface TViewController ()
@end
@implementation TViewController
- (IBAction)buttonClick:(id)sender {
[GPPSignIn sharedInstance].clientID = @"xxxxxxxxxxx.apps.googleusercontent.com";
id<GPPShareBuilder> shareBuilder = [[GPPShare sharedInstance] shareDialog];
[shareBuilder open]; // opens share page in Safari
}
- (void)finishedSharing: (BOOL)shared { // This event never fires
if (shared) {
NSLog(@"User successfully shared!");
} else {
NSLog(@"User didn't share.");
}
}
@end
Upvotes: 0
Views: 870
Reputation: 15377
Something must be wrong with your google plus api setup. Google Plus is trying to reopen your app using a URL scheme that looks something like youdefinethis://somethingtodoinyourapp
If you have setup google plus to use a specific url scheme to reopen your app, you need to define this same scheme in your project settings under Info -> URL Types.
This is a hard problem to solve because of the lack of information you can give us without risking your privacy.
Did you complete all the instructions that are listed here?: https://developers.google.com/+/mobile/ios/getting-started
Upvotes: 1