【问题标题】:how to include rate this App button in a application如何在应用程序中包含评价此应用程序按钮
【发布时间】:2012-01-14 11:52:29
【问题描述】:

我有这个代码在一个按钮点击来评价这个应用程序

-(IBAction)_clickbtnratethisApp:(id)sender
{

    NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
    str = [NSString stringWithFormat:@"%@/wa/viewContentsUserReviews?", str]; 
    str = [NSString stringWithFormat:@"%@type=Purple+Software&id=", str];

    // Here is the app id from itunesconnect
    str = [NSString stringWithFormat:@"%@289382458", str]; 

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}

但是当我点击按钮时什么都没有发生,我需要设置一个警报视图来显示像 ratethisapp 这样的普通警报,不,谢谢,稍后。如果我点击 ratethisapp,我将重定向到 appstore 的铃声页面。如何激活?提前致谢。

【问题讨论】:

  • 你是在模拟器上测试还是在设备上测试?
  • @直到先生我在刺激器中测试它
  • 那么尼克洛克伍德的以下回答适用 - 你应该投票并接受它。

标签: iphone button rate


【解决方案1】:

itms-apps: URL 语法在模拟器上不起作用,但在设备上可以正常工作,所以这可能是您的代码唯一有问题的地方,如果您在设备上尝试它会正常工作。

不相关的提示:您可以使用 stringByAppendingString: 和 stringByAppendingFormat: 方法连接字符串,与您当前构建字符串的方式相比,这将节省一些代码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-07
    • 2017-01-07
    • 2013-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-03
    相关资源
    最近更新 更多