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

[solved]custom configurations ignored...cant set dialog to "force" #5

Closed
xstar97 opened this issue May 9, 2016 · 17 comments
Closed
Labels

Comments

@xstar97
Copy link

xstar97 commented May 9, 2016

I tried multiple ways & even followed the sample to the letter, but I can't set my dialog to "force" so I can finally "force" my users to install the latest updates....it keeps using the default settings...the two button dismiss & update!
this is the only library that worked for me & its the simplest...but it just won't let me set my own configurations what so ever

I also even changed my json file from version name to versioncode just to be sure...but its still the same problem

@mikemee
Copy link
Collaborator

mikemee commented May 9, 2016

Thanks Xstar97, We'll take a look at this pronto. Just in case it helps, do you have a code snippet you can share? Thx.

@mikemee
Copy link
Collaborator

mikemee commented May 9, 2016

Fwiw, I created the screenshots by using the various options, so it was working to some extent...

@mikemee
Copy link
Collaborator

mikemee commented May 9, 2016

@yurii-diachenko can you please take a look, and also create a test to cover the FORCE scenario (and similar)? Thx.

@xstar97
Copy link
Author

xstar97 commented May 9, 2016

//above oncreate
private static final String TAG = MainActivity.class.getSimpleName();
private static final String SIREN_JSON_DOCUMENT_URL = "https://raw.githubusercontent.com/Xstar97/TXI/master/gandalf.json";
//inside on create
checkCurrentAppVersion();
....
}

private void checkCurrentAppVersion() {
    Siren siren = Siren.getInstance(getApplicationContext());
    siren.setMajorUpdateAlertType(SirenAlertType.FORCE);
    siren.checkVersion(this, SirenVersionCheckType.IMMEDIATELY, SIREN_JSON_DOCUMENT_URL);
}

@mikemee
Copy link
Collaborator

mikemee commented May 9, 2016

@xstar97, and what is the current version of your app? I wonder if adding the following will get the bahaviour you want:

siren.setMajorUpdateAlertType(SirenAlertType.FORCE);
siren.setMinorUpdateAlertType(SirenAlertType.FORCE);
siren.setPatchUpdateAlertType(SirenAlertType.FORCE);
siren.setRevisionUpdateAlertType(SirenAlertType.FORCE);

In the meantime, we'll check the logic for Major when using minVersionCode in the json file. Thx.

@xstar97
Copy link
Author

xstar97 commented May 9, 2016 via email

@xstar97
Copy link
Author

xstar97 commented May 9, 2016

its still the same...config is still not working me...is it working with you?

@xstar97
Copy link
Author

xstar97 commented May 9, 2016

private static final String TAG = MainActivity.class.getSimpleName();

in this line "TAG" is yellow...does this have any merit in the error or no?

@xstar97
Copy link
Author

xstar97 commented May 9, 2016

also I cant add any older version to my build.gradle...in aide

@mikemee
Copy link
Collaborator

mikemee commented May 9, 2016

Thanks for that extra info. I've replicated this behaviour. Now I'm trying to work out why it's broken. I expect to update here shortly... though my laptop battery is running out...!

@xstar97
Copy link
Author

xstar97 commented May 9, 2016

Thanks! Glad to have help an awesome library!
Even though it's the only one that didn't crash my app...
I tried the others... They didn't work for me
On May 9, 2016 2:16 PM, "mikemee" notifications@github.com wrote:

Thanks for that extra info. I've replicated this behaviour. Now I'm trying
to work out why it's broken. I expect to update here shortly... though
my laptop battery is running out...!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5 (comment)

@mikemee
Copy link
Collaborator

mikemee commented May 9, 2016

In the meantime, I know you switched to using versionCode, but can you try the full semantic version again, i.e.: remove the minVersionCode from the json, replace it with minVersionName and try again with all the setPatchUpdateAlertType calls above? I know that worked for me in prior testing and that might get you going sooner than waiting for me to get a fix done. Thx!

@xstar97
Copy link
Author

xstar97 commented May 9, 2016

Your solution worked for me thanks...Your a life saver!

@xstar97 xstar97 changed the title custom configurations ignored...cant set dialog to "force" [solved]custom configurations ignored...cant set dialog to "force" May 9, 2016
@mikemee
Copy link
Collaborator

mikemee commented May 9, 2016

Thanks. Glad it is working for you now, and thanks for reporting this and the prompt responses!

I think we still need to either more clearly document the current behaviour and/or fix the versionCode scenario as well as possibly add some tests, so I'll leave this open until we do.

@mikemee mikemee assigned Apisov and unassigned yurii-diachenko May 9, 2016
@mikemee
Copy link
Collaborator

mikemee commented May 9, 2016

@Apisov, please take a look at this. thx!

@mikemee
Copy link
Collaborator

mikemee commented May 10, 2016

@xstar97 Did you try using siren.setVersionCodeUpdateAlertType(SirenAlertType.FORCE);

I sort of assumed that so I didn't ask, but now that we're testing, it seems that it works as expected. Maybe we just need to update the documentation to fix this!

@mikemee
Copy link
Collaborator

mikemee commented May 10, 2016

I've confirmed that this appears to work as requested:

    private void checkAvailableVersion() {
        Siren siren = Siren.getInstance(getApplicationContext());
        siren.setVersionCodeUpdateAlertType(SirenAlertType.FORCE);
        siren.checkVersion(this, SirenVersionCheckType.IMMEDIATELY, SIREN_JSON_DOCUMENT_URL);
    }

mikemee added a commit that referenced this issue May 10, 2016
* refactor some repeated setup code
* remove extraneous tests related to issue #5
@mikemee mikemee added question and removed bug labels May 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants