Giter Site home page Giter Site logo

Comments (11)

nicklockwood avatar nicklockwood commented on July 17, 2024

Yes, that should work. It should be sufficient to set [iRate sharedInstance].applicationBundleID to the bundle ID of your live app.

Unfortunately by removing the actual IDs from your bug report it's a bit hard for me to follow exactly what the issue is. I take it that in the console when iRate reports that "iRate found that the application bundle ID (com.domain.appID)" the ID is the ID of your ad-hoc app, and not the ID you set?

Where in your code are you setting the [iRate sharedInstance].applicationBundleID? Is it possible that it's being set after iRate has already made the app store request?

from irate.

nicklockwood avatar nicklockwood commented on July 17, 2024

Is your app actually live already?

from irate.

wkhatch avatar wkhatch commented on July 17, 2024

Hi Nick,

The debug output was showing me the correct bundle and app id's, and the url it reports in the first debug line works if I run it in safari; I get the expected json back, etc. Confusing as to why it would then fail.

Yes, apps are in the app store.

I did some more testing, and was eventually able to get it working by deriving the url, and setting that on the shared instance, and then NOT setting either the appID or the applicationBundleID. I'm doing all iRate customization in the app delegates' initialize method, as advised. I'm thinking I probably won't need to do any of this in the production build; I'm just trying to determine whether that's true or not.

I didn't try using just the applicationID or the applicationBundleID; perhaps that would make a difference? Like I said, right now, using just the url works as expected. I'll try more permutations and get back to you with results.

Also, does the previewMode flag impact any of this? If so, how? It doesn't seem to using just the url; the only thing it does seem to affect is the count tracking; it'll present the prompt always, etc.

Thanks for getting back so quick. Your library's quite useful; thanks for sharing it with us.

from irate.

nicklockwood avatar nicklockwood commented on July 17, 2024

Can you post the exact setup code that you're using, including the correct bundle/appIDs so I can try it and see if I can work out why it's not working?

I can understand if you don't want to post them here (although it is public information anyway) so email it to support at charcoaldesign dot co dot uk if you prefer.

from irate.

wkhatch avatar wkhatch commented on July 17, 2024

Sure, no worries. Just habit to not post them, really. As the initialize method currently is:

+(void)initialize
{
    DLog(@"Config rating, iRate");

    [iRate sharedInstance].previewMode = NO;
    [iRate sharedInstance].promptAtLaunch = NO;
    [iRate sharedInstance].onlyPromptIfLatestVersion = YES;
    [iRate sharedInstance].promptAgainForEachNewVersion = YES;
//    [iRate sharedInstance].verboseLogging = NO;
    [iRate sharedInstance].daysUntilPrompt = 1;
    [iRate sharedInstance].usesUntilPrompt = 3;
    [iRate sharedInstance].eventsUntilPrompt = 4;
    [iRate sharedInstance].remindPeriod = 5.0;

    int appID;
    NSString *bundleID = nil;
    NSString *ratingURL = nil;
    NSString *appTitle = nil;
#ifdef TARGET_NAME_Doddle
    appID = 365398792;
    bundleID = @"com.doddleme.Doddle";
    appTitle = @"Doddle";
    //@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=0"
    //ratingURL = [NSString stringWithFormat:@"https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/addUserReview?id=%d&type=Purple+Software", appID];
    ratingURL = [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d", appID];
#endif

#ifdef TARGET_NAME_DoddlePro
    appTitle = @"DoddlePro";
    appID = 414031608;
    bundleID = @"com.doddleme.DoddlePro";
    //ratingURL = [NSString stringWithFormat:@"https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/addUserReview?id=%d&type=Purple+Software", appID];
    ratingURL = [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d", appID];
#endif
    [iRate sharedInstance].ratingsURL = [NSURL URLWithString:ratingURL];
    //[iRate sharedInstance].applicationBundleID = bundleID;
    //[iRate sharedInstance].appStoreID = appID;
    [iRate sharedInstance].message = nil;
    [iRate sharedInstance].messageTitle = [NSString stringWithFormat:@"Please Rate %@", appTitle];
    [iRate sharedInstance].cancelButtonLabel = @"No, thanks";
    [iRate sharedInstance].rateButtonLabel = @"Yes";
    [iRate sharedInstance].remindButtonLabel = @"Remind Me Later";

}

from irate.

nicklockwood avatar nicklockwood commented on July 17, 2024

This works for me if I paste it into the iPhone Demo app included with iRate:

+ (void)initialize
{

#define TARGET_NAME_Doddle 1 //also works if I use TARGET_NAME_DoddlePro

    [iRate sharedInstance].previewMode = YES; // also works if set to NO - make sure it's NO for release
    //[iRate sharedInstance].promptAtLaunch = NO; // demo app doesn't work if this is NO
    [iRate sharedInstance].onlyPromptIfLatestVersion = NO; // you should set this to YES for release
    //[iRate sharedInstance].promptAgainForEachNewVersion = YES; // this is the default anyway
    //[iRate sharedInstance].verboseLogging = NO; // this is the default for non-debug builds
    [iRate sharedInstance].daysUntilPrompt = 1;
    [iRate sharedInstance].usesUntilPrompt = 3;
    [iRate sharedInstance].eventsUntilPrompt = 4;
    [iRate sharedInstance].remindPeriod = 5.0;

    NSString *bundleID = nil;
    NSString *appTitle = nil;

#if defined TARGET_NAME_Doddle

    bundleID = @"com.doddleme.Doddle";
    appTitle = @"Doddle";

#elif defined TARGET_NAME_DoddlePro

    appTitle = @"DoddlePro";
    bundleID = @"com.doddleme.DoddlePro";

#endif

    [iRate sharedInstance].applicationName = appTitle; // used in default message
    [iRate sharedInstance].applicationBundleID = bundleID; // if you set this you don't need to set appID
    [iRate sharedInstance].message = nil; //this doesn't work - if you want to clear the message use @""
    [iRate sharedInstance].messageTitle = [NSString stringWithFormat:@"Please Rate %@", appTitle];
    [iRate sharedInstance].cancelButtonLabel = @"No, thanks"; //this is the default anyway
    [iRate sharedInstance].rateButtonLabel = @"Yes";
    [iRate sharedInstance].remindButtonLabel = @"Remind Me Later"; //this is the default anyway

}

I don't think I've made any significant changes from what you posted, except to remove redundant code (I've also put in some comments for code that you should look at more closely).

Does the code above work for you?

from irate.

wkhatch avatar wkhatch commented on July 17, 2024

ok, to distill, use appbundleid, by itself. Does that have to be set, or does it normally obtain it from the plist? I'm still setting it, even for release build.

I don't need to use the url.

Yep, message can't be nil after all

Confirmed this works after all changes

Thanks for the comments, too.

from irate.

nicklockwood avatar nicklockwood commented on July 17, 2024

iRate normally gets the bundle ID from the plist. You only need to set it if you want something different from the plist (e.g. for an ad hoc build that uses a different bundle ID).

from irate.

wkhatch avatar wkhatch commented on July 17, 2024

Sorry, hate to be such a pest, but I'm having issues with the usesUntilPrompt and eventsUntilPrompt. Current, relevant config lines:

[iRate sharedInstance].daysUntilPrompt = 0.0;
[iRate sharedInstance].usesUntilPrompt = 1;
[iRate sharedInstance].eventsUntilPrompt = 2;
[iRate sharedInstance].remindPeriod = 5.0;

Indicating that I'd like iRate to prompt on first use, after having recorded two log events. Here's the code for that:

if (!self.isFromCallSheet) {
    DLog(@"Prior to iRate logging event, we have %d number of recorded log events, and %d number of uses", [iRate sharedInstance].eventCount, [iRate sharedInstance].usesCount);
    [[iRate sharedInstance] logEvent:NO];
    if ([[iRate sharedInstance] shouldPromptForRating]) {
        DLog(@"After recording one, and prior to prompt, we have %d number of recorded log events, and %d number of uses", [iRate sharedInstance].eventCount, [iRate sharedInstance].usesCount);
        [[iRate sharedInstance] promptIfNetworkAvailable];
    }
}

It prompts on the very first event, indicated by this log output:

2012-10-05 10:46:01.001 DoddlePro[12579:907] -[ContactUnifiedViewController setupView] Prior to iRate logging event, we have 0 number of recorded log events, and 1 number of uses
2012-10-05 10:46:01.150 DoddlePro[12579:907] -[ContactUnifiedViewController setupView] After recording one, and prior to prompt, we have 1 number of recorded log events, and 1 number of uses

So, the shouldPromptForRating is incorrectly returning YES

Update: sorry for being so dense. I looked at the comments on the eventsUntilPrompt again, and now it makes sense. I changed my usesUntilPrompt to 2, and now I get the behavior I'm looking for. Thought I might leave this in in case it helps somebody else; I'll leave it to you to wack it if you feel it's not appropriate. Thanks again for all your assistance, Nick.

from irate.

nicklockwood avatar nicklockwood commented on July 17, 2024

This is behaving as expected. From the documentation for the eventsUntilPrompt property:

"once the day threshold is reached, the prompt will appear if either the event threshold OR uses threshold is reached. This defaults to 10 events."

So if you are not using the usesUntilPrompt value, you should set it to INT_MAX instead of setting it to 1, then it won't factor into the equation.

from irate.

nicklockwood avatar nicklockwood commented on July 17, 2024

Sorry, I didn't see your update. I've moved it to the bottom of your post so it's clearer for anyone else who is reading.

from irate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.