Skip to content

Commit

Permalink
fix(Android): Fix registerApp param issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 1, 2020
1 parent f1d0bc8 commit 56ceded
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 向微信注册应用
* 必须先注册应用,在 Android 后面的调用才会起作用
* @param appid 通过微信开放平台,[获取appid](https://open.weixin.qq.com/)
* @param universalLink Universal Link(通用链接)是苹果在 iOS9 推出的,一种能够方便的通过传统 HTTPS 链接来启动 APP 的功能,可以使用相同的网址打开网址和 APP。
* @param universalLink 参数在 iOS 中有效,Universal Link(通用链接)是苹果在 iOS9 推出的,一种能够方便的通过传统 HTTPS 链接来启动 APP 的功能,可以使用相同的网址打开网址和 APP。
*/
export function registerApp(appid: string, universalLink: string): void;
/**
Expand Down
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { NativeModules } from 'react-native';
import { NativeModules, Platform } from 'react-native';

// const { RNWechat } = NativeModules;

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

0 comments on commit 56ceded

Please sign in to comment.