fix(Android): Fix registerApp param issue.
This commit is contained in:
2
index.d.ts
vendored
2
index.d.ts
vendored
@@ -3,7 +3,7 @@
|
|||||||
* 向微信注册应用
|
* 向微信注册应用
|
||||||
* 必须先注册应用,在 Android 后面的调用才会起作用
|
* 必须先注册应用,在 Android 后面的调用才会起作用
|
||||||
* @param appid 通过微信开放平台,[获取appid](https://open.weixin.qq.com/)
|
* @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;
|
export function registerApp(appid: string, universalLink: string): void;
|
||||||
/**
|
/**
|
||||||
|
11
index.js
11
index.js
@@ -1,4 +1,4 @@
|
|||||||
import { NativeModules } from 'react-native';
|
import { NativeModules, Platform } from 'react-native';
|
||||||
|
|
||||||
// const { RNWechat } = NativeModules;
|
// const { RNWechat } = NativeModules;
|
||||||
|
|
||||||
@@ -6,10 +6,15 @@ export default class Wechat {
|
|||||||
/**
|
/**
|
||||||
* 向微信注册应用
|
* 向微信注册应用
|
||||||
* @param appid 通过微信开放平台,[获取appid](https://open.weixin.qq.com/)
|
* @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) {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 检查微信是否已被用户安装
|
* 检查微信是否已被用户安装
|
||||||
|
Reference in New Issue
Block a user