如何在应用程序中包含此App按钮的评分

sta*_*one 0 iphone button rate

我点击了一下按钮就可以使用此代码

-(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]];
}
Run Code Online (Sandbox Code Playgroud)

但是当我点击按钮时没有任何反应,我需要的是我想要设置一个警报视图,像普通的警报一样显示像ratethisapp,nothanks,稍后.如果我点击ratethisapp,我将重定向到appstore的响铃页面.如何激活这个?先谢谢.

Nic*_*ood 5

itms-apps:URL语法在模拟器上不起作用,但在设备上工作正常,所以这可能是你的代码唯一的错误,如果你在设备上尝试它,它将工作正常.

不相关的提示:您可以使用stringByAppendingString:和stringByAppendingFormat:方法连接字符串,这将保存一些代码,而不是当前构建字符串的方式.