简体   繁体   English

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

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

I have this code in a button click for ratting this app 我在按钮中单击此代码以批准该应用

-(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]];
}

but nothing happens when I click the button,my need is I want to set a alert view to show like the ordinary alert like ratethisapp,nothanks,later.If I tap the ratethisapp I will redirected to the ring page of appstore.How to active this?Thanks in advance. 但是当我单击按钮时没有任何反应,我需要设置一个警报视图以使其像普通警报一样显示,例如ratethisapp,nothanks,later。如果我点击ratethisapp,我将重定向到appstore的环形页面。如何激活这吗?谢谢。

The itms-apps: URL syntax doesn't work on the simulator but works fine on the device, so that's probably the only thing wrong with your code and if you try it on a device it will work fine. itms-apps:URL语法在模拟器上不起作用,但在设备上可以正常工作,因此这可能是唯一的代码错误,如果在设备上尝试,它将正常工作。

Unrelated tip: You can concatenate strings using the stringByAppendingString: and stringByAppendingFormat: methods, that will save some code versus the way you are building your string currently. 不相关的技巧:您可以使用stringByAppendingString:和stringByAppendingFormat:方法来连接字符串,这将节省一些代码,而与当前构建字符串的方式相比。

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

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