cordova-plugin-in-app-updates 1.0.6 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/nbproject/project.xml +1 -1
- package/package.json +4 -3
- package/plugin.xml +12 -8
- package/src/android/InAppUpdate.java +1 -4
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Cordova Android plugin for checking for updates and auto updating app with Googl
|
|
|
28
28
|
| 1.0.6 | 9.0.0 | 8.0.0 | No |
|
|
29
29
|
| 2.0.5 | 10.0.0 | 9.0.0 | Yes |
|
|
30
30
|
|
|
31
|
-
## Install latest version
|
|
31
|
+
## Install latest version
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
cordova plugin add cordova-plugin-in-app-updates
|
|
@@ -53,6 +53,8 @@ Invokes the AppUpdateManager and return one of the [updateAvailability](https://
|
|
|
53
53
|
- **DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS**
|
|
54
54
|
- **UNKNOWN**
|
|
55
55
|
|
|
56
|
+
:information_source: Browser platform does nothing and always returns **UPDATE_NOT_AVAILABLE**
|
|
57
|
+
|
|
56
58
|
When this method returns **UPDATE_AVAILABLE**, your app is ready to use the following methods to prompt the user for update.
|
|
57
59
|
|
|
58
60
|
### Example
|
|
@@ -85,6 +87,8 @@ Starts a [flexible update](https://developer.android.com/guide/playcore/in-app-u
|
|
|
85
87
|
- **DOWNLOADING**: An update is currently being downloaded in the background.
|
|
86
88
|
- **DOWNLOADED**: The update was downloaded and the snackbar with RESTART button has been shown.
|
|
87
89
|
|
|
90
|
+
:information_source: Browser platform does nothing and always returns **UPDATE_NOT_AVAILABLE**
|
|
91
|
+
|
|
88
92
|
### Example
|
|
89
93
|
|
|
90
94
|
```javascript
|
|
@@ -116,6 +120,8 @@ Starts an [immediate update](https://developer.android.com/guide/playcore/in-app
|
|
|
116
120
|
- **DOWNLOADING**: An update is currently being downloaded in the foreground.
|
|
117
121
|
- **DOWNLOADED**: The update was downloaded and will be installed immediately.
|
|
118
122
|
|
|
123
|
+
:information_source: Browser platform does nothing and always returns **UPDATE_NOT_AVAILABLE**
|
|
124
|
+
|
|
119
125
|
### Example
|
|
120
126
|
|
|
121
127
|
```javascript
|
|
@@ -134,6 +140,8 @@ Sets the label and the button text for the snackbar shown after downloading a fl
|
|
|
134
140
|
|
|
135
141
|
If not called, default messages in English will be shown.
|
|
136
142
|
|
|
143
|
+
:information_source: Browser platform does nothing and always returns **SUCCESS**
|
|
144
|
+
|
|
137
145
|
### Example
|
|
138
146
|
|
|
139
147
|
```javascript
|
package/nbproject/project.xml
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cordova-plugin-in-app-updates",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "In-App updates from Play Store for your Apache Cordova app.",
|
|
5
5
|
"cordova": {
|
|
6
|
-
"id": "cordova-plugin-in-app-
|
|
6
|
+
"id": "cordova-plugin-in-app-update",
|
|
7
7
|
"platforms": [
|
|
8
|
-
"android"
|
|
8
|
+
"android",
|
|
9
|
+
"browser"
|
|
9
10
|
]
|
|
10
11
|
},
|
|
11
12
|
"engines": {
|
package/plugin.xml
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="cordova-plugin-in-app-updates" version="
|
|
2
|
+
<plugin id="cordova-plugin-in-app-updates" version="2.0.5" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
3
|
<name>InAppUpdate</name>
|
|
4
4
|
<description>In-App updates from Play Store for your Apache Cordova app.</description>
|
|
5
5
|
<license>MIT</license>
|
|
6
6
|
<keywords>android,in-app,update</keywords>
|
|
7
7
|
|
|
8
8
|
<engines>
|
|
9
|
-
<engine name="cordova" version=">=
|
|
10
|
-
<engine name="cordova-android" version=">=
|
|
9
|
+
<engine name="cordova" version=">=10.0.0" />
|
|
10
|
+
<engine name="cordova-android" version=">=9.0.0" />
|
|
11
11
|
</engines>
|
|
12
12
|
|
|
13
13
|
<js-module name="InAppUpdate" src="www/InAppUpdate.js">
|
|
@@ -15,14 +15,18 @@
|
|
|
15
15
|
</js-module>
|
|
16
16
|
|
|
17
17
|
<platform name="android">
|
|
18
|
-
<
|
|
19
|
-
|
|
18
|
+
<config-file target="config.xml" parent="/*">
|
|
19
|
+
<preference name="AndroidXEnabled" value="true" />
|
|
20
|
+
</config-file>
|
|
21
|
+
|
|
22
|
+
<preference name="ANDROIDX_APPCOMPAT_VERSION" default="1.3.0" />
|
|
23
|
+
<framework src="androidx.appcompat:appcompat:$ANDROIDX_APPCOMPAT_VERSION" />
|
|
20
24
|
|
|
21
|
-
<preference name="ANDROID_PLAY_CORE_VERSION" default="1.
|
|
25
|
+
<preference name="ANDROID_PLAY_CORE_VERSION" default="1.8.0" />
|
|
22
26
|
<framework src="com.google.android.play:core:$ANDROID_PLAY_CORE_VERSION" />
|
|
23
27
|
|
|
24
|
-
<preference name="
|
|
25
|
-
<framework src="com.android.
|
|
28
|
+
<preference name="ANDROID_MATERIAL_VERSION" default="1.2.0" />
|
|
29
|
+
<framework src="com.google.android.material:material:$ANDROID_MATERIAL_VERSION" />
|
|
26
30
|
|
|
27
31
|
<config-file target="res/xml/config.xml" parent="/*">
|
|
28
32
|
<feature name="InAppUpdate">
|
|
@@ -4,7 +4,7 @@ import android.app.Activity;
|
|
|
4
4
|
import android.content.Intent;
|
|
5
5
|
import android.content.IntentSender;
|
|
6
6
|
import android.graphics.Color;
|
|
7
|
-
import android.
|
|
7
|
+
import com.google.android.material.snackbar.Snackbar;
|
|
8
8
|
import android.util.Log;
|
|
9
9
|
import android.view.View;
|
|
10
10
|
import android.widget.FrameLayout;
|
|
@@ -35,9 +35,6 @@ import static android.app.Activity.RESULT_CANCELED;
|
|
|
35
35
|
import static android.app.Activity.RESULT_OK;
|
|
36
36
|
import static com.google.android.play.core.install.model.ActivityResult.RESULT_IN_APP_UPDATE_FAILED;
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* @author https://github.com/andreszs/cordova-plugin-in-app-update
|
|
40
|
-
*/
|
|
41
38
|
public class InAppUpdate extends CordovaPlugin {
|
|
42
39
|
|
|
43
40
|
private static String LOG_TAG;
|