From 3633cf614b315cc3919b118f45b192197273b9de Mon Sep 17 00:00:00 2001 From: snowfox Date: Wed, 6 Nov 2019 22:13:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E6=94=B9=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E6=8B=89=E8=B5=B7=20APP=20=E5=90=8E=E7=9A=84=20Res=20?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E5=8F=82=E6=95=B0=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20WeChatReq=20=E5=92=8C=20WeChatResp=20=E7=9A=84=20ts=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- index.d.ts | 16 ++++++++++++++++ ios/RCTWeChat.m | 2 +- package.json | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dc4bcf8..980b47e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ ## 安装 ```sh -$ npm install react-native-wechat-lib --save +npm install react-native-wechat-lib --save +react-native link react-native-wechat-lib ``` ## 起步 diff --git a/index.d.ts b/index.d.ts index e00de4c..bde08d0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -23,6 +23,22 @@ declare module "react-native-wechat-lib" { lang?: string; country?: string; } + export interface WeChatReq { + type?: string, + errStr?: string, + extMsg?: string, + country?: string, + state?: string, + returnKey?: string + } + export interface WeChatResp { + type?: string, + errStr?: string, + extMsg?: string, + country?: string, + state?: string, + returnKey?: string + } export function sendAuthRequest( scope: string | string[], state?: string diff --git a/ios/RCTWeChat.m b/ios/RCTWeChat.m index 1a9b07c..24c983c 100644 --- a/ios/RCTWeChat.m +++ b/ios/RCTWeChat.m @@ -467,7 +467,7 @@ RCT_EXPORT_METHOD(pay:(NSDictionary *)data body[@"type"] = @"LaunchFromWX.Req"; body[@"lang"] = launchReq.lang; body[@"country"] = launchReq.country; - body[@"appParameter"] = appParameter; + body[@"extMsg"] = appParameter; [self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventNameWeChatReq body:body]; } } diff --git a/package.json b/package.json index 53d5cda..73b62b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-wechat-lib", - "version": "1.1.0", + "version": "1.1.1", "description": "react-native library for wechat app", "main": "index.js", "scripts": {