Skip to content

Commit 56ceded

Browse files
committed
fix(Android): Fix registerApp param issue.
1 parent f1d0bc8 commit 56ceded

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* 向微信注册应用
44
* 必须先注册应用,在 Android 后面的调用才会起作用
55
* @param appid 通过微信开放平台,[获取appid](https://open.weixin.qq.com/)
6-
* @param universalLink Universal Link(通用链接)是苹果在 iOS9 推出的,一种能够方便的通过传统 HTTPS 链接来启动 APP 的功能,可以使用相同的网址打开网址和 APP。
6+
* @param universalLink 参数在 iOS 中有效,Universal Link(通用链接)是苹果在 iOS9 推出的,一种能够方便的通过传统 HTTPS 链接来启动 APP 的功能,可以使用相同的网址打开网址和 APP。
77
*/
88
export function registerApp(appid: string, universalLink: string): void;
99
/**

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
import { NativeModules } from 'react-native';
1+
import { NativeModules, Platform } from 'react-native';
22

33
// const { RNWechat } = NativeModules;
44

55
export default class Wechat {
66
/**
77
* 向微信注册应用
88
* @param appid 通过微信开放平台,[获取appid](https://open.weixin.qq.com/)
9-
* @param universalLink Universal Link(通用链接)是苹果在 iOS9 推出的,一种能够方便的通过传统 HTTPS 链接来启动 APP 的功能,可以使用相同的网址打开网址和 APP。
9+
* @param universalLink 参数在 iOS 中有效,Universal Link(通用链接)是苹果在 iOS9 推出的,一种能够方便的通过传统 HTTPS 链接来启动 APP 的功能,可以使用相同的网址打开网址和 APP。
1010
*/
1111
static registerApp(appid, universalLink) {
12-
return NativeModules.RNWechat.registerApp(appid, universalLink);
12+
if (Platform.OS === 'ios') {
13+
return NativeModules.RNWechat.registerApp(appid, universalLink);
14+
}
15+
if (Platform.OS === 'android') {
16+
return NativeModules.RNWechat.registerApp(appid);
17+
}
1318
}
1419
/**
1520
* 检查微信是否已被用户安装

0 commit comments

Comments
 (0)