mirror of
https://github.com/little-snow-fox/react-native-wechat-lib.git
synced 2025-12-06 15:26:49 +08:00
fix 修改小程序拉起 APP 后的 Res 回调参数,增加 WeChatReq 和 WeChatResp 的 ts 类型定义
This commit is contained in:
parent
ec1dd8d221
commit
3633cf614b
@ -26,7 +26,8 @@
|
|||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ npm install react-native-wechat-lib --save
|
npm install react-native-wechat-lib --save
|
||||||
|
react-native link react-native-wechat-lib
|
||||||
```
|
```
|
||||||
|
|
||||||
## 起步
|
## 起步
|
||||||
|
|||||||
16
index.d.ts
vendored
16
index.d.ts
vendored
@ -23,6 +23,22 @@ declare module "react-native-wechat-lib" {
|
|||||||
lang?: string;
|
lang?: string;
|
||||||
country?: 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(
|
export function sendAuthRequest(
|
||||||
scope: string | string[],
|
scope: string | string[],
|
||||||
state?: string
|
state?: string
|
||||||
|
|||||||
@ -467,7 +467,7 @@ RCT_EXPORT_METHOD(pay:(NSDictionary *)data
|
|||||||
body[@"type"] = @"LaunchFromWX.Req";
|
body[@"type"] = @"LaunchFromWX.Req";
|
||||||
body[@"lang"] = launchReq.lang;
|
body[@"lang"] = launchReq.lang;
|
||||||
body[@"country"] = launchReq.country;
|
body[@"country"] = launchReq.country;
|
||||||
body[@"appParameter"] = appParameter;
|
body[@"extMsg"] = appParameter;
|
||||||
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventNameWeChatReq body:body];
|
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventNameWeChatReq body:body];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-wechat-lib",
|
"name": "react-native-wechat-lib",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"description": "react-native library for wechat app",
|
"description": "react-native library for wechat app",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user