精華區beta MacDev 關於我們 聯絡資訊
大家好, 剛剛無意間在iOS6的iPad 臉書程式發現這個 http://ppt.cc/E~H0 就是程式內開啟AppStore上另一支APP的下載界面(不用跳離開原來的程式), 想請問這是怎麼做到的?(給關鍵字就行了...其餘我在自行查詢) 我用 In app download app, In App install app....等關鍵字去查, 查到的都不是我要的...有些是破解,有些是In House APP... 感恩了~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.127.156.72
kiii210:有試過原本開啟AppStore的code嗎? 01/13 03:39
tentenlee:關鍵字ios openURL appstore http://tinyurl.com/krqdxg 01/13 07:59
benjenq:openURL會跳出原本的程式,想要的是如圖In-App 01/13 13:40
nobody1:看起來像是另一個viewcontroller 多試幾個不同的容器吧 01/13 14:50
kokuyoku:SKStoreProductViewController iOS6新增的類別 01/14 10:43
s8911124:InAppPurchase? 01/14 21:43
太感謝kokuyoku大大了,分享一下心得: ViewController.h #import <StoreKit/StoreKit.h> @interface ViewController : UIViewController<SKStoreProductViewControllerDelegate>{ //View Controller要加上SKStoreProductViewControlleDelegate } -(IBAction)CallProduct:(UIButton *)sender; ViewController.m #import "ViewController.h" -(IBAction)CallProduct:(UIButton *)sender{ SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init]; storeViewController.delegate = self; NSDictionary *parameters = @{SKStoreProductParameterITunesItemIdentifier: [NSNumber numberWithInteger:應用程式的Apple ID為一串數字]}; [storeViewController loadProductWithParameters:parameters completionBlock:^(BOOL result, NSError *error) { if (result) [self presentViewController:storeViewController animated:YES completion:nil]; }]; } -(void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController { [viewController dismissViewControllerAnimated:YES completion:nil]; } ※ 編輯: benjenq 來自: 59.127.156.72 (01/15 03:22)