【URL Schemes】The Complete Tutorial on iOS/iPhone Custom URL Schemes
来源:互联网 发布:淘宝涛哥电玩店 编辑:程序博客网 时间:2024/04/28 15:57
地址:http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
Steps:
- Registering a Custom URL Scheme in info.plist for your app (Recommend via XCode)
- Request from another app:
- (void)buttonPressed:(UIButton *)button{ NSString *customURL = @"iOSDevTips://"; if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:customURL]]) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"URL error" message:[NSString stringWithFormat: @"No custom URL defined for %@", customURL] delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; } }
- Handler of your app:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ // Check the calling application Bundle ID if ([sourceApplication isEqualToString:@"com.3Sixty.CallCustomURL"]) { NSLog(@"Calling Application Bundle ID: %@", sourceApplication); NSLog(@"URL scheme:%@", [url scheme]); NSLog(@"URL query: %@", [url query]); return YES; } else return NO;}
0 0
- The Complete Tutorial on iOS/iPhone Custom URL Schemes
- The Complete Tutorial on iOS/iPhone Custom URL Schemes
- 【URL Schemes】The Complete Tutorial on iOS/iPhone Custom URL Schemes
- Custom Url Schemes
- Implementing Custom URL Schemes
- IPhone URL Schemes
- IPhone URL Schemes
- IPhone URL Schemes
- IPhone URL Schemes 全集
- [iOS URL Schemes相关] URL Schemes 转载
- Objective-C: Custom URL Schemes
- iOS URL schemes 查看
- iOS URL schemes
- ios 更多 Url Schemes
- iPhone Development 101: Objective-C: Objective-C: Custom URL Schemes
- URL Schemes
- URL Schemes
- iOS上自定义URL Schemes
- iPad与iPhone屏幕布局
- 黑马程序员——java基础: 集合
- hdu 5036 Explosion (bitset优化的传递闭包求解概率)
- Android WebView 缓存处理
- 使用包装胶袋把杂物整理有序
- 【URL Schemes】The Complete Tutorial on iOS/iPhone Custom URL Schemes
- java 23种设计模式的UML类结构
- 【LeetCode】-Binary Tree Preorder Traversal
- PYTHON CHALLENG 1
- HDU 5040 BFS+状压
- Mini-project # 1 - Rock-paper-scissors-lizard-Spock
- flume-ng性能优化与架构设计
- ubuntu从内核源代码编译内核及替换内核
- kafka虚拟机单机开发环境搭建