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 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 */
88export function registerApp ( appid : string , universalLink : string ) : void ;
99/**
Original file line number Diff line number Diff line change 1- import { NativeModules } from 'react-native' ;
1+ import { NativeModules , Platform } from 'react-native' ;
22
33// const { RNWechat } = NativeModules;
44
55export 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 * 检查微信是否已被用户安装
You can’t perform that action at this time.
0 commit comments