Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iPad Pro support #42

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ function deepLink(options) {
var androidPackageName = options.android_package_name;
var playStoreLink =
'https://market.android.com/details?id=' + androidPackageName;
var ua = window.navigator.userAgent;
var navigator = window.navigator;
var ua = navigator.userAgent;

// split the first :// from the url string
var split = url.split(/:\/\/(.+)/);
Expand All @@ -32,7 +33,13 @@ function deepLink(options) {
return /Android/i.test(ua);
},
ios: function () {
return /iPhone|iPad|iPod/i.test(ua);
if (/iPad|iPhone|iPod/.test(ua)) {
return true;
} else {
return navigator.maxTouchPoints &&
navigator.maxTouchPoints > 2 &&
/Macintosh/.test(ua);
}
},
};

Expand All @@ -49,7 +56,7 @@ function deepLink(options) {
document.location = url;
setTimeout(function () {
document.location = fallback;
}, 250);
}, 2500);
Copy link
Owner

@mderazon mderazon Mar 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to increas it ?
The page is basically empty with hardly any code / html in it so it should be loaded instantly
2.5 sec is noticable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am facing the same issue as #27.
in my case, app usually takes approx 1.5 sec to load.
When I open the app, it immediately redirects me to the app store. so I add some time to the app gets load perfectly

}

function launchIframeApproach(url, fallback) {
Expand All @@ -75,7 +82,7 @@ function deepLink(options) {
// chrome and safari on ios >= 9 don't allow the iframe approach
if (
ua.match(/CriOS/) ||
(ua.match(/Safari/) && ua.match(/Version\/(9|10|11|12)/))
(ua.match(/Safari/) && ua.match(/Version\/(9|10|11|12|13|14|15)/))
) {
launchWekitApproach(urls.deepLink, urls.iosStoreLink || urls.fallback);
} else {
Expand Down