From 792455f19bd6d23a5481343e400270e08a21f4e7 Mon Sep 17 00:00:00 2001 From: ahasnawi <70672687+ahasnawi@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:25:02 +0300 Subject: [PATCH 1/6] support plugin inbound webview --- src/control/content/app.js | 41 +++++++++++------- src/control/content/index.html | 67 +++++++++++++++++++++-------- src/resources/external-browser.jpg | Bin 0 -> 12327 bytes src/resources/native-webview.jpg | Bin 0 -> 12452 bytes src/resources/popup-window.jpg | Bin 0 -> 12341 bytes src/widget/widget.js | 37 +++++++++------- 6 files changed, 97 insertions(+), 48 deletions(-) create mode 100644 src/resources/external-browser.jpg create mode 100644 src/resources/native-webview.jpg create mode 100644 src/resources/popup-window.jpg diff --git a/src/control/content/app.js b/src/control/content/app.js index 6c7bdce..5723fab 100644 --- a/src/control/content/app.js +++ b/src/control/content/app.js @@ -14,6 +14,11 @@ EXTERNAL_BROWSER: 'External browser' }; + $scope.viewSupType = { + IFRAME: 'iFrame', + NATIVE_WEBVIEW: 'Native webview' + }; + buildfire.datastore.get(function(err, result) { if (err) return console.error('Error: ', err); @@ -32,11 +37,17 @@ $scope.data.content.view = $scope.viewType.IN_APP_POPUP; } } + + // Backward compatibility: If viewType.NATIVE_IN_APP was selected before, default to viewSupType.IFRAME + if ($scope.data.content.view === $scope.viewType.NATIVE_IN_APP && !$scope.data.content.viewSupType) { + $scope.data.content.viewSupType = $scope.viewSupType.IFRAME; + } } else { $scope.data = { content: { url: '', - view: $scope.viewType.IN_APP_POPUP + view: $scope.viewType.IN_APP_POPUP, + viewSupType: null // Initialize viewSupType } }; } @@ -118,22 +129,22 @@ }; $scope.changeViewType = function() { - dataChanged = true; - - if ($scope.frmMain.$invalid) return; + dataChanged = true; + + if ($scope.frmMain.$invalid) return; - var data = $scope.data; + var data = $scope.data; - if (data.content.openInApp != undefined) { - data.content.openInApp = null; - } - buildfire.datastore.save(data, function(err, result) { - if (err || !result) { - $log.error('Error saving the widget details: ', err); - } else { - $log.info('Widget details saved'); - } - }); + if (data.content.openInApp != undefined) { + data.content.openInApp = null; + } + buildfire.datastore.save(data, function(err, result) { + if (err || !result) { + $log.error('Error saving the widget details: ', err); + } else { + $log.info('Widget details saved'); + } + }); }; $scope.openMethodChanged = function() { diff --git a/src/control/content/index.html b/src/control/content/index.html index 78945f5..4985691 100644 --- a/src/control/content/index.html +++ b/src/control/content/index.html @@ -24,6 +24,16 @@ color: var(--c-warning); background-color: var(--c-gray1); } + .notes { + padding: 12px 20px; + margin-top: 15px; + margin-bottom: 15px; + background: #F5F5F5; + } + .notes .bold { + font-weight: bold; + margin-top: 20px + }
- Some websites may not function properly in the in-feature WebView due to Apple's restrictions on cross-origin iframes, which can affect login and state management, or due to internal policies of certain sites like Google and Amazon that prevent them from being displayed in the app’s native component. If your web page does not appear or work as expected, we recommend using one of the alternative methods available. -
+Note 1: For the best user experience, link to
- mobile optimized content.
(Disclaimer: Some websites will show
- mobile version of site only on mobile devices.)
Note 2: If you are taking payments through - this web page, you must open the the URL outside of the app or the app - will get rejected by Apple in the submission review process.
- -Note 3: It is best to use secure websites (Https) some operating systems require it.
- -Hint: If you are taking payments, use your - app or content DeepLink URL to redirect back to the app after a payment - is made.
+pi>tGUka0xwNw+ >z&pgwV@eFX3$8%^zGqxb2GCpWFQGDgNgLmF%5~cw`C&YS;+}&0^oPu&!
zH2$zXRk>Q~9;61U^gyN5wDXtho!{*^qK@!J^msDUnR#@WkUD>HYPK4CX9dOWP)d9Q
z3}yMQs)5NpSx>}*>B`5Ej}W-d7dXHJEyPyDg?QE{!sR^M%zy7%nx4<&P-Q|VQiXC8
zHwrVMu0Dt3j75c##Ydn#oArB;J-P^SxqWn`jelq=%td))
5J{=u^raddES$-!0hH;sPc5sp9W-AP|iA0yY24CSuCJ6K!k9&ka8#*@`-X_
zB*Cpu-%V~7^^PC5=|i1Hn4;b}In~2|ux>638iw