Skip to content

Commit 2d29aef

Browse files
authored
Merge pull request #27 from Jimmy-Chung/fix/legacy-rn
fix: 兼容 >0.61 版本
2 parents 3cae805 + 105df13 commit 2d29aef

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

android/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def DEFAULT_COMPILE_SDK_VERSION = 28
1414
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
1515
def DEFAULT_MIN_SDK_VERSION = 16
1616
def DEFAULT_TARGET_SDK_VERSION = 28
17+
def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
1718

1819
def safeExtGet(prop, fallback) {
1920
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
@@ -96,7 +97,7 @@ repositories {
9697

9798
dependencies {
9899
//noinspection GradleDynamicVersion
99-
implementation 'com.facebook.react:react-native:+' // From node_modules
100+
implementation "com.facebook.react:react-native:"+REACT_NATIVE_VERSION // From node_modules
100101
implementation 'com.finogeeks.lib:finapplet:2.37.11'
101102

102103
}

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class MopSDK {
130130
this._extentionApiCallbacks(event)
131131
})
132132

133-
MopSDK._finMopSDK.initialize(params, (data) => {
133+
MopSDK._finMopSDK.initialize({
134+
appkey, secret, apiServer, apiPrefix, userId,
135+
}, (data) => {
134136
data = handleCallbackData(data)
135137
if(data.success) {
136138
resolve(data)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-mopsdk",
33
"title": "小程序React Native SDK",
4-
"version": "1.0.4",
4+
"version": "1.0.5",
55
"description": "小程序React Native SDK",
66
"main": "index.js",
77
"scripts": {

0 commit comments

Comments
 (0)