ios - ios 上的 Google Plus 共享重定向到网页,共享和取消按钮中的链接已损坏

标签 ios google-plus

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

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

按下共享按钮确实会向 google plus 帐户发布一条消息,但不会返回到启动该消息的应用程序。非常感谢任何帮助让共享过程返回到我的应用程序。

我的 View Controller 头文件:

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

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

我的 View Controller .m 文件与 google 客户端 ID 已删除:

#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

最佳答案

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

的网址方案重新打开您的应用

如果您已将 google plus 设置为使用特定的 URL 方案来重新打开您的应用,则需要在项目设置中的“信息”->“URL 类型”下定义相同的方案。

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

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

关于ios - ios 上的 Google Plus 共享重定向到网页,共享和取消按钮中的链接已损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16904139/

相关文章:

iphone - 动态 UIScrollView 中的动态 UITextView - iOS

ios - 未找到 UIApplicationLaunchOptionsKey

ios - 当用户位于 UITableView 底部时重新加载 UITableView 时出现 Jerk

ios - 无法使用 GooglePlusPlatform 从 GooglePlus 示例代码登录 Google

android - GoogleApiClient 在注销时从未连接

javascript - 谷歌加网络身份验证

google-app-engine - 使用新的 Google+ 登录的 Appengine Cloud Endpoints

ios - iOS 8 应用程序/框架中缺少必需的模块 'CocoaLumberjack'

ios - touchesBegan 不调用容器 View Controller

android - Google Play 服务已过时。需要 4242000 但找到 4132534