File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 3
3
* 向微信注册应用
4
4
* 必须先注册应用,在 Android 后面的调用才会起作用
5
5
* @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。
7
7
*/
8
8
export function registerApp ( appid : string , universalLink : string ) : void ;
9
9
/**
Original file line number Diff line number Diff line change 1
- import { NativeModules } from 'react-native' ;
1
+ import { NativeModules , Platform } from 'react-native' ;
2
2
3
3
// const { RNWechat } = NativeModules;
4
4
5
5
export default class Wechat {
6
6
/**
7
7
* 向微信注册应用
8
8
* @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。
10
10
*/
11
11
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
+ }
13
18
}
14
19
/**
15
20
* 检查微信是否已被用户安装
You can’t perform that action at this time.
0 commit comments