Google Plus在ios上的分享重定向到网页,其中包含分享和取消按钮中的链接损坏

时间:2013-06-03 19:14:16

标签: ios google-plus

设置应用以使用Google+平台进行分享,但在Safari中打开共享网页后,按“共享”或“取消”按钮会导致出现错误消息,并且永远不会返回到我的应用。

要查看屏幕图像,请查看以下链接:screen images

按分享按钮确实会向google plus帐户发送消息,但不会返回启动它的应用。任何有助于让共享流程返回我的应用程序的帮助都非常感谢。

我的视图控制器头文件:

#import "UIKit/UIKit.h"
#import "GooglePlus/GooglePlus.h"
#import "GoogleOpenSource/GoogleOpenSource.h"

@interface TViewController : UIViewController <GPPShareDelegate>
- (IBAction)buttonClick:(id)sender;
@end

我的View Controller .m文件,包含谷歌客户端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

1 个答案:

答案 0 :(得分:1)

google plus api设置肯定有问题。 Google Plus正在尝试使用类似于您的网址方案重新打开您的应用:// somethingtodoinyourapp

如果您已设置google plus以使用特定网址方案重新打开您的应用,则需要在Info - &gt;下的项目设置中定义相同的方案。网址类型。

这是一个难以解决的问题,因为您可以在不冒隐私风险的情况下提供信息。

您是否完成了此处列出的所有说明?:https://developers.google.com/+/mobile/ios/getting-started