react-native-ota-hot-update 1.0.2 → 1.0.4
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 +27 -1
- package/package.json +1 -1
- package/rn-hotupdate.podspec +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# react-native-ota-hot-update
|
|
2
2
|
|
|
3
|
-
A React Native module that allows you to control hot update same as Code Push, you can control version manager, hosting bundle js by your self, this library just control install the hot update after bundle js downloaded from your side. As we know, Code push is going to retirement in next year, that why i create that library for you can control bundle js from your backend side.
|
|
3
|
+
A React Native module that allows you to control hot update same as Code Push, less config than Code Push, you can control version manager, hosting bundle js by your self, this library just control install the hot update after bundle js downloaded from your side. As we know, Code push is going to retirement in next year, that why i create that library for you can control bundle js from your backend side.
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
iOS GIF | Android GIF
|
|
@@ -22,6 +22,32 @@ Auto linking already, need pod install for ios:
|
|
|
22
22
|
cd ios && pod install
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
### IOS
|
|
26
|
+
Open `AppDelegate.m` and add this:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
#import "RNhotupdate.h"
|
|
30
|
+
...
|
|
31
|
+
{
|
|
32
|
+
#if DEBUG
|
|
33
|
+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
34
|
+
#else
|
|
35
|
+
return [RNhotupdate getBundle]; ## add this line
|
|
36
|
+
#endif
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Android
|
|
41
|
+
Open `MainApplication.java/kt` and add these codes bellow:
|
|
42
|
+
```bash
|
|
43
|
+
import com.rnhotupdate.OtaHotUpdate
|
|
44
|
+
...
|
|
45
|
+
override fun getJSBundleFile(): String? {
|
|
46
|
+
return OtaHotUpdate.getBundleJS()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
25
51
|
## That's it, can check the example code
|
|
26
52
|
|
|
27
53
|
Here is the guideline to control bundle js by yourself, in here i am using Firebase storage to store bundlejs file and a json file that announce new version is comming:
|
package/package.json
CHANGED
package/rn-hotupdate.podspec
CHANGED
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.license = package["license"]
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
|
-
s.platforms = { :ios =>
|
|
14
|
+
s.platforms = { :ios => 11.0 }
|
|
15
15
|
s.source = { :git => "https://github.com/vantuan88291/react-native-ota-hot-update.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm}"
|