微信的自启动 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
txx
V2EX    iDev

微信的自启动

  •  
  •   txx
    rpplusplus 2012-12-09 07:56:43 +08:00 9073 次点击
    这是一个创建于 4689 天前的主题,其中的信息可能已经有所发展或是发生改变。
    今天发现用第三方的软件扫微信二维码后 弹出一个链接
    然后打开链接之后 微信就自动启动了。

    这是怎么做到的?

    于是好奇的去抓了一下包
    request:http://weixin.qq.com/r/Zfvm6bzEeYIGh62Kn65B (我的微信)

    response:
    <!DOCTYPE html><html><head><meta http-equiv="content-type" cOntent="text/html;charset="/></head><body><script>
    window.location = "weixin://qr/Zfvm6bzEeYIGh62Kn65B";

    setTimeout( function(){ window.location="http://weixin.qq.com/cgi-bin/readtemplate?check=false&t=weixin_getdownurl_sms&s=download&from=100&stype=10037102"; } , 1500);
    </script></body></html>


    虽说意思看懂了 但是还是不知道这是怎么实现的?
    难道是iOS6的新功能?
    谁能来解释下么?
    13 条回复    1970-01-01 08:00:00 +08:00
    RelativeLayout
        2
    RelativeLayout  
       2012-12-09 08:10:42 +08:00
    weixin://qr/Zfvm6bzEeYIGh62Kn65B 这个链接很重要~
    txx
        3
    txx  
    OP
       2012-12-09 08:43:58 +08:00
    @RelativeLayout 那岂不是要抢注字符串了? 苹果对这个的审核是不是有要求啊。。
    RelativeLayout
        4
    RelativeLayout  
       2012-12-09 08:56:51 +08:00
    @txx 没必要抢注啊~ 目测没啥要求~
    txx
        5
    txx  
    OP
       2012-12-09 09:17:00 +08:00
    @RelativeLayout 那我也弄了个叫做weixin的怎么办..... 感觉这个略奇葩呢。。
    anyforever
        6
    anyforever  
       2012-12-09 10:06:24 +08:00
    @txx 迅雷下载之类的,不都有过这种形式的链接么?
    txx
        7
    txx  
    OP
       2012-12-09 10:10:42 +08:00
    @anyforever 迅雷有iphone版本么?不说pc 说的是iOS啊
    anyforever
        8
    anyforever  
       2012-12-09 10:13:04 +08:00
    @txx 原理不知道是不是雷同,形式上是一样的
    Mutoo
        9
    Mutoo  
       2012-12-09 11:49:51 +08:00
    @txx 在 Android 上,如果两个APP能关注同一种协议比如:weixin:// 那么会弹出一个列表,让你选一个应用打开它,也可以将这个应用设置成默认应用。
    txx
        10
    txx  
    OP
       2012-12-09 14:42:31 +08:00
    @Mutoo 苹果没这个选项吧
    loveminds
        11
    loveminds  
       2012-12-10 02:58:57 +08:00
    weixin:// 靠的是这个类似tencent://或者msnim:
    chyiz
        12
    chyiz  
       2012-12-10 07:31:07 +08:00
    @txx 没必要抢注吧,这个地址一般又不需要暴露给用户。随便取成什么都无所谓啊。
    txx
        13
    txx  
    OP
       2012-12-10 08:43:14 +08:00   1
    @chyiz 但是开发者们....例如大伙儿都用了calendar:// 怎么办?
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3938 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 31ms UTC 05:14 PVG 13:14 LAX 22:14 JFK 01:14
    Do have faith in what you're doing.
    ubao snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86