bradmartin/nativescript-advanced-webview

Not loading on iOS 15

iMarwan-k opened this issue · 7 comments

I installed the latest version of the plugin and it is not loading the URL on ios 15. I just get an empty page.

it works good with Android, but with ios it seems like it is just initializing the webview but not loading the URL

Simulator Screen Shot - iPhone 11 - 2021-11-30 at 17 36 45

I tired the following change in advanced-webview.ios.js and now it works

const app = UIApplication.sharedApplication; ctrl = app.keyWindow.rootViewController;

I have same issue. Works on a fresh install but doesn't work in my app. I have a lot of plugins, I suspect it's the delegate...

2022-03-17_14-50-05

SFSafariViewControllerDelegateImpl.initWithOwnerCallback method is works and that's it. Then the code does not work
@bradmartin

@Bezlepkin - what do you mean "that's it"? Removing it or something?

Removing it or something
works out only the method: initWithOwnerCallback (called AdvancedWebviewEvents.LoadStarted)

safariViewControllerDidCompleteInitialLoad method does not work.

Hi, anyone get to resolve the above issue?

Hi,
Yesterday i faced this problem the solution based on this post is to present SafariViewController from rootView.
So the code part in ts (in angular 15, and ns 8.4)

import { AdvancedWebViewOptions, openAdvancedUrl, NSAdvancedWebViewEventEmitter, AdvancedWebviewEvents } from 'nativescript-advanced-webview';
import { getRootView } from '@nativescript/core/application';

const opts: AdvancedWebViewOptions = {
      url: "<yourURL>",
      showTitle: true,
      toolbarColor: '#336699',
      toolbarControlsColor: '#fff',
      ios: {
        viewController: getRootView().viewController
      }

Good find @Silureth - I'm pushing a bug release of the plugin where the core does the root view controller, but I'll also merge your README PR and add a note that it's not 100% necessary with version x.x.x