【轉】經過自定義的URL Scheme啓動你的App

http://blog.csdn.net/ba_jie/article/details/6884818
原文地址:http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.htmlhtml

  1. 添加一個叫URL types的鍵值。
  2. 給其下的Item 1添加一個URL identifier,格式爲Reverse Domain Name:com.mycompany.myapp。
  3. 再加一個URL Scheme,而後給它定義一個值,任意字符串。好比:myapp。

定義結束,就可使用下面的模式來發送一個URL:瀏覽器

myapp://
myapp://some/path/here
myapp://?foo=1&bar=2
myapp://some/path/here?foo=1&bar=2app

 

而後直接iphone

   NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"myapp://item.taobao.com/item.htm?id=%@", itemId]];ide

    

    [[UIApplication sharedApplication] openURL:urlurl

獲取在瀏覽器中輸入:.net

myapp://textorm

相關文章
相關標籤/搜索