Skip to content

Commit 400b16f

Browse files
周颖飞suanmei
周颖飞
authored andcommitted
新增自定义是否只需要支持微博
1 parent 0b4e227 commit 400b16f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Diff for: README.md

+7
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ APP 的 App Store 地址,例: `https://itunes.apple.com/cn/app/id1383186862`
176176

177177
APP 的应用宝地址,例:`'//a.app.qq.com/o/simple.jsp?pkgname=com.youku.shortvideo'`。如果不填写,则安卓微信中会直接跳转 fallback
178178

179+
### isSupportWeibo
180+
181+
类型: `boolean`
182+
必填:
183+
默认值: false
184+
是否支持微博,默认不支持
185+
179186
### timeout
180187

181188
类型: `number`

Diff for: src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ class CallApp {
7979
if (typeof logFunc !== 'undefined') {
8080
logFunc('pending');
8181
}
82-
82+
const isSupportWeibo = !!this.options.isSupportWeibo;
8383
if (Browser.isIos) {
8484
// ios qq 禁止了 universalLink 唤起app,安卓不受影响 - 18年12月23日
8585
// ios qq 浏览器禁止了 universalLink - 19年5月1日
8686
// ios 微信自 7.0.5 版本放开了 Universal Link 的限制
8787
// ios 微博禁止了 universalLink
8888
if (
8989
(Browser.isWechat && Browser.semverCompare(Browser.getWeChatVersion(), '7.0.5') === -1) ||
90-
Browser.isWeibo
90+
(Browser.isWeibo && !isSupportWeibo)
9191
) {
9292
evokeByLocation(appstore);
9393
} else if (Browser.getIOSVersion() < 9) {
@@ -111,7 +111,7 @@ class CallApp {
111111
evokeByLocation(schemeURL);
112112
checkOpenFall = this.fallToFbUrl;
113113
}
114-
} else if (Browser.isWechat || Browser.isBaidu || Browser.isWeibo || Browser.isQzone) {
114+
} else if (Browser.isWechat || Browser.isBaidu || (Browser.isWeibo && !isSupportWeibo) || Browser.isQzone) {
115115
evokeByLocation(this.options.fallback);
116116
} else {
117117
evokeByIFrame(schemeURL);

Diff for: src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface CallappOptions {
2222
};
2323
appstore: string;
2424
yingyongbao?: string;
25+
isSupportWeibo?:boolean;
2526
fallback: string;
2627
timeout?: number;
2728
logFunc?: (status: 'pending' | 'failure') => void;

0 commit comments

Comments
 (0)