github連接熱更新,動(dòng)態(tài)補(bǔ)丁修復(fù)炮温,這個(gè)幾乎已經(jīng)成了大型APP的標(biāo)配。
原生目前也有比較成熟的解決方案:動(dòng)態(tài)補(bǔ)丁修復(fù)(iOS,Android) - 簡(jiǎn)書(shū)
如果使用了React-Native局待,熱更新動(dòng)態(tài)修復(fù)將變得更加簡(jiǎn)單,不用再想runtime會(huì)不會(huì)導(dǎo)致一些奇怪的問(wèn)題菱属,直接從源碼把問(wèn)題修復(fù)钳榨,更加可靠。目前實(shí)現(xiàn)思路的大同小異纽门,建議有三條路可以走:
1.使用Code push薛耻,微軟團(tuán)隊(duì),技術(shù)能力有保證赏陵,但服務(wù)器在國(guó)外饼齿。不過(guò)通過(guò)網(wǎng)絡(luò)響應(yīng)測(cè)試速度還是能接受的饲漾,而且支持補(bǔ)丁更新未來(lái)下載的包的體積會(huì)很小。
2.使用國(guó)內(nèi)類似Code-push缕溉,現(xiàn)在還處于測(cè)試版的GitHub - reactnativecn/react-native-pushy: 敬請(qǐng)期待中文網(wǎng)推出的代碼熱更新服務(wù)
3.有條件的話考传,自己搭建熱更新平臺(tái)。ReactNative增量升級(jí)方案 - react-native - SegmentFault
開(kāi)始使用Code push
GitHub - Microsoft/react-native-code-push: React Native plugin for the CodePush service.
(一)安裝到你的react-natvie程序
cd 項(xiàng)目路徑
npm install --save react-native-code-push@latest
(二)在原生程序里連接code-push
iOS?
在Podfile 添加
pod'CodePush',:path=>'./node_modules/react-native-code-push'
然后運(yùn)行 pod install
修改jsCodeLocation 指向
jsCodeLocation = [CodePushbundleURL];
Android
查看GitHub - Microsoft/react-native-code-push: React Native plugin for the CodePush service.