nativescript-advanced-webview icon indicating copy to clipboard operation
nativescript-advanced-webview copied to clipboard

Not loading on iOS 15

Open iMarwan-k opened this issue 4 years ago • 4 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;

iMarwan-k avatar Nov 30 '21 23:11 iMarwan-k

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...

Bezlepkin avatar Mar 17 '22 10:03 Bezlepkin

2022-03-17_14-50-05

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

Bezlepkin avatar Mar 17 '22 11:03 Bezlepkin

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

bradmartin avatar Mar 17 '22 15:03 bradmartin

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

safariViewControllerDidCompleteInitialLoad method does not work.

Bezlepkin avatar Mar 17 '22 15:03 Bezlepkin

Hi, anyone get to resolve the above issue?

codemeall avatar Nov 28 '22 08:11 codemeall

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
      }

Silureth avatar Jan 31 '23 08:01 Silureth

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

bradmartin avatar Jan 31 '23 14:01 bradmartin