I making a social application which requires Google+. I know that I can open Google+ as a link to Safari (Which isn't really user Friendly having to switch apps just to post something). This code opens the link to Safari:
-(IBAction)Google+:(id)sender {
NSLog(@"Google+");
//The link will go to Stack Overflow Google+ Page
NSURL *GooglePlus = [NSURL URLWithString:@"https://plus.google.com/+StackExchange/posts"];
[[UIApplication sharedApplication] openURL:GooglePlus];
}
But is there a way to detect if Google+ Application is installed and open the application there (And if it isn't then open the link to Safari). I thank Everyone who take the time to read my post (Even if you didn't) :)
According to this post it is not possible to run an app within another app but it is possible to launch any app that registers a
URL Scheme
. You should check if that's the case for theGoogle+ Application
.EDIT Google+ doesn't seem to be on the list :-(
Now you are able to launch Google+ app using next protocol:
For example
UPD: So, to launch any page in G+ app you just need to change https:// in URL on gplus://, for example this will launch user profile:
In Xcode 6 and Swift, you can write: