【问题标题】:How to open "Paid" app page in iPhone's AppStore by clicking button in "Lite" app?如何通过单击“Lite”应用程序中的按钮在 iPhone 的 AppStore 中打开“付费”应用程序页面?
【发布时间】:2011-06-15 04:48:08
【问题描述】:

我有一个应用程序的 2 个版本。精简版和付费版。 我希望在 Lite 版本中有一个按钮,单击该按钮会在 iPhone 上打开 App Store 应用程序并显示该应用程序的付费版本页面。

我该怎么做? 我不想在 Safari 中打开付费版 iTunes 页面。它应该只在 App Store 应用程序中打开。

谢谢!

【问题讨论】:

    标签: iphone objective-c iphone-sdk-3.0 ios4


    【解决方案1】:

    这应该始终有效(所有操作系统):

    http://itunes.apple.com/app/idYOUR_PAID_APP_ID
    

    代码 sn-p(你可以直接复制粘贴):

    #define YOUR_PAID_APP_ID 553834731 // replace with your paid app ID
    
    static NSString *const iOSAppStoreURLFormat = @"http://itunes.apple.com/app/id%d"; // General link to the App Store
    
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat: iOSAppStoreURLFormat,YOUR_PAID_APP_ID ]]]; // Would open the right link
    

    【讨论】:

    • 糟糕的解决方案! iPhone 首先打开 Safari,然后是 AppStore。
    • @Altaveron 我已经更新了答案,因此您可以删除这些评论(似乎与我无关)
    猜你喜欢
    • 2012-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-07
    • 1970-01-01
    • 1970-01-01
    • 2012-02-16
    • 1970-01-01
    相关资源
    最近更新 更多