iOS应用内置AppStore以及iOS Safar…
来源:互联网 发布:算法工程师学什么专业 编辑:程序博客网 时间:2024/06/04 01:11
SKStoreProductViewController Class Reference
UIAppearanceContainer(UIViewController)
NSObject(NSObject)
Overview
A SKStoreProductViewContro
To display astore, create a new SKStoreProductViewContro
To choose aspecific product, call the loadProductWithParameter
Tasks
Setting a Delegate
delegate property
Loading a New Product Screen
–
loadProductWithParameter s:completionBlock: Properties
delegate
The store viewcontroller’s delegate.
@property(nonatomic, assign) id<SKStoreProductViewControllerDelegate>delegate Discussion
Your application must set the delegate before presenting the storeview controller.
Availability
- Available in iOS 6.0 andlater.
Declared In
SKStoreProductViewContro
ller.h Instance Methods
loadProductWithParameter
s:completionBlock: Loads a new product screen to display.
- (void)loadProductWithParameters:(NSDictionary *)parameters completionBlock:(void(^)(BOOL result, NSError *error))block Parameters
- parameters
A dictionary describing the content you want the view controller todisplay. See
“ProductDictionary Keys.” - block
A block to be called when the product information has been loadedfrom the App Store. The completion block is called on the mainthread and receives the following parameters:
- result
YES
if the product information wassuccessfully loaded, otherwise NO
.- error
If an error occurred, this object describes the error. If theproduct information was successfully loaded, this valueis
nil
.
Discussion
In most cases, you should load the product information and thenpresent the view controller. However, if you load new productinformation while the view controller is presented, the contents ofthe view controller are replaced after the new product data isloaded.
Availability
- Available in iOS 6.0 andlater.
Declared In
SKStoreProductViewContro
ller.h Constants
Product Dictionary Keys
Keys supported inthe product dictionary.
NSString * const SKStoreProductParameterI
TunesItemIdentifier; Constants
SKStoreProductParameterI
TunesItemIdentifier The valueassociated with this key should be a string representing the iTunesidentifier for the item you want the store to display when the viewcontroller is presented.
Available iniOS 6.0 and later.
Declaredin
SKStoreProductViewContro
.ller.h
Next
Promoting Apps with Smart App Banners
Safari has a new Smart App Banner feature in iOS 6 and later thatprovides a standardized method of promoting apps on the App Storefrom a website, as shown in
Note:
Smart App Banners vastly improve users’ browsing experiencecompared to other promotional methods. As banners are implementedin iOS 6, they will provide a consistent look and feel across theweb that users will come to recognize. Users will trust thattapping the banner will take them to the App Store and not athird-party advertisement. They will appreciate that banners arepresented unobtrusively at the top of a webpage, instead of as afull-screen ad interrupting the web content. And with a large andprominent close button, a banner is easy for users to dismiss.
If the app is already installed on a user's device, the bannerintelligently changes its action, and tapping the banner willsimply open the app. If the user doesn’t have your app on hisdevice, tapping on the banner will take him to the app’s entry inthe App Store. When he returns to your website, a progress barappears in the banner, indicating how much longer the download willtake to complete. When the app finishes downloading, the Viewbutton changes to an Open button, and tapping the banner will openthe app while preserving the user’s context from your website.
Smart App Banners automatically determine whether the app issupported on the user’s device. If the device loading the bannerdoes not support your app, or if your app is not available in theuser's location, the banner will not display.
Implementing a Smart App Banner on Your Website
To add a SmartApp Banner to your website, include thefollowing meta
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">
You can includethree comma-separated parameters inthe content
app-id: (Required.) Your app's unique identifier. To findyour app ID from the
iTunes Link Maker, typethe name of your app in the Search field, and select theappropriate country and media type. In the results, find your appand select iPhone App Link in the column on the right. Your app IDis the nine-digit number in between id
and ?mt
.affiliate-data: (Optional.) Your iTunes affiliate string,if you are an iTunes affiliate. If you are not, find out more aboutbecoming an iTunes affiliate at
http://www.apple.com/itunes/affiliates/. app-argument: (Optional.) A URL that provides context toyour native app. If you include this, and the user has your appinstalled, she can jump from your website to the correspondingposition in your iOS app. Typically, it is beneficial to retainnavigational context because:
Ifthe user is deep within the navigational hierarchy of your website,you can pass the document’s entire URL, and then parse it in yourapp to reroute her to the correct location in your app.
Ifthe user performs a search on your website, you can pass the querystring so that she can seamlessly continue the search in your appwithout having to retype her query.
Ifthe user is in the midst of creating content, you can pass thesession ID to download the web session state in your app so she cannondestructively resume her work.
Youcan generatethe
app-argument of eachpage dynamically with a server-side script. You can format ithowever you'd like, as long as it is a valid URL.
Note:
Providing Navigational Context to Your App
In your app,implement the application:openURL:sourceApplication:annotation:
NSURL
The examplein /profile
.If it does, then open the profile view controller and pass theprofile ID number that is in the query string.
Listing7-1
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
// in this example, the URL from which the user came is http://example.com/profile/?12345
// determine if the user was viewing a profile
if ([[url path] isEqualToString:@"/profile"]) {
// switch to profile view controller
[self.tabBarController setSelectedViewController:profileViewController];
// pull the profile id number found in the query string
NSString *profileID = [url query];
// pass profileID to profile view controller
[profileViewController loadProfile:profileID];
}
return YES;
}
- iOS应用内置AppStore以及iOS Safar…
- iOS 应用跳转到AppStore评分 可内置跳转
- iOS 应用跳转到AppStore评分 可内置跳转
- IOS 应用APPStore上传
- 上传ios应用到AppStore
- ios 发布应用到appStore
- ios 发布应用到appStore
- iOS应用内跳转appstore
- ios发布应用到appstore
- iOS 应用内跳转APPStore
- iOS应用打包提交AppStore
- iOS应用打包提交AppStore
- ios - 打开appstore应用、打开appstore评论、打开其他应用
- ios appstore 上架应用被拒绝原因
- iOS应用怎么从Appstore下架
- iOS appStore 实现应用升级功能
- IOS开发-在应用内打开AppStore
- IOS开发-在应用内打开AppStore
- 详解在IOS后台执行
- iOS文件加密(Protecting Dat…
- iOS下载文件,保存路径. 防止…
- iOS开发流程总结
- 优秀开源代码解读:JS与iOS N…
- iOS应用内置AppStore以及iOS Safar…
- xcode4.5.1、iphone5、ios6&…
- IOS开发之----获取本机号码…
- 转: ios与android语音互通…
- iOS XCode自动化编译相关
- 哪些开源引擎可以进行Android游戏开发
- 算法题收藏(立“帖”为证,学算法)…
- 学画UML类图(Visio)
- 扒来的mac快捷键总会