eggheadgames / siren Goto Github PK
View Code? Open in Web Editor NEWNotify users when a new version of your Android app is available, and prompt them with the Play Store link. A port of the iOS library of the same name.
License: MIT License
Notify users when a new version of your Android app is available, and prompt them with the Play Store link. A port of the iOS library of the same name.
License: MIT License
There does not seem to be Chinese language support in the library contrary to what the documentation says: https://github.com/eggheadgames/Siren#localization.
Am I right? Is the support of this language planned?
The original button orders are shown here: https://github.com/ArtSabintsev/Siren#screenshots.
Make our button orders match these. E.g. this is the current version which has the Update and Next Time buttons reversed:
I've been having some issues on older devices (E.g: KitKat) when the json file is accessed using HTTPS on a server that doesn't support SSL3. The solution is to force HttpsURLConnection's ciphers: http://stackoverflow.com/a/30302235/2124535
Supported ciphers per platform: https://developer.android.com/reference/javax/net/ssl/SSLSocket.html
PR sent
At the moment text and button's customisation not available. Can you please expose methods to do that ? I think it is mandatory for any app.
Any reason why this library hasn't implemented the ability to check against google play similar to this library (https://github.com/javiersantos/AppUpdater)? If this was added it would match the iOS like library (Harpy and Siren - Swift). Having a json file on my server and having to update that just for the Android version doesn't seem ideal when the iOS version just works out of the box. Just curious thanks.
I'm trying to display a custom UI when the app is out of date instead of the standard dialog provided in this library. I do this by following the README from the "Example"-section. When I follow that exact code (create my own ISirenListener and add my own UI in the onShowUpdateDialog-method) and set all Siren Alert-types to NONE, I get this error:
I open the app (I have a lower version number hard coded for testing so it will always be called) and my own custom UI is displayed. However, the standard Siren UI is still displayed underneath my own UI. When I close my own UI I can then see the Siren UI. I tried this for a custom dialog and standard snackbar and I get the same result for both.
I don't understand, if I set the Alert-types to NONE, then why does the standard Siren UI still appear? I only want my own UI to show.
its me again...annoying...right?
So I was wondering since I am able to check if my app has an update & if there is show an update dialog...but if there isn't an update then a no update dialog pops up saying "you have the latest update....blah blah"
it will be cool if this was an extra option...
could you also add this in the next update?
Hello,
I'm using this library alongside with the iOS counterpart, and I'm planning on using the same JSON file for both. Other than setting minVersionCode, I would also like to toggle version check and set alertType from that. While I can do parsing manually on iOS, I wonder if there's a way to retrieve the additional parameters on Android, since I don't have to handle download & parsing here?
Thank you!
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!
Dialog title is only showing on Android 5 device.
I have run the code on:
Samsung Note 3, Android 5.0.1 (Shows title)
Nexus 7, Android 6.0.1 (No title)
Samsung S6, Android 7.0.1 (No title)
How to i ensure that the title is showing on all devices?
Is this in the pipeline?
Siren (ios) allows the user to force a certain locale, overriding the user's current default. For full compatibility, we should consider adding this.
See https://github.com/ArtSabintsev/Siren/blob/master/README.md#force-localization
I just want to know exactly how often the .DAILY checks (or WHEN it checks).
My issue is the following:
I have the checker set to .IMMEDIATELY right now. I store the version.json file on my github in /docs folder and commit it to the repo when I'm ready to release the update. The problem with this is that it causes people in my app to get the update message before the update is approved by Google Play (takes a few hours).
SO I thought .DAILY would be better. But, when I had it set to .DAILY, not matter how often I opened the app, it never seemed to notify me that there was an update. (this is why I set it to .IMMEDIATELY).
So what exactly is the frequency that triggers the .DAILY setting to display the dialog to the users of the app?
I've implemented this to my React Native app for a while now but I've just recently added logs on the SirenListener to monitor user conversion. I was surprised by tons of SSL handshake / connection timeout errors.
I couldn't reproduce the issue on my device, however, and I'm certain that my JSON endpoint has a valid SSL cert. (We have other endpoints on the same server and we've been using it without issue on the RN side).
It's possible that our CA might not be trusted by the Android system, because this is among the logs:
java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Is there anyway I can load the cert and set a custom SSLSocketFactory
? Or is there anything else I should look at?
Address review comments from PR #26:
Could not resolve com.github.eggheadgames:Siren:1.5.+.
Choosing Analyze -> Inspect Code shows a few lint issues that can tidied up, or tagged to be ignored (e.g. because they're not relevant for a ilbrary - such as unused code).
TBD: get a CI server running that will test for these on commit/PR...
It would be great to leverage all the localisations available in the iOS Siren, and the easier we make it, the more likely it is to happen.
So, to make this easier for everyone, please use the same / similar names. E.g. iOS English is:
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
"A new version of %@ is available. Please update to version %@ now." = "A new version of %@ is available. Please update to version %@ now.";
/* Update alert title */
"Update Available" = "Update Available";
/* Update alert dismiss button title */
"Next time" = "Next time";
/* Update alert skip button title */
"Skip this version" = "Skip this version";
/* Update alert skip button title */
"Update" = "Update";
So for strings.xml
let's create a separate file with these names (note that app_name
and fallback_app_name
should go somewhere else):
<resources>
<string name="update_alert_message">A new version of %s is available. Please update to version %s now.</string>
<string name="update_available">Update available</string>
<string name="next_time">Next time</string>
<string name="skip_this_version">Skip this version</string>
<string name="update">Update</string>
</resources>
Please add another couple of languages at the same time, just to "keep us honest" as we go forward.
Let's move away from the so-called "gitflow" model and go back to a single master
branch.
If the JSON version file is stored on an http server and is not available via https, then the library will cause a crash like this:
01-24 11:36:58.578 28106-28297/com.example E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.example, PID: 28106
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:325)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.ClassCastException: com.android.okhttp.internal.huc.HttpURLConnectionImpl cannot be cast to javax.net.ssl.HttpsURLConnection
at com.eggheadgames.siren.Siren$LoadJsonTask.doInBackground(Siren.java:266)
at com.eggheadgames.siren.Siren$LoadJsonTask.doInBackground(Siren.java:258)
at android.os.AsyncTask$2.call(AsyncTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
This seems to have been introduced by #10 / #11 whereby the code now only works if the JSON file is fetched via https.
We should make two fixes:
http
url to be fetched (not just https
)I just want the versionCode from JSON URL. Is it possible to get in the listener ?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.