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

Additional method in ISirenListener #18

Open
tylerbwoodridge opened this issue Aug 30, 2017 · 5 comments
Open

Additional method in ISirenListener #18

tylerbwoodridge opened this issue Aug 30, 2017 · 5 comments

Comments

@tylerbwoodridge
Copy link

Is it possible to add another method to the ISirenListener? This method would be along the lines of "onNoAction" or "onNoUpdateAvailable".

I am hoping to check my app's version while in the splash screen. After the version has been checked, I would like to verify my stored api token's validity and take the user to 1 of 2 possible activities. With the current listener methods, I am not seeing a clear way to get this behavior when the user already has the most up to date version available. Maybe I am missing something though?

Thanks!

@mikemee
Copy link
Collaborator

mikemee commented Aug 30, 2017

@tylerbwoodridge Hi, that's an interesting idea. I'm reading the code the same way as you - there's no way to do this currently.

Our overall approach has been to mirror the iOS version as closely as possible. A quick look now suggests they don't have this, so my inclination is to leave it alone.

Alternatively, can you just track that you received no result from the ISirenListener? I.e. have a timeout or similar? Remember also that there are other reasons it can return nothing - e.g. not enough time has elapsed to check again (or, of course, no internet).

@mikemee mikemee closed this as completed Sep 13, 2017
@Pantkowsky
Copy link

Hey @mikemee ! I have the same problem as the author. Has this type of callback been implemented? Problem is (as mentioned above), due to our API schema, we need to check for the version before the user actually gets into the app (check needs to happen in splash screen), otherwise bad things will happen. If the user is on the latest version, he should be allowed to enter and re-directed to appropriate activity within the app, else show the update dialog. Without the callback, the dialog will appear, but the next activity will be started meanwhile too, which is a unwanted behavior -> there is a need for additional ISirenListener method like onLatestVersion or alike. How could that be achieved?

@mikemee
Copy link
Collaborator

mikemee commented Sep 6, 2018

The problem with doing this in a splash screen is that there’s a server call in the middle. As those are inherently async, it seems architecturally wrong to have your splash screen wait for that. Or maybe I’m missing something?

@Pantkowsky
Copy link

Well, you are right obviously, however I believe that this is irrelevant for the topic. Whether it is the intention of an engineer to put it in Splash screen or not should not be the decisive factor of this callback implementation. Unless I am completely wrong?

@mikemee
Copy link
Collaborator

mikemee commented Sep 11, 2018

@Pantkowsky True of course :)

Hmm, ok! Easy enough I guess, and now that two people have asked for it. Re-opening.

I'll accept a PR (with a test) if someone is keen!

@mikemee mikemee reopened this Sep 11, 2018
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

3 participants