Skip to content

Commit eec6f84

Browse files
committed
readme updated
1 parent 806cc85 commit eec6f84

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

README.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,52 @@
11
# react-native-rn-in-app-update
22

3-
## Getting started
3+
Google in-app updates support for react-native. Specially created for android only. After installing plugin user will get android app update popup if there is any update available on play store.
4+
5+
## Installation
46

57
`$ npm install react-native-rn-in-app-update --save`
68

7-
### Manual installation for (RN < 0.60)
9+
## Linking (RN < 0.60)
810

911
`$ react-native link react-native-rn-in-app-update`
1012

11-
## Add Below Lines in MainActivity.java
13+
14+
## Additional configuration in android (Required)
15+
16+
### Add Below Lines in MainActivity.java
1217

1318
=> Import package:
14-
import com.logicwind.inappupdate.InAppUpdateUtils;
19+
```
20+
...
21+
...
22+
import com.logicwind.inappupdate.InAppUpdateUtils; // add this
1523
1624
=> Create object :
1725
private InAppUpdateUtils appUpdateUtils;
1826
19-
=> Add below lines in OnCreate method :
20-
appUpdateUtils = new InAppUpdateUtils(this);
21-
appUpdateUtils.initAppUpdaterAndCheckForUpdate();
22-
appUpdateUtils.registerListener();
2327
24-
=> Add below methods also :
28+
@Override
29+
protected void onCreate(Bundle savedInstanceState) {
30+
...
31+
...
32+
appUpdateUtils = new InAppUpdateUtils(this); // add this
33+
appUpdateUtils.initAppUpdaterAndCheckForUpdate(); // add this
34+
appUpdateUtils.registerListener(); // add this
35+
}
36+
37+
// Add below method also
2538
@Override
2639
protected void onResume() {
27-
super.onResume();
28-
appUpdateUtils.ifUpdateDownloadedThenInstall();
40+
super.onResume();
41+
appUpdateUtils.ifUpdateDownloadedThenInstall();
2942
}
3043
44+
// Add below method also
3145
@Override
32-
protected void onDestroy() {
33-
super.onDestroy();
34-
appUpdateUtils.unregisterListener();
46+
protected void onDestroy() {
47+
super.onDestroy();
48+
appUpdateUtils.unregisterListener();
3549
}
50+
```
51+
52+
### That's it. Configuration done. No need to add anything in your application js file.

0 commit comments

Comments
 (0)