bradmartin / nativescript-advanced-webview

NativeScript plugin for Chrome CustomTabs on Android and SafariViewController on iOS.
Other
60 stars 28 forks source link

Not loading on iOS 15 #56

Closed iMarwan-k closed 1 year ago

iMarwan-k commented 2 years ago

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;

Bezlepkin commented 2 years ago

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 commented 2 years ago

2022-03-17_14-50-05

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

bradmartin commented 2 years ago

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

Bezlepkin commented 2 years ago

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

safariViewControllerDidCompleteInitialLoad method does not work.

codemeall commented 1 year ago

Hi, anyone get to resolve the above issue?

Silureth commented 1 year ago

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
      }
bradmartin commented 1 year ago

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