iOS   发布时间:2022-03-31  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了在iOS中为此应用评分大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经使用 iRate类来添加’rate我的应用程序’功能.我已经添加了我的应用程序包ID.但是当我运行应用程序时,显示“无法连接到iTunes Store”.请帮我找出问题.

这是我使用的代码

-(void)applicationWillEnterForeground:(UIApplication *)application
{
    NSUserDefaults *times=[NSUserDefaults standardUserDefaults];
    int test=[[times objectForKey:@"time"]intValue];
    NSLog(@"test..:%d",test);
    if (test >=5) {

        [iRate sharedInstance].applicationBundlEID = @"com.01Synergy";
        [iRate sharedInstance].onlyPromptIfLatestVersion = NO;

        //enable preview mode
        [iRate sharedInstance].previewmode = YES;
    }
}
- (void)applicationDidEnterBACkground:(UIApplication *)application {

    NSUserDefaults *times=[NSUserDefaults standardUserDefaults];

    int time=[[times objectForKey:@"time"]intValue];

    if (time<5) {
        time++;
        [times setInteger:time forKey:@"time"];

    }

}

解决方法

我不熟悉iRate,我经常使用 Appirater.它是非常容易实现.简单通话
[Appirater setAppId:@"380245121"];    // Change for your "Your APP ID"
[Appirater setDaysUntilPrompt:0];     // Days from first entered the app until prompt
[Appirater setUsesUntilPrompt:5];     // number of uses until prompt
[Appirater setTimeBeforeReminding:2]; // Days until reminding if the user taps "remind me"
//[Appirater setDebug:YES];           // If you set this to YES it will display all the time

用户在第五次进入应用程序后显示

说你已经做了[Appirater setUsesUntilPrompt:5]和[Appirater setDaysUntilPrompt:2],这意味着从第一个应用程序条目的时间必须是2天(或更多)和应用程序使用次数(应用程序进入前台/推出)必须是5倍(或更多).

您的目的代码例:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [Appirater setAppId:@"380245121"];    // Change for your "Your APP ID"
    [Appirater setDaysUntilPrompt:0];     // Days from first entered the app until prompt
    [Appirater setUsesUntilPrompt:5];     // number of uses until prompt
    [Appirater setTimeBeforeReminding:2]; // Days until reminding if the user taps "remind me"
    //[Appirater setDebug:YES];           // If you set this to YES it will display all the time

    //... Perhaps do stuff

    [Appirater appLaunched:YES];

    return YES;
}

- (void)applicationWillEnterForeground:(UIApplication *)application{
    [Appirater appEnteredForeground:YES];
}

如果您的应用在App Store上,您可以在URL中找到应用ID:

如果尚未发布,您可以通过访问iTunes Connect – >>>点击“管理您的应用” – >>点击你的应用程序你的应用程序ID将在这里看到

希望有帮助!

大佬总结

以上是大佬教程为你收集整理的在iOS中为此应用评分全部内容,希望文章能够帮你解决在iOS中为此应用评分所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。