我想从iOS 7应用程序打开我的g +页面。类似于我们在Facebook和Twitter下面做的事情
- (IBAction)likeMeOnFacebook:(id)sender {
NSURL *urlApp = [NSURL URLWithString:@"fb://profile/{Enter ID Here}"];
[[UIApplication sharedApplication] openURL:urlApp];
}
- (IBAction)followMeOnTwitter:(id)sender {
NSURL *urlApp = [NSURL URLWithString:@"twitter://user?screen_name={Enter ID Here}"];
[[UIApplication sharedApplication] openURL:urlApp];
}
- (IBAction)followMeOnTwitter:(id)sender {
// Need code to open Google Plus page
// Help me out to find out the URL
NSURL *urlApp = [NSURL URLWithString:@""];
[[UIApplication sharedApplication] openURL:urlApp];
}
答案 0 :(得分:1)
// Google +
NSURL *googlePlusURL = [[NSURL alloc] initWithString:@"gplus://plus.google.com/+Mypizza"];
// check if app is installed
if ( ! [[UIApplication sharedApplication] canOpenURL:googlePlusURL] ) {
// if we get here, we can't open the Google app.
googlePlusURL = [[NSURL alloc] initWithString:@"https://plus.google.com/+Mypizza"];
}
[[UIApplication sharedApplication] openURL:googlePlusURL];