URI scheme of Google+ iOS app?

2019-01-22 23:06发布

I'm working on something cool and I want to link to my Google+ profile in the iOS app.

Has anyone found out how to use the mgc:// URI scheme that the Google+ app on iOS provides to open a specific profile the way you can do it with fb://, twitter:// and almost every other account-based iOS app?

2条回答
狗以群分
2楼-- · 2019-01-22 23:19

In fact it's really simple. Check your URL in a web browser and replace http:// or https:// with gplus://

Example :

If the URL in your browser is https://plus.google.com/u/0/100711776131865357077 then you open the profile in the app with the following code.

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

if ([[UIApplication sharedApplication] canOpenURL:gPlusUrl]) {
    [[UIApplication sharedApplication] openURL:gPlusUrl];
}
查看更多
男人必须洒脱
3楼-- · 2019-01-22 23:25

I know this is an old post, but I found the solution here (just search "google"). The URL scheme is gplus://. I have tested this myself and verified that it worked. Usage example:

NSURL *gPlusUrl = [NSURL URLWithString:@"gplus://"];

if ([[UIApplication sharedApplication] canOpenURL:gPlusUrl]) {
    [[UIApplication sharedApplication] openURL:gPlusUrl];
}
查看更多
登录 后发表回答