【问题标题】:URI scheme of Google+ iOS app?Google+ iOS 应用的 URI 方案?
【发布时间】:2013-03-15 14:14:55
【问题描述】:

我正在做一些很酷的事情,我想在 iOS 应用中链接到我的 Google+ 个人资料。

有没有人知道如何使用 iOS 上的 Google+ 应用程序提供的 mgc:// URI 方案来打开特定的个人资料,就像使用 fb://twitter:// 和几乎所有其他基于帐户的 iOS 一样应用程序?

【问题讨论】:

标签: ios uri google-plus


【解决方案1】:

其实很简单。在网络浏览器中检查您的 URL,并将 http://https:// 替换为 gplus://

示例:

如果您浏览器中的 URL 是 https://plus.google.com/u/0/100711776131865357077,那么您使用以下代码在应用中打开个人资料。

NSURL *gPlusUrl = [NSURL URLWithString:@"gplus://plus.google.com/u/0/100711776131865357077"];

if ([[UIApplication sharedApplication] canOpenURL:gPlusUrl]) {
    [[UIApplication sharedApplication] openURL:gPlusUrl];
}

【讨论】:

    【解决方案2】:

    我知道这是一篇旧帖子,但我找到了解决方案 here(只需搜索“google”)。 URL 方案是gplus://。我自己对此进行了测试并验证了它是否有效。使用示例:

    NSURL *gPlusUrl = [NSURL URLWithString:@"gplus://"];
    
    if ([[UIApplication sharedApplication] canOpenURL:gPlusUrl]) {
        [[UIApplication sharedApplication] openURL:gPlusUrl];
    }
    

    【讨论】:

    • 是的,但我需要的是一种直接链接到我的个人资料的方法。我该怎么做?
    猜你喜欢
    • 2021-04-30
    • 2016-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-23
    • 1970-01-01
    相关资源
    最近更新 更多