Created
March 26, 2012 19:56
-
-
Save zholmquist/2209206 to your computer and use it in GitHub Desktop.
canOpenURL - check if phone has apps installed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
canOpenURL | |
Clear App ( http://www.realmacsoftware.com/clear/ ) checks if app exsits, | |
then unlocks a theme based on that app. In Clear, they check if you have | |
Tweetbot. | |
Example Usage: | |
BOOL hasTweetbotInstalled = [self checkIfPhoneCanOpenAppUrlScheme:@"tweetbot://"]; | |
BOOL hasFacebookInstalled = [self checkIfPhoneCanOpenAppUrlScheme:@"fb://"]; | |
BOOL hasInstacastInstalled = [self checkIfPhoneCanOpenAppUrlScheme:@"pcast://"]; | |
Custom URL Schemes of apps: | |
http://handleopenurl.com/ | |
*/ | |
-(BOOL) checkIfPhoneCanOpenAppUrlScheme:(NSString *) aCustomURLScheme | |
{ | |
NSURL *url = [NSURL URLWithString: aCustomURLScheme]; | |
return [[UIApplication sharedApplication] canOpenURL: url]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment