diff --git a/index.js b/index.js index d6b007a..9d7468b 100644 --- a/index.js +++ b/index.js @@ -270,6 +270,9 @@ export function shareWebpage(data) { * @param {Object} data */ export function shareMiniProgram(data) { + if (data.miniProgramType == null) { + data.miniProgramType = 0 + } return new Promise((resolve, reject) => { nativeShareMiniProgram(data); emitter.once('SendMessageToWX.Resp', resp => { diff --git a/ios/RCTWeChat.m b/ios/RCTWeChat.m index 24c983c..e92d230 100644 --- a/ios/RCTWeChat.m +++ b/ios/RCTWeChat.m @@ -389,7 +389,7 @@ RCT_EXPORT_METHOD(shareMiniProgram:(NSDictionary *)data object.hdImageData = [self compressImage: image toByte:131072]; } object.withShareTicket = data[@"withShareTicket"]; - object.miniProgramType = data[@"miniProgramType"] || WXMiniProgramTypeRelease; + object.miniProgramType = [data[@"miniProgramType"] integerValue]; WXMediaMessage *message = [WXMediaMessage message]; message.title = data[@"title"]; message.description = data[@"description"]; diff --git a/package.json b/package.json index 73b62b5..79c305e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-wechat-lib", - "version": "1.1.1", - "description": "react-native library for wechat app", + "version": "1.1.2", + "description": "react-native library for wechat app. 支持分享和拉起小程序。", "main": "index.js", "scripts": { "test": "echo 1"