Giter Club home page Giter Club logo

cordova-plugin-ionic-webview's Introduction

semantic-release Dependabot Status npm

Ionic Web View for Cordova

A Web View plugin for Cordova, focused on providing the highest performance experience for Ionic apps (but can be used with any Cordova app).

This plugin uses WKWebView on iOS and the latest evergreen webview on Android. Additionally, this plugin makes it easy to use HTML5 style routing that web developers expect for building single-page apps.

Note: This repo and its documentation are for cordova-plugin-ionic-webview @ 5.x, which uses the new features that may not work with all apps. See Requirements and Migrating to 5.x.

2.x documentation can be found here.

📖 Documentation: https://beta.ionicframework.com/docs/building/webview

📣 Support/Questions? Please see our Support Page for general support questions. The issues on GitHub should be reserved for bug reports and feature requests.

💖 Want to contribute? Please see CONTRIBUTING.md.

Configuration

This plugin has several configuration options that can be set in config.xml.

Android and iOS Preferences

Preferences available for both iOS and Android

Hostname

<preference name="Hostname" value="app" />

Default value is localhost.

Example ionic://app on iOS, http://app on Android.

If you change it, you'll need to add a new allow-navigation entry in the config.xml for the configured url (i.e <allow-navigation href="http://app/*"/> if Hostname is set to app). This is only needed for the Android url when using http://, https:// or a custom scheme. All ionic:// urls are whitelisted by the plugin.

Android Preferences

Preferences only available Android platform

Scheme

<preference name="Scheme" value="https" />

Default value is http

Configures the Scheme the app uses to load the content.

ResolveServiceWorkerRequests

<preference name="ResolveServiceWorkerRequests" value="true" />

Default value is false

Enable to resolve requests made by Service Workers through the local server.

MixedContentMode

<preference name="MixedContentMode" value="2" />

Configures the WebView's behavior when an origin attempts to load a resource from a different origin.

Default value is 0 (MIXED_CONTENT_ALWAYS_ALLOW), which allows loading resources from other origins.

Other possible values are 1 (MIXED_CONTENT_NEVER_ALLOW) and 2 (MIXED_CONTENT_COMPATIBILITY_MODE)

Android documentation

iOS Preferences

Preferences only available for iOS platform

iosScheme

<preference name="iosScheme" value="httpsionic" />

Default value is ionic

Configures the Scheme the app uses to load the content.

Values like http, https or file are not valid and will use default value instead.

If you change it, you'll need to add a new allow-navigation entry in the config.xml for the configured scheme (i.e <allow-navigation href="httpsionic://*"/> if iosScheme is set to httpsionic).

WKSuspendInBackground

<preference name="WKSuspendInBackground" value="false" />

Default value is true (suspend).

Set to false to stop WKWebView suspending in background too eagerly.

KeyboardAppearanceDark

<preference name="KeyboardAppearanceDark" value="false" />

Whether to use a dark styled keyboard on iOS

ScrollEnabled

<preference name="ScrollEnabled" value="true" />

Ionic apps work better if the WKWebView is not scrollable, so the scroll is disabled by default, but can be enabled with this preference. This only affects the main ScrollView of the WKWebView, so only affects the body, not other scrollable components.

Plugin Requirements

  • Cordova CLI: 7.1.0+
  • iOS: iOS 11+ and cordova-ios 4+
  • Android: Android 5+ and cordova-android 6.4+

Migrating to 5.x

  1. Remove and re-add the Web View plugin:

    cordova plugin rm cordova-plugin-ionic-webview
    cordova plugin add cordova-plugin-ionic-webview@latest
    
  2. If using cordova-android < 9, make sure you have <preference name="android-minSdkVersion" value="21" /> in the config.xml as this version of the plugin only supports Android 5+ (SDK 21+). If using cordova-android >= 9 is not neccessary as cordova-android 9 only supports Android 5.1+ (SDK 22+)

  3. Since version 2, apps are served from HTTP on Android by default.

    • The default origin for requests from the Android WebView is http://localhost. If Hostname and Scheme preferences are set, then origin will be schemeValue://HostnameValue.
  4. Since version 3, apps are served from ionic:// scheme on iOS by default.

    • The default origin for requests from the iOS WebView is ionic://localhost. If Hostname and iosScheme preferences are set, then origin will be iosSchemeValue://HostnameValue.
  5. The WebView is not able to display images, videos or other files from file or content protocols or if it doesn't have protocol at all. For those cases use window.Ionic.WebView.convertFileSrc() to get the proper url.

  6. Replace any usages of window.Ionic.normalizeURL() and window.wkRewriteURL() with window.Ionic.WebView.convertFileSrc().

    • For Ionic Angular projects, there is an Ionic Native wrapper:

      npm install @ionic-native/ionic-webview@latest
      

cordova-plugin-ionic-webview's People

Contributors

alsorokin avatar audreyso avatar cjpearson avatar danbucholtz avatar dependabot-preview[bot] avatar filmaj avatar ghenry22 avatar imhoffd avatar ionitron avatar janpio avatar jcesarmobile avatar kelvinhokk avatar kesozjura avatar laidig avatar ltm avatar lucatorella avatar macdonst avatar manucorporat avatar matejkramny avatar mlynch avatar mr-anonymous avatar nikhilkh avatar niklasmerz avatar nphyatt avatar pablomaurer avatar robertohuertasm avatar shazron avatar spoxies avatar stevengill avatar troyanskiy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-ionic-webview's Issues

Incompatibility with code push: ngx-translate service not loaded + white screen on iPad

After uploading to the new WKWebview (https://ionicframework.com/docs/wkwebview/) I am experimenting an issue with the plugins ngx-translate and code-push.

When deploying the app with the cable connected to the iOS device (iPad with OX 9.3.5 / iPhone OX 11.0.3) everything goes fine (app works as expected).
However when I upload it to the apple store and it gets accepted (release) I experiment 2 different behaviors:

  • With the iPad iOS 9.3.5 the app does not load (white screen).
  • With the iPhone iOS 11.0.3 the app loads but all the labels (from ngx-translate) don't appear (only their tags not the values).

Do I miss something in the translateLoader? I need to get the files from ./assets/i18n/. It is something related with the CORS?

// TranslateModule: AoT requires an exported function for factories
export function createTranslateLoader(http: Http) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

I already removed iOS platform and added it again. Removed ng-modules and reinstalled.

My system info:

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 6.5.0 

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : ios 4.4.0
    Ionic Framework    : ionic-angular 3.6.1

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.0.0 
    Node       : v7.10.1
    npm        : 2.15.12 
    OS         : macOS Sierra
    Xcode      : Xcode 9.0 Build version 9A235 

Misc:

    backend : pro

my plugins

code-push 2.0.2-beta "CodePushAcquisition"
cordova-plugin-app-event 1.2.1 "Application Events"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-code-push 1.9.5-beta "CodePush"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-console 1.1.0 "Console"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-dialogs 1.3.3 "Notification"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-firebase 0.1.24 "Google Firebase Plugin"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
de.appplant.cordova.plugin.local-notification 0.8.5 "LocalNotification"
ionic-plugin-keyboard 2.2.1 "Keyboard"
onesignal-cordova-plugin 2.2.2 "OneSignal Push Notifications"

[UPDATE]: when I remove cordova-plugin-code-push the ngx-translate and the app on iPad works fine.

my code push code:

 private _codePushSync() {
    if (process.env.CORDOVA_APP === true)) {
      this._codePush.sync().subscribe((syncStatus: SyncStatus) => {
        if (syncStatus === SyncStatus.INSTALLING_UPDATE) {
          this._translateService
            .get('general.codePush.updating')
            .subscribe((updating: string) => {
              this._ngZone.run(() => {
                const loading = this._loadingController.create({ content: updating });
                loading.present();
              });
            });
        }
      });
    }
  }

App crashing on Ipad with 11.02 iOs.

My environment info:

cli packages: (/usr/local/lib/node_modules)


    @ionic/cli-utils  : 1.12.0

    ionic (Ionic CLI) : 3.12.0


global packages:


    cordova (Cordova CLI) : 7.0.1 


local packages:


    @ionic/app-scripts : 3.0.0

    Cordova Platforms  : ios 4.5.1

    Ionic Framework    : ionic-angular 3.7.1


System:


    Node  : v6.11.4

    npm   : 3.10.10 

    OS    : macOS Sierra

    Xcode : Xcode 9.0 Build version 9A235 


Misc:


    backend : pro

Error message:

2017-10-09 13:30:41.499515+0300 MyApp[543:363986] CDVWKWebViewEngine: trying to inject XHR polyfill

2017-10-09 13:30:41.891373+0300 MyApp[543:363986] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x1c01fc200> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _requiresUserActionForMediaPlayback.'

*** First throw call stack:

(0x1814e3d38 0x1809f8528 0x1814e3a00 0x181def780 0x101034b80 0x10116763c 0x101192fb0 0x1011926f8 0x101192b8c 0x1011902c0 0x101032428 0x18a8f3bfc 0x18a8f37d4 0x18a8fa39c 0x18a8f7608 0x18a967068 0x101194cc8 0x101032144 0x18a963050 0x18ab56898 0x18ab5b6e4 0x18ade9454 0x18b0b91f0 0x18ade90b8 0x18ade9928 0x18b5526e8 0x18b55258c 0x18b2ce9c0 0x18b463fc8 0x18b2ce870 0x18b0b8850 0x18ab59e28 0x18af5d6ec 0x183b85768 0x183b8e070 0x10164545c 0x101651b74 0x183bb9a04 0x183bb96a8 0x183bb9c44 0x18148c358 0x18148c2d8 0x18148bb60 0x181489738 0x1813aa2d8 0x18323bf84 0x18a957880 0x101032034 0x180ece56c)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb) 

Cookies Ignored on First Application Execution

When installing a fresh build of my application and attempting to log in, it fails because the authentication cookie sent by the server is never stored. Closing the application and re-launching fixes the issue. There is an identical issue for cordova-plugin-wkwebview-engine here. Is this one of the issues that has been / will be fixed in this fork, or is there a viable workaround at this time?

@ionic-native/file hangs when trying to save to application directory

Prior to using WKWebView, I was able to use the Cordova File plugin to write files, create directories, and check for files using the dataDirectory path of the File plugin. After I installed WKWebview, requests to writeFile began to hang. I don't receive a success or failure message, and I don't catch an exception, it just hangs.

Looking over other people's issues, it seems like WKWebView has an issue with file:// prefixes. The file plugin uses file:// for its dataDirectory constant. Using normalizeURL (a suggested fix) just prefixes my file path with localhost, which does not work on mobile devices.

What can I do to use the Cordova File plugin and save images to the application directory? Am I going about this incorrectly?

Saving files in application directory using localhost

At this point we know webview does not support file://

However, I need to persist images and pdfs in the application directory. Is it possible to access the application directory and/or save and open files when using WebView?

Cannot write images to file with plugin installed

At this point we know webview does not support file://

However, I need to persist images and pdfs in the application directory. Is it possible to access the application directory and/or save and open files when using WebView?

What are the directories we can access outside of www/ ?

Add option to allow GCDWebserver to run in background

I have an app that plays audio and fetches data when in the background, using the allowed background audio and background fetch processes.

I need to be able to access images and cover art for albums when playing music in the background so that they can be displayed on the lock screen and control center.

If GCDWebserver is stopped as soon as the app goes to the background then I cannot access these files which results in broken app behaviour.

There is an option available in GCDWebserver config to enable background operation, it just needs to be enabled, this could possibly be passed to the plugin on startup as an option runInBackground=true/false and be defaulted to false.

HTTP Proxy

It's not a bug, it's an enhancement.
To avoid that CORS requests it would be nice if the local web server could redirect some requests to another outside device (network) server, exact same way as we have on ionic proxy config when we do ionic serve.
I think that will be a really great enhancement of the plugin.
For example, we can specify in the config.xml some proxy tag which will be used by the server to redirect the requests.
<proxy src="/api" dst="https://api.my-server.com"/>
Which means that all request to http://localhost:8080/api will be redirected to https://api.my-server.com.

Since the requests are done on http (from webview point of view) (not https) the proxy server also should check set-cookie headers from the response in order to remove Secure parameter to make the cookies work.

I'm not an ObjectiveC programmer, so I can't really help on that (but I know swift as a beginner).

Anyway, I'm open to discussing the solution to implement proxying on the device.

App Fails to Launch with this Plugin Installed.

I am trying to use this plugin to fix an issue I am seeing in my Ionic app. Here is the issue thread I opened on the Ionic repo

With this plugin installed, I receive the following error in xcode when running on an iPhone 6s simulator.

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x6040001ef700> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _requiresUserActionForMediaPlayback.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001129151cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001118d8f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000112915119 -[NSException raise] + 9
3 Foundation 0x00000001112fb1e3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 *** 0x000000010c014bf6 __43+[APPBackgroundMode swizzleWKWebViewEngine]_block_invoke + 358
5 *** 0x000000010c1097d2 -[CDVWKWebViewEngine pluginInitialize] + 850
6 *** 0x000000010c13556b -[CDVViewController registerPlugin:withClassName:] + 315
7 *** 0x000000010c134c7c -[CDVViewController newCordovaViewWithFrame:] + 1404
8 *** 0x000000010c135182 -[CDVViewController createGapView] + 354
9 *** 0x000000010c1326d6 -[CDVViewController viewDidLoad] + 566
10 *** 0x000000010c013506 -[MainViewController viewDidLoad] + 54
11 UIKit 0x000000010e9b9d51 -[UIViewController loadViewIfRequired] + 1235
12 UIKit 0x000000010e9ba19e -[UIViewController view] + 27
13 UIKit 0x000000010e88dd17 -[UIWindow addRootViewControllerViewIfPossible] + 122
14 UIKit 0x000000010e88e41f -[UIWindow _setHidden:forced:] + 294
15 UIKit 0x000000010e8a12bf -[UIWindow makeKeyAndVisible] + 42
16 *** 0x000000010c136fc8 -[CDVAppDelegate application:didFinishLaunchingWithOptions:] + 776
17 *** 0x000000010c013287 -[AppDelegate application:didFinishLaunchingWithOptions:] + 199
18 UIKit 0x000000010e81335a -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 267
19 UIKit 0x000000010e814db7 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4105
20 UIKit 0x000000010e81a245 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
21 UIKit 0x000000010ebd5c6c __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
22 UIKit 0x000000010efa33ef +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
23 UIKit 0x000000010ebd5865 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
24 UIKit 0x000000010ebd60c3 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 668
25 UIKit 0x000000010f533c11 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
26 UIKit 0x000000010f533aca -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
27 UIKit 0x000000010f221b9c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 420
28 UIKit 0x000000010f41cc3e _performActionsWithDelayForTransitionContext + 100
29 UIKit 0x000000010f221998 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
30 UIKit 0x000000010efa2a4c -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
31 UIKit 0x000000010e818ac6 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
32 UIKit 0x000000010ede1523 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
33 FrontBoardServices 0x000000011a07b158 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
34 FrontBoardServices 0x000000011a083c4d __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
35 libdispatch.dylib 0x0000000113a1a43c _dispatch_client_callout + 8
36 libdispatch.dylib 0x0000000113a1faf4 _dispatch_block_invoke_direct + 592
37 FrontBoardServices 0x000000011a0af672 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
38 FrontBoardServices 0x000000011a0af328 -[FBSSerialQueue _performNext] + 464
39 FrontBoardServices 0x000000011a0af897 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
40 CoreFoundation 0x00000001128b82b1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
41 CoreFoundation 0x0000000112957d31 __CFRunLoopDoSource0 + 81
42 CoreFoundation 0x000000011289cc19 __CFRunLoopDoSources0 + 185
43 CoreFoundation 0x000000011289c1ff __CFRunLoopRun + 1279
44 CoreFoundation 0x000000011289ba89 CFRunLoopRunSpecific + 409
45 GraphicsServices 0x0000000116d0b9c6 GSEventRunModal + 62
46 UIKit 0x000000010e81bd30 UIApplicationMain + 159
47 *** 0x000000010c0131a1 main + 65
48 libdyld.dylib 0x0000000113a96d81 start + 1
49 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

use safari debugging No response

when i use safari debugging my ios app,safari no response。 so i already uncheck “Automatically Show Web Inspector for JSContexts”.

Cordova File Plugin only works after killing and restarting app

With WebView installed, the Cordova File Plugin hangs when I try to use writeFIle. It does not raise an exception, it does not log anything in .catch or .then, it just enters the method and never returns.
I am assuming this has to do with the file:// issue. I am trying to write to the application directory with locations like file:///var/mobile/Containers/Data/Application/D6326230-58CE-4776-8D38-DB495D1CD551/Library/NoCloud/downloaded-assets/d4f3fcc4-ec81-4634-900f-3f47e433f74c/

The part that is strange to me is that killing the app and restarting makes everything work exactly as expected. Looking at the logs, it does not seem like any of the data I am passing to these methods has changed at all.

Another wrinkle: the app will work fine on first download from the app store. However, if I use Ionic Deploy to push new Javascript, the app fails as described above. Upon killing the app and restarting after a Deploy, the app resumes to normal function.

Any ideas?

CORS Same-Origin problem

Hello,

I always have had installed the ordinary web view and not this one until now the "white status bar bug on iOS 11" appeared. This bug is fixed in this web view but now I run into same origin issues while trying to send Ajax requests to my server which is not local but listed on a web domain.

I whitelisted everything in my config.xml so this cannot be the problem.

Is there a bug in this web view?

use uiwebview in parallel

I use wkwebview with indexeddb for ios11. And wanted to use it also for ios9/10.

But Indexeddb in Ios9/ios10 doesn't work very well, therefore I use websql for these 2 ios versions. But obviously websql can't work with wkwebview, so also need to switch to uiwebview for those.

Question is in what way can I use wkwebview for ios11, and use uiwebview for ios9/10 within a single build?

Failed to install 'cordova-plugin-ionic-webview': TypeError: Invalid Version: undefined at new SemVer

When I run

ionic cordova plugin add cordova-plugin-ionic-webview --save

I get the following error:

[ERROR] An error occurred while running cordova plugin add cordova-plugin-ionic-webview --save (exit code 1):

    Installing "cordova-plugin-ionic-webview" for ios
    Failed to install 'cordova-plugin-ionic-webview': TypeError: Invalid Version: undefined
         at new SemVer
    (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/semver/semver.js:293:11)
         at Range.test
    (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/semver/semver.js:1036:15)
         at Function.satisfies
    (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/semver/semver.js:1085:16)
         at checkEngines
    (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:117:21)
         at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:315:16
         at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
         at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
         at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
         at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
         at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    Error: Invalid Version: undefined

Any idea why I might be getting this?

Per app VPN support

Hey guys,

We're trying to use this plugin over the standard Cordova based one for one of our corporate internal apps. These apps use iOS per-app VPN settings (https://blogs.vmware.com/euc/2017/04/vmware-airwatch-101-per-app-vpn.html) to connect to internal resources.
The unintended consequence is that it tries to route 'http://localhost:8080' over the tunnel, and fails.
Log from start up:

2017-10-27 10:49:45.773958+1100 MyApp[1080:347066] Apache Cordova native platform version 4.5.0 is starting.
2017-10-27 10:49:45.774990+1100 MyApp[1080:347066] Multi-tasking -> Device: YES, App: YES
2017-10-27 10:49:45.791655+1100 MyApp[1080:347066] CDVWKWebViewEngine: trying to inject XHR polyfill
2017-10-27 10:49:45.878184+1100 MyApp[1080:347066] CDVWKWebViewEngine will reload WKWebView if required on resume
2017-10-27 10:49:45.878321+1100 MyApp[1080:347066] Using Ionic WKWebView
2017-10-27 10:49:45.879179+1100 MyApp[1080:347066] [CDVTimer][console] 0.180006ms
2017-10-27 10:49:45.879478+1100 MyApp[1080:347066] [CDVTimer][handleopenurl] 0.135958ms
2017-10-27 10:49:45.883067+1100 MyApp[1080:347066] [CDVTimer][intentandnavigationfilter] 3.506005ms
2017-10-27 10:49:45.883273+1100 MyApp[1080:347066] [CDVTimer][gesturehandler] 0.120997ms
2017-10-27 10:49:45.897891+1100 MyApp[1080:347066] [CDVTimer][splashscreen] 14.567018ms
2017-10-27 10:49:45.906098+1100 MyApp[1080:347066] [CDVTimer][statusbar] 8.054018ms
2017-10-27 10:49:45.908837+1100 MyApp[1080:347066] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-10-27 10:49:45.909380+1100 MyApp[1080:347066] [MC] Filtering mail sheet accounts for bundle ID: ****, source account management: 1
2017-10-27 10:49:45.913228+1100 MyApp[1080:347066] [MC] Result: NO
2017-10-27 10:49:45.913339+1100 MyApp[1080:347066] [CDVTimer][socialsharing] 7.135987ms
2017-10-27 10:49:45.914745+1100 MyApp[1080:347066] [CDVTimer][keyboard] 1.254022ms
2017-10-27 10:49:45.914878+1100 MyApp[1080:347066] [CDVTimer][TotalPluginStartup] 35.980046ms
2017-10-27 10:50:46.967100+1100 MyApp[1080:347066] Failed to load webpage with error: The request timed out.

Any help or ideas would be greatly appreciated.

Thanks,
Daniel

EDIT: By changing 'http://localhost:8080/' to 'http://127.0.0.1:8080' in the config + source it allows me through and loads the page fine. Is it possible to make this change to your branch?

Response Header blocked

When I use this plugin, I cannot access the response header except for "content-type". I have a custom response header which I used for permission check.

I have control of server, and already set it allow all origin, does anyone of you know the possible reason? Thanks

POST request error with Ionic WebView

I receive next error when trying to POST request with Ionic WebView:
XMLHttpRequest cannot load https://domain.com/api/login/. Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true.

Code:

let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' });
let options = new RequestOptions({ headers: headers, withCredentials: true });
let seq = this.api.post('login/?v=2.0&get_photo', accountInfo, options).share();
...

api.ts:

import { Injectable } from '@angular/core';
import { Http, RequestOptions, URLSearchParams } from '@angular/http';
import 'rxjs/add/operator/map';

@Injectable()
export class Api {

...
  
  post(endpoint: string, body?: any, options?: RequestOptions) {
    let seq =  this.http.post(this.url + '/' + endpoint, body, options);
    ...
    return seq;
  }

}

If I remove withCredentials: true I receive 401 error code from API on next requests after login.

CORS issues when cordova-plugin-code-push is installed

As I was discussing in the Slack channel, I may have stumbled upon an issue with Microsoft's CodePush plugin cordova-plugin-code-push and this one. Whenever both plugins are installed, the following behavior occurs:

  • All network connections fail their Preflight check (CORS)
  • i18n fails to load strings out of its resource file

Remove the CodePush plugin and everything works fine. My end-point is set up to accept requests from http://localhost:8080. I have managed to get it to work on 2 out of 4 of my apps that hit the same end-point. However, the other two I haven't had as much luck. I've tried removing my iOS platform and re-addig it as well.

Ionic info
cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1 

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.1.1 browser 4.1.0 ios 4.4.0
Ionic Framework    : ionic-angular 3.7.0

System:

Android SDK Tools : 25.2.4
ios-deploy        : 1.9.2 
Node              : v8.6.0
npm               : 5.4.2 
OS                : macOS High Sierra
Xcode             : Xcode 9.0 Build version 9A235 

Misc:

backend : legacy

Other plugins installed:
code-push 2.0.1-beta "CodePushAcquisition"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-code-push 1.9.8-beta "CodePush"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-dialogs 1.3.3 "Notification"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-firebase 0.1.24 "Google Firebase Plugin"
cordova-plugin-geolocation 2.4.0 "Geolocation"
cordova-plugin-inappbrowser 1.5.0 "InAppBrowser"
cordova-plugin-ionic-webview 1.1.14 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 4.0.0 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.0 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-sqlite-storage 2.0.0 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-barcodescanner 6.0.8 "BarcodeScanner"

Upgrading webview preserving local storage (from cordova-plugin-wkwebview-engine to cordova-plugin-ionic-webview)

As for the title, preserving data in local storage is not working when upgrading from official cordova-pluginwkwebview-engine to this plugin. I'm not moving from UIwebView (this case is covered by https://github.com/MaKleSoft/cordova-plugin-migrate-localstorage), but from official Apache WkWebView to this one.

Moving data from localstorage to sqllite and then back to localstorage, with a "middle-release", is not an option (as is not a fix, but just a workaround not suitable for all users).

Is there a way to pass data saved in local storage from the previous official plugin to this one?
Thank you for your help!

The old format of this exec call has been removed (deprecated since 2.1)

When I try to run my app, I get this error: ERROR: Error loading deploy information. Error: The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, 'Service', 'action', [ arg1, arg2 ]);

That's apparently triggered by this sort of proxy: https://github.com/ionic-team/cordova-plugin-ionic-webview/blob/master/src/www/ios/ios-wkwebview-exec.js#L88

What is it ? Does it come from another plugin using cordova.exec wrong ? How can I debug this ?

Thanks

iOS run emulator doesn't drop cache after update installation

I update my app code (some .html/.ts files), but when I run on iOS emulator on a Mac, it is the old code which is used although all is ok when I make a "ionic serve -l".

My run command :
ionic cordova run ios -c --emulator --target="iPhone-6" --buildConfig build.json

I'll try to remove my git project on Mac local, then clone again, make a npm install, an iOS platform install...
and try fixes on https://www.developerinsider.in/clean-xcode-cache-quick-fix/

Nothing worked, I always see old cold.... I don't know if it's due to cordova-plugin-ionic-webview.

My ionic info:
`cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1
Gulp CLI              : CLI version 3.9.1 Local version 3.9.1

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : ios 4.5.1
Ionic Framework    : ionic-angular 3.7.1

System:

ios-deploy : 1.9.2
ios-sim    : 6.1.2
Node       : v6.11.4
npm        : 4.6.1
OS         : macOS High Sierra
Xcode      : Xcode 9.0 Build version 9A235`

and my ionic plugins:

  • cordova-android-support-gradle-release 1.1.1 "cordova-android-support-gradle-release"
    cordova-google-api-version 0.0.1 "cordova-google-api-version"
    cordova-plugin-add-swift-support 1.7.0 "AddSwiftSupport"
    cordova-plugin-app-event 1.2.1 "Application Events"
    cordova-plugin-app-version 0.1.9 "AppVersion"
    cordova-plugin-badge 0.8.3 "Badge"
    cordova-plugin-compat 1.2.0 "Compat"
    cordova-plugin-console 1.1.0 "Console"
    cordova-plugin-device 1.1.6 "Device"
    cordova-plugin-file 4.3.3 "File"
    cordova-plugin-file-opener2 2.0.19 "File Opener2"
    cordova-plugin-file-transfer 1.6.3 "File Transfer"
    cordova-plugin-firebase 0.1.24 "Google Firebase Plugin"
    cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
    cordova-plugin-ionic 1.1.9 "IonicCordova"
    cordova-plugin-ionic-webview 1.1.15 "cordova-plugin-ionic-webview"
    cordova-plugin-network-information 1.3.3 "Network Information"
    cordova-plugin-screen-orientation 2.0.2-dev "Screen Orientation"
    cordova-plugin-splashscreen 4.0.3 "Splashscreen"
    cordova-plugin-statusbar 2.2.3 "StatusBar"
    cordova-plugin-whitelist 1.3.2 "Whitelist"
    cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
    cordova.plugins.diagnostic 3.7.1 "Diagnostic"
    ionic-plugin-keyboard 2.2.1 "Keyboard"

WKWEBView Issue with ion-header

After I added the WKWebView to my app I get the ion-header issue below.

I posted the issue in the forums here and I completed what a community member suggested:

I started a brand new empty project with latest ionic version, copied the “src/” files to the new project and reinstalled the cordova plugins but the issue persists. I even removed ALL custom css styling from global variables.scss file and from each individual page.

Any other ideas?

wkwebview_issue_01

Is there any solution/workaround for opening sqlite DB on iOS 9?

I used @ionic-native/sqlite to handle my db in app.
But I can't open sqlite DB on iOS 9 when I changed the webview base from UIWebview to the ionic-WKWebview.
The same codes runs well on iOS 10 and above.
So I want to ask if there is any solution/workaround can let me open sqlite DB successful on iOS 9.

html table/ion-list scroll very slow

We’ve an html table in a page created using a ngFor. The scroll of this table it’s very slow in ipad mini 2/4 (no problems with android and iphone 6/7/7 plus) also with only 50 rows. Also the selection of the rows is very slow (we’ve a checkbox for each row, with or without click event).

More details here.

Bluetooth Barcode Scanner issues

Okay, this one is a bit strange. After installing this plugin, using a barcode scanner in any text input ends up with the keys firing in the wrong order.

AFAIK a bluetooth barcode scanner works just like keyboard, that quickly types the characters followed by a return. (I think this weird delay-behaviour also happens if you type quickly, something about the return key responding faster than the other keys?)

Basically, if you do this in a text area, you will notice that the characters are all there but that, there is a new line in the middle of the word rather than the end. This is reproducibly due to installing this plugin (removing fixes it, reinstalling breaks it again)

Does anyone have any ideas?

IOS 11, latest version of this plugin

Failed to load webpage with error: The network connection was lost.

I've followed the directions here: https://github.com/ionic-team/cordova-plugin-ionic-webview

But when I start debugging on an actual iOS11 device through XCode, the app splash screen loads, and in the XCode Debug area the last message I see is "Failed to load webpage with error: The network connection was lost."

How do I go about debugging/solving this?

I don't have this app publicly view-able on github, but here are the relevant parts of my config.xml:

....
<access allows-arbitrary-loads-in-media="true" allows-arbitrary-loads-in-web-content="true" origin="*" />
<allow-navigation href="http://localhost:8080/*" />
<allow-navigation href="http://localhost:0/*" />
<feature name="CDVWKWebViewEngine">
    <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<branch-config>
    <branch-key value="key_live_12345" />
    <uri-scheme value="my-scheme" />
    <link-domain value="my-website.com" />
    <link-domain value="my-website.app.link" />
    <ios-team-release value="ABCDE" />
    <ios-team-id value="ABCDE" />
    <host name="my-website.app.link" scheme="https" />
    <host name="my-website-alternate.app.link" scheme="https" />
    <android-prefix value="/WSuf" />
</branch-config>
<preference name="AndroidLaunchMode" value="singleTask" />
<preference name="AlternateContentSrc" value="http://localhost:0" />
<engine name="android" spec="^6.3.0" />
<engine name="ios" spec="^4.5.1" />
<plugin name="branch-cordova-sdk" spec="^2.6.14">
    <variable name="BRANCH_KEY" value="key_live_12345" />
    <variable name="URI_SCHEME" value="my-scheme" />
</plugin>
<plugin name="cordova-plugin-app-version" spec="^0.1.9" />
<plugin name="cordova-plugin-background-mode" spec="git+https://github.com/Wade-McDaniel/cordova-plugin-background-mode.git" />
<plugin name="cordova-plugin-device" spec="^1.1.6" />
<plugin name="cordova-plugin-dialogs" spec="^1.3.3" />
<plugin name="cordova-plugin-facebook" spec="^0.2.2">
    <variable name="FACEBOOK_DISPLAY_NAME" value="My FB App" />
    <variable name="FACEBOOK_APP_ID" value="12235" />
</plugin>
<plugin name="cordova-plugin-google-analytics" spec="^1.6.0" />
<plugin name="cordova-plugin-googleplus" spec="^5.1.1">
    <variable name="REVERSED_CLIENT_ID" value="com.googleusercontent.apps.12345" />
</plugin>
<plugin name="cordova-plugin-inappbrowser" spec="^1.5.0" />
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.14" />
<plugin name="cordova-plugin-media" spec="git+https://github.com/Wade-McDaniel/cordova-plugin-media.git" />
<plugin name="cordova-plugin-music-controls" spec="git+https://github.com/Wade-McDaniel/cordova-music-controls-plugin.git" />
<plugin name="cordova-plugin-network-information" spec="^1.3.3" />
<plugin name="cordova-plugin-screen-orientation" spec="^1.4.3" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-plugin-x-socialsharing" spec="^5.1.8" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
....

Here's the text from the Debug Area in XCode:

Apache Cordova native platform version 4.5.0 is starting.
Multi-tasking -> Device: YES, App: YES
CDVWKWebViewEngine: trying to inject XHR polyfill
[MC] Lazy loading NSBundle MobileCoreServices.framework
[MC] Loaded MobileCoreServices.framework
[MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
CDVWKWebViewEngine will reload WKWebView if required on resume
Using Ionic WKWebView
[CDVTimer][console] 0.176013ms
[CDVTimer][handleopenurl] 0.238001ms
[CDVTimer][intentandnavigationfilter] 3.488004ms
[CDVTimer][gesturehandler] 0.129044ms
[CDVTimer][branchsdk] 0.187993ms
[CDVTimer][cordovafacebook] 1.803994ms
[CDVTimer][googleplus] 0.118017ms
[CDVTimer][file] 3.505051ms
[CDVTimer][splashscreen] 70.317030ms
[CDVTimer][statusbar] 11.494994ms
[MC] Filtering mail sheet accounts for bundle ID: com.myapp.mobile, source account management: 1
[MC] Filtering mail sheet accounts for bundle ID: com.myapp.mobile, source account management: 1
[CDVTimer][socialsharing] 93.789041ms
[CDVTimer][keyboard] 2.359033ms
[CDVTimer][TotalPluginStartup] 189.309955ms
refreshPreferences: HangTracerEnabled: 0
refreshPreferences: HangTracerDuration: 500
refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
[MC] Reading from public effective user settings.
Failed to load webpage with error: The network connection was lost.

Thank you for your help!

Linker command failed xcode 8.3

HI ,

When i install plugin and try to run the app i get errror at linking sayin Apple Mac o linker failed.

Please app ass the development has got stuck due to this

Cross origin requests are only supported for HTTP

i get this error when i use ioinc-webview with ngx-translate

here's my code (in app.component.ts):

plt.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
if(plt.is("cordova")){
statusBar.styleLightContent();
splashScreen.hide();
translate.setDefaultLang('zh');
translate.get('manup.mandatory.title').subscribe(
value => {
console.log(value + 'x');
},err => {
console.log(err + 'xxx');
}
)
}
})
}

Never enforce CORS like UIWebView do

I'v read https://ionicframework.com/docs/wkwebview/#cors

Unfortunately there’s no API to disable this

But any chance to implement it? I see there is local http://localhost:8080 server which handles file:// URLs but there is no XHR polyfill for http(s) URLs. Is there any plan to implement iOS native proxy for all http(s) XHR on the same local webserver? The proxy will respond with access-control-request-headers and the CORS issue will be solved.

I made a simple proxy on nodejs, see the proxy http-proxy handler code below which solves the issue:

onProxyRes(proxyRes, req, res) {
    let allowedOrigin = false;
    if (req.headers.origin) {
        proxyRes.headers['access-control-allow-origin'] = '*';
        proxyRes.headers['access-control-allow-credentials'] = 'true';
        allowedOrigin = true;
    }
    if (req.headers['access-control-request-method']) {
        proxyRes.headers['access-control-allow-methods'] = req.headers['access-control-request-method'];
    }
    if (req.headers['access-control-request-headers']) {
        proxyRes.headers['access-control-allow-headers'] = req.headers['access-control-request-headers'];
    }
    if (allowedOrigin) {
        if (req.method === 'OPTIONS') {
            proxyRes.statusCode = 200;
        }
    }
}

Any chance to port it into the native part of cordova-plugin-ionic-webview ?

App fails to launch with Ionc WebView on iPad 2

I receive next error when run app on iPad 2 (iOS 9.3.5). All works on iPhone 5 Emulator (iOS 10.3):

2017-09-30 18:40:35.727 Dnevnik76[23115:4729599] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/9B2440D6-F313-4DF0-9B6D-13A6D63239BF/Library/Cookies/Cookies.binarycookies
2017-09-30 18:40:35.824 Dnevnik76[23115:4729599] Apache Cordova native platform version 4.4.0 is starting.
2017-09-30 18:40:35.827 Dnevnik76[23115:4729599] Multi-tasking -> Device: YES, App: YES
2017-09-30 18:40:35.870 Dnevnik76[23115:4729599] CDVWKWebViewEngine: trying to inject XHR polyfill
2017-09-30 18:40:35.884 Dnevnik76[23115:4729599] -[WKWebViewConfiguration setMediaTypesRequiringUserActionForPlayback:]: unrecognized selector sent to instance 0x14673c90
2017-09-30 18:40:35.885 Dnevnik76[23115:4729599] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WKWebViewConfiguration setMediaTypesRequiringUserActionForPlayback:]: unrecognized selector sent to instance 0x14673c90'
*** First throw call stack:
(0x2275f91b 0x21efae17 0x227652b5 0x22762ee1 0x2268e238 0x1403a7 0x14095f 0x29004d 0x28f75f 0x28fbfd 0x28d275 0xffd4b 0x26cdad8b 0x26cda971 0x26ce1639 0x26cdeb3d 0x26d53a5d 0x2918ef 0xffb21 0x26d4f785 0x26f772d1 0x26f7b285 0x26f8f83d 0x26f787b3 0x23e02c07 0x23e02ab9 0x23e02db9 0x22721dff 0x227219ed 0x2271fd5b 0x2266f229 0x2266f015 0x26d48c3d 0x26d43189 0xffa1b 0x22317873)
libc++abi.dylib: terminating with uncaught exception of type NSException

Environment:



    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : ios 4.4.0
    Ionic Framework    : ionic-angular 3.7.1

System:

    ios-deploy : 1.9.1 
    ios-sim    : 6.0.0 
    Node       : v6.11.0
    npm        : 3.10.10 
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b 

Misc:

    backend : legacy

Plugins:

cc.fovea.cordova.purchase 6.1.2 "Purchase"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-ionic-webview 1.1.8 "Ionic's WKWebView Engine"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 2.0.0 "PushPlugin"

how to clear http cache

My whole app content is from remote server

but when I update the remote resources and restart the app

the content is still old

how to clear

SSL Error when using self signed certificate

I'm submitting a...



[x ] Bug report 
[ ] Feature request

Current behavior

When I'm try to call API from self signed certificate HTTPS server, the webview response error, therefore I can't retrieve the data.
I'm also try this solution, but it didn't work https://stackoverflow.com/questions/46777758/how-to-bypass-ssl-check-in-ios-11-using-ionic-cordova-framework-and-self-signed

Expected behavior

Could you please guide me how to bypass the ssl error, I need to build app for client testing.

Thank you!

Input issues on select fields

Hello there!

Thank you for this awesome plugin!

A problem i'm facing with this plugin, is that ever since i installed it, our webview's input elements don't work anymore on the phone. You can choose from the dropdown list iPhone style, but your selection will not be saved. Is there a workaround for this problem? Our project is a Cordova based project in webview. Everthing is up to date, and the application is running on ios 11 @update: I figured that the selection you make is applied to the next element you click. So if there are 2 inputs and you select option #2, then click on the other input field it's selection will go to #2.

Feature Request: Make the local server port configurable

8080 is a very common port used in development environments. In our case, our server-side uses localhost:8080 in development. This conflicts with ios emulators. It would be nice to be able to configure the port of the local server for this plugin in config.xml

env(safe-area-inset-top) / constant(safe-area-inset-top) reporting 0 on iPhone X

I'm trying to add iPhone X Support to my app. I updated all ionic and cordova packages and plugins, including the ionic-webview. I added viewport-fit=cover to the meta tag.

However, I fail at getting the iPhone X to respect its safe areas now. The top notch is always covering my content.
I tried it with standard Pages which contain headers, which actually have several references to env(safe-area-inset-top) / constant(safe-area-inset-top), but also tried my custom in game screens with this constants added as padding. However, the app always behaves as if the values where 0. Adding manual padding would work (but influence other devices, for sure). But adding env(safe-area-inset-top) / constant(safe-area-inset-top) does not work, it just shows like padding:0;.

As far as I have read the webview should be supporting this, but I fail at getting it to work. I'm trying this in iPhone X simulator, iOS 11.1.

Any ideas?

> ionic info
cli packages: (/usr/local/lib/node_modules)
    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0
global packages:
    cordova (Cordova CLI) : 7.1.0 
local packages:
    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android ios 4.5.2
    Ionic Framework    : ionic-angular 3.9.2
System:
    ios-deploy : 1.9.1 
    ios-sim    : 5.0.13 
    Node       : v6.10.3
    npm        : 3.10.10 
    OS         : macOS Sierra
    Xcode      : Xcode 9.1 Build version 9B55 
Environment Variables:
    ANDROID_HOME : not set
Misc:
    backend : pro

not able to start the project after WKWebView upgrade

Hi Team

After upgrading my project to WKWebView in IOS. App is not running in emulator and it's throwing the below exception continuously and crashing.

Sep 27 16:32:20 223-25-233-119 SpringBoard[17647]: objc[17647]: Class PLBuildVersion is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x11c869cc0) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x11c6806f0). One of the two will be used. Which one is undefined.
Sep 27 16:32:20 223-25-233-119 SpringBoard[17647]: [com.apple.springboard] Bootstrap complete with label: com.apple.SpringBoard
Sep 27 16:32:20 223-25-233-119 backboardd[17465]: [Orientation] No accelerometer; not detecting orientation!
Sep 27 16:32:20 223-25-233-119 assertiond[17469]: client <BSProcessHandle: 0x7fe38ff0b3f0; SpringBoard:17647; valid: YES> HWM increased to 1 because of <BKProcessAssertion: 0x7fe38fd06960; "FBSystemApp" (continuous:inf); id:…A0E26BF8F351>
Sep 27 16:32:20 223-25-233-119 assertiond[17469]: Process already exists for com.apple.springboard; adding additional client <BKProcessInfoServerClient: 0x7fe38fd037b0; pid: 17647>
Sep 27 16:32:20 223-25-233-119 SpringBoard[17647]: [com.apple.springboard] Bootstrap complete with label: com.apple.SpringBoard
Sep 27 16:32:20 223-25-233-119 SpringBoard[17647]: [Common] Unable to bootstrap_look_up port with name com.apple.springboard.gsEvents: unknown error code (1102)
Sep 27 16:32:20 223-25-233-119 assertiond[17469]: client <BSProcessHandle: 0x7fe38ff0b3f0; SpringBoard:17647; valid: YES> HWM increased to 2 because of <BKProcessAssertion: 0x7fe38fc0c7b0; "UIApplicationLaunch" (activation:inf); id:…17ECC3BEBAE3>
Sep 27 16:32:20 223-25-233-119 SpringBoard[17647]: assertion failed: 16G29 14E8301: libxpc.dylib + 64131 [624BAF4F-2E03-34F8-ACBA-970B04637786]: 0x7d
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryCommCenterMigration is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b1e48) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124810fa8). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryDeviceUnlocked is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b1fd8) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811138). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryDatabaseMigration is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b1ee8) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811228). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryDeleteAll is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b1f88) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811318). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryCallAddedBeforeUnlock is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b1df8) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x1248113b8). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryGizmoBootstrap is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b20c8) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811638). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryDatabaseSaveError is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b1f38) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x1248116d8). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryUninitializedDatabaseSave is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b2348) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811728). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryMissingCloudChangeToken is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b21b8) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x1248118b8). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryDatabaseInfo is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b1e98) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811908). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryTransactionLogSize is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b22f8) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811a48). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistorySyncOverLimit is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b22a8) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811ae8). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistorySync is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b2258) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811b38). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryErrorReport is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b2078) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811bd8). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryEntitlementRejection is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b2028) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811c28). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryGizmoDatabaseMigrationFailure is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b2118) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811d18). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryNilUuid is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b2208) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811d68). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class AWDCallHistoryMalformedCloudChangeToken is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAWDSupportFramework.dylib (0x10f2b2168) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CallHistory.framework/CallHistory (0x124811e08). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: objc[17647]: Class VCWeakObjectHolder is implemented in both /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/GameKitServices.framework/Frameworks/ViceroyTrace.framework/ViceroyTrace (0x12523dca8) and /Applications/Xcode8.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/GameKitServices.framework/Frameworks/AVConference.framework/AVConference (0x124df7cd0). One of the two will be used. Which one is undefined.
Sep 27 16:32:21 223-25-233-119 assertiond[17469]: client <BSProcessHandle: 0x7fe38ff0b3f0; SpringBoard:17647; valid: YES> HWM increased to 3 because of <BKProcessAssertion: 0x7fe38fc03240; "Resume" (activation:inf); id:…39A94DBD7F7A>
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: Simulator user has requested new graphics quality: 100
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: libMobileGestalt MobileGestalt.c:870: still-camera is static and will never generate a notification
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: libMobileGestalt MobileGestalt.c:870: stand-alone-contacts is static and will never generate a notification
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: libMobileGestalt MobileGestalt.c:870: watch-companion is static and will never generate a notification
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: libMobileGestalt utility.c:416: no value found for key 1129071431
Sep 27 16:32:21 223-25-233-119 SpringBoard[17647]: libMobileGestalt utility.c:416: no value found for key 1129072723
Sep 27 16:32:21 223-25-233-119 com.apple.CoreSimulator.SimDevice.C2D325B5-B9CA-4440-942C-9A95AF864DF0.launchd_sim[17447] (com.apple.SpringBoard): Service only ran for 0 seconds. Pushing respawn out by 5 seconds.
Sep 27 16:32:21 223-25-233-119 backboardd[17465]: [Orientation] Orientation blocking: timeout exceeded!

Scrolling / menu issues with WKWebView

https://www.youtube.com/watch?v=K_vBD6IJdpE

List of issues visible in this video, with time references:

0:05 - While the menu is open, the content view can be scrolled, then once the scroll has completed (0:11), it locks down and can no longer be scrolled.

0:12 - Some odd behavior with swipe gesture. The menu doesn't initially follow the swipe (presumably because the user was swiping up, first). It then, however, recognizes the swipe after the user has released the screen, and snaps closed.

0:20 - The content view can be scrolled, again. Once scrolled, it stops being scrollable (as it should be from the start (0:22))

WKWebView is definitely an improvement for this behavior, since prior to upgrading, the content view was always scrollable while the menu was open, and now it's just sometimes scrollable, but still not quite right.

Thoughts? Thanks.

How to delete the file route in localhost?

when I build my ios app,it doesn't work,always tell that Failed to load resource: the server responded with a status of 404 (Not Found)
I check the console,this plugin add the device route back to the localhost,like this:
http://localhost:8080/Users/frontend/Library/Developer/CoreSimulator/Devices/2A8048D2-3545-4C52-842D-8920D46AABA3/data/Containers/Bundle/Application/5B2B8379-6F86-4D23-8CA5-F4FABE05A51A/xxxx.app/www/test/api/app/index/login?t=1512186355174,so I can't request any API of my APP.
So,can you tell me how to solve it?

Error causing tabs to display white screen

when I run an Ionic 3 project on the simulator using --livereload param I get an uncaught error.

Error: The old format of this exec call has been removed (deprecated since 2.1). Change to cordova.exec(null, null, 'Service', 'action', [arg1, arg2]); ......

It's making some tabs not display

Ionic1 fails on ionic cordova build ios

When I install the plugin and try to build the build fails w/ the error msg
no visible @interface for 'NSData' declares the selector 'appendData:'
cordova-plugin-ionic-webview/GCDWebServerDataRequest.m:59:10
[_data appendData:data];

However, if I open the xCode project in the ios platform folder the app builds and deploys successfully. I am using the following versions...

cordova-plugin-ionic-webview 1.1.6
ios 4.5.3
ionic 1.3.4
ionic-cli 3.16.0
cordova 7.1.0
npm 5.5.1
node v6.10.0

Upgrading webview and local storage

From my understanding, it seems since UIWebView and WKWebview are different environments, local storage is not preserved when switching from one webview to another.

This would be ok for apps not yet in production, but for apps that already have thousands of customers, this is a huge compromise. This means that any customer rolling over to the new webview would lose their local storage data and hence lose their settings and login data.

Would there be a way to smoothly transition by transferring local storage data from the old webview to the new, or would my users be forced to go back to a blank slate as they update their app?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.