繁体   English   中英

如何在应用程序中为该应用程序按钮评分

[英]how to include rate this App button in a application

我在按钮中单击此代码以批准该应用

-(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,nothanks,later。如果我点击ratethisapp,我将重定向到appstore的环形页面。如何激活这吗?谢谢。

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM