Skip to content
This repository has been archived by the owner on Nov 22, 2020. It is now read-only.

Ability to reset skip version status. #201

Closed
wants to merge 2 commits into from
Closed

Ability to reset skip version status. #201

wants to merge 2 commits into from

Conversation

kamrankhan07
Copy link

I wanted to use combination of Harpy and our own server controlled way of forcing user to update the app, and I needed to reset the skipped version status for it. There are a lot of other ways to go by this, like exposing alert method or writing our own method but I thought it would be a good addition to API.

@ArtSabintsev
Copy link
Owner

Hi - thanks for the PR! Can you give me more context around why you had to reset the skip version status?

@kamrankhan07
Copy link
Author

We have an endpoint that we call to see if we need to force user to update the app. However I still wanted to show user when a new version is out, Harpy helps there. However if user already set to skip the version and later on we want to force the user to update to that version then I had to show custom alert and not use harpy. So, that why I had to reset the skip version status, so that I can use the Harpy code without having to repeat the code that is already written there.
So I first check if need to force user then I set the alert type to force and reset skip version status and call checkVersion and it works as expected.

Harpy/Harpy.h Outdated
@@ -186,6 +186,11 @@ typedef NS_ENUM(NSUInteger, HarpyAlertType)
*/
- (void)checkVersionWeekly;

/**
Retset version skipped status

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: should be “reset”

Typo fix
@getaaron
Copy link

I like the idea of adding a way for Harpy to coordinate with an external API on forcing an update. In one project I did this by exposing a “minimum supported version” endpoint and checking that response before initializing Harpy. I also had to reset this for the reason you mentioned. I wonder if there’s a more intuitive interface we could use. Otherwise this seems like a a potentially helpful addition

@kamrankhan07
Copy link
Author

Probably parse custom api response to get minimum version to force and pass it to Harpy, which can then automatically check once more if user skipped and if the version is greater than the current version.

@ArtSabintsev
Copy link
Owner

Got it - I will follow up on Friday. Would you mind making the same changes on the Siren repository?

Sent with GitHawk

@kamrankhan07
Copy link
Author

I will check check it out later today

@kamrankhan07
Copy link
Author

I have update the interface, removed the reset method with a new parameter (same like I did in Siren), I will create a new pull request and close this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants