Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 11 (GM) prompts at launch even though promptAtLaunch set to NO & Submit button fails #310

Open
shutterzee opened this issue Sep 18, 2017 · 8 comments

Comments

@shutterzee
Copy link

Under iOS 11 GM in an app built with Xcode 8.3.3 (and currently in the app store) I'm seeing first launch of the day produce the prompt. I've seen this occur twice now.

Additionally, when this occurs, the Submit button does nothing. The cancel and Not Now buttons work, however.

In our application:didFinishLaunchingWithOptions: we configure as follows:

    //configure iRate
    [iRate sharedInstance].daysUntilPrompt = 0;
    [iRate sharedInstance].usesUntilPrompt = 0;
    [iRate sharedInstance].remindPeriod = 0;
    [iRate sharedInstance].promptAtLaunch = NO;

That is the only iRate code at app startup. Later in the lifecycle we explicitly call

    if ([[iRate sharedInstance] shouldPromptForRating]) {
        [[iRate sharedInstance] promptForRating];
    }
@shutterzee
Copy link
Author

shutterzee commented Oct 9, 2017

I had some time to look into this further...since iRate implements + (void)load it actually is loaded before application:didFinishLaunchingWithOptions: is called and therefore ignores the changes we are making to the settings since it actually begins the startup prompt mechanism sooner than expected. A potential work-around in our app that I'm experimenting with is to implement + (void)load for our app delegate class. Initializing iRate in that method actually works - although I'm not sure of what crazy other side-effects that may cause.

Additionally, I now see that some of the example code uses +initialize to initialize iRate but the pod documentation talks about application:didFinishLaunchingWithOptions: - I think +initialize is another option but +load seems slightly safer in my case.

@sitefeng
Copy link

In swift 4 iOS 11, the submit button is disabled when initializing from application:didFinishLaunchingWithOptions: or init functions from the AppDelegate. initialize and load function overrides are not permitted in Swift

@bvirlet
Copy link

bvirlet commented Oct 18, 2017

We've seen a similar issue. While implementing the the + load in iRate make it "magic", it causes undefined behavior because there is no control as to when +load is called. The proof of this undefined behavior is this bug affecting iOS 11.

We think that load should be removed as it causes these problems.

@zapjonny
Copy link

zapjonny commented Dec 8, 2017

I'm seeing that promptAtLaunch = false has no effect if app is launched at least 10 times, and used for at least 10 days since first launch. I think promptAtLaunch is broken, or badly documented. Alas, this project is deprecated?
Tested on iOS 11.0, iPhone SE.

btw using eventsUntilPrompt = 2 and daysUntilPrompt = 0.0 (it's weird that I still have to wait 10 days to cause the bug though)

@zapjonny
Copy link

zapjonny commented Dec 8, 2017

I had some time to look into this further...since iRate implements + (void)load it actually is loaded before application:didFinishLaunchingWithOptions: is called and therefore ignores the changes we are making to the settings since it actually begins the startup prompt mechanism sooner than expected. A potential work-around in our app that I'm experimenting with is to implement + (void)load for our app delegate class. Initializing iRate in that method actually works - although I'm not sure of what crazy other side-effects that may cause.

Okay this explains why the bug I am seeing happens only after ten days, and not directly as would be expected.

@zapjonny
Copy link

zapjonny commented Dec 8, 2017

Okay only now I read all your comments through properly, and I just have to wonder, did any of you guys figure out a workaround for this using Swift (3/4)? Also, I am using iRate below 1.12 (probably 1.11.7 as of iRate.h), not sure if that makes a huge difference though.

@bvirlet @shutterzee @sitefeng

Sorry for the ping.

@bvirlet
Copy link

bvirlet commented Dec 8, 2017

Fork the repo and remove the +load method.

@zapjonny
Copy link

zapjonny commented Dec 8, 2017

Thanks!

I guess that is one way, or we'll just reconsider. I don't think we'll use any library for reviews going forward.

Thanks iRate. 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants