2011-08-24 34 views
0

可能重複:
On the iPhone, how can you cause a URL to display an entry in the App Store?iOS - 在應用商店中加載下載頁面?

我怎樣才能打開外部下載頁面通過iOS應用程序的應用程序?

這個問題有重複,但答案並沒有真正的幫助,所以我在這裏再次問。

注:我不想打開「iTunes」的應用程序,我想打開「應用商店」

+0

非線程中的答案適用於我,其中大多數指導如何打開「itunes」而不是「app store」 – aryaxt

回答

4

這就是我如何到「App Store」應用程序打開。注意:這隻適用於真實的設備,它不適用於模擬器。那iTunes網址,並打開App Store的應用,而iOS的攔截:

#define APP_STORE_URL @"http://itunes.apple.com/us/app/id123456789?mt=8" 

NSURL* redirectToURL = [NSURL URLWithString:APP_STORE_URL]; 
[[UIApplication sharedApplication] openURL:redirectToURL]; 

當然,替換你的應用程序的ID號的ID號。我從other question得到這個,它確實有效。

1

這是我用來做什麼的。

NSString *storeURLString = [NSString stringWithFormat:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@&;amp;amp;amp;amp;mt=8",yourAppStoreID]; 

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:storeURLString]]; 

你需要確定你的AppStore的ID是通過選擇在iTunes中「複製鏈接」,並去除在URL中的唯一ID的「ID」的前綴是什麼。

相關問題