当前位置:编程学习 > wap >>

iOS6之Smart App Banners推送APP新功能

iOS6新标签apple-itunes-app提供了一个叫 Smart App Banners的功能, 当你在iOS移动平台访问一个网站时,会提示你去App Store下载这个网站的官方App。

Smart App Banners自动识别用户设备是否支持该应用APP,如果设备不兼容,则下载广告条不会显示。
语法格式为:

 meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL"> 

<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">


其中ID为必选。 App ID (required), Affiliate Data (Optional), Argument (Optional) 。

app-id是APP的唯一标识,查询app ID的方法: 访问iTunes Link Maker 在搜索框输入应用名称,选择国家和类型, 在搜索结果列表页面右侧,点击 iPhone App Link,跳转的URL中id 和 ?mt之间的9为数字就是这个APP的唯一ID。

其他可选属性的介绍:


affiliate-data: (Optional.) Your iTunes affiliate string, if you are an iTunes affiliate. If you are not, find out more about becoming an iTunes affiliate at  app-argument: (Optional.) A URL that provides context to your native app. If you include this, and the user has your app installed, she can jump from your website to the corresponding position in your iOS app. Typically, it is beneficial to retain navigational context because:

If the user is deep within the navigational hierarchy of your website, you can pass the document’s entire URL, and then parse it in your app to reroute her to the correct location in your app.

If the user performs a search on your website, you can pass the query string so that she can seamlessly continue the search in your app without having to retype her query.

If the user is in the midst of creating content, you can pass the session ID to download the web session state in your app so she can nondestructively resume her work.

You can generate the app-argument of each page dynamically with a server-side script. You can format it however you'd like, as long as it is a valid URL.

格式参考推特的写法:


 

 meta name="apple-itunes-app" content="app-id=333903271, app-argument=twitter://timeline, affiliate-data=partnerId=30&siteID=UkOLawSuc90&u1=tw-

44c06a9f3dde70bac326583e550d2f3dafd9cf56a0f96e6e639cf2155"> 

<meta name="apple-itunes-app" content="app-id=333903271, app-argument=twitter://timeline, affiliate-data=partnerId=30&siteID=UkOLawSuc90&u1=tw-44c06a9f3dde70bac326583e550d2f3dafd9cf56a0f96e6e639cf2155">


需要注意的是Smart App Banners标签不能用在frame框架内部,否则不起作用。

 

补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,