簡體   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