【问题标题】:Google Plus share on ios directs to web page with broken links in share and cancel buttonios 上的 Google Plus 共享会定向到共享和取消按钮中的链接断开的网页
【发布时间】:2013-06-04 03:28:14
【问题描述】:

设置应用程序以使用适用于 iOS 的 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

带有 google 客户端 ID 的我的视图控制器 .m 文件已删除:

#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

【问题讨论】:

    标签: ios google-plus


    【解决方案1】:

    您的 google plus api 设置一定有问题。 Google Plus 正在尝试使用类似于 youdefinethis://somethingtodoinyourapp

    的 URL 方案重新打开您的应用

    如果您已设置 google plus 以使用特定的 url 方案重新打开您的应用,则需要在项目设置中的 Info -> URL Types 下定义相同的方案。

    这是一个难以解决的问题,因为您无法在不危及隐私的情况下向我们提供信息。

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

    【讨论】:

    • 感谢您为我指明正确的方向。需要执行“第 4 步。添加 URL 类型。”
    • @smDeveloper 没问题 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-17
    • 2019-08-26
    • 2022-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多