You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 17, 2025. It is now read-only.
Many applications have need to tell users to update current application because they have outdated version. Google Play doesnt support any API for that so we need to use custom solution. This library will compare current application version number to the versions that are stored in remote locations (Api request/Firebase Remote Config, ...) and show dialog to user with prompt to update his app.
4
+
Many applications have need to tell their users to update current application because they have outdated version. Google Play doesnt support any API for that so we need to use custom solution. This library will compare current application version number to the versions that are stored in remote locations (Api request/Firebase Remote Config, ...) and show the dialog to the user with prompt to update their app.
5
5
6
6
7
7
This library is based on RxJava2
8
8
## Usage
9
9
The simplest way for use this library is
10
-
```java
10
+
```kotlin
11
11
val versionFetcher =...
12
12
val versionResolver = new VersionStatusResolver(versionFetcher)
this will check versions and show update dialog with default texts. If you want to modify strings in dialog and maybe package name, you can via DialogSettings.Builder() class.
17
17
18
-
```java
18
+
```kotlin
19
19
val versionFetcher =...
20
20
val versionResolver = new VersionStatusResolver(versionFetcher)
// update is mandatory, user should not be able to run app
45
-
}, {err ->
39
+
when(status) {
40
+
UP_TO_DATE->// app is up to date
41
+
UPDATE_AVAILABLE->// update is available but is not mandatory
42
+
else->// update is mandatory, user should not be able to run app
43
+
}}, {err ->
46
44
// some error happened while fetching version info
47
45
})
48
46
@@ -56,22 +54,38 @@ Two basic implementation are provided in separate modules - Firebase Remote Conf
56
54
### Firebase Remote Config
57
55
Class `FirebaseVersionFetcher` takes optional argument for cache expiration of fetched data from Firebase Remote Config. Default names of attributes are `minimal_version_android` and `current_version_android` but you can modify that with constructor attributes.
Class `RestVersionFetcher` accepts as argument base url of server. On url GET ${baseUrl}/app-version is expected response with attributes `minimal_version_android` and `current_version_android` (names can be also modified)
0 commit comments