From ebe76f23c0a58d872e4647266464ac07ede4d93a Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 25 May 2022 22:56:51 -0600 Subject: [PATCH] Disable sending crypto on iOS per App Store review guideline 3.1.5 --- www/assets/js/crypto.js | 24 ++++++++++++++++++++++++ www/pages/crypto_wallet.html | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/www/assets/js/crypto.js b/www/assets/js/crypto.js index a8fa73b..ec8a663 100644 --- a/www/assets/js/crypto.js +++ b/www/assets/js/crypto.js @@ -490,6 +490,30 @@ function showPaymentRequestQRCode() { } $("#app").on("click", "#sendCryptoOpenPopupBtn", function () { + if (platform_type == "cordova") { + if (cordova.platformId == "ios") { + app.dialog.create({ + title: "Switch to Web Version", + text: "Apple doesn't allow this feature on the App Store. Tap Continue to launch the web version of this app instead, which is allowed to send crypto. We're sorry for the inconvenience.", + buttons: [ + { + text: "Continue", + bold: true, + keyCodes: [13], + onClick: function () { + openExternalBrowser("https://app.helena.express/?startpage=crypto"); + } + }, + { + text: "Cancel", + color: "red" + } + ] + }).open(); + return; + } + } + app.popup.open("#sendCryptoPopup"); if (walletPubKeyRegex.test($("#walletAddress").text())) { setupFiatConversion($("#walletAddress").text()); } else { diff --git a/www/pages/crypto_wallet.html b/www/pages/crypto_wallet.html index 851ed83..830fb40 100644 --- a/www/pages/crypto_wallet.html +++ b/www/pages/crypto_wallet.html @@ -31,7 +31,7 @@
- +