diff --git a/ios/Nativebrik/Classes/component.swift b/ios/Nativebrik/Classes/component.swift index 8d92dbe..c38751f 100644 --- a/ios/Nativebrik/Classes/component.swift +++ b/ios/Nativebrik/Classes/component.swift @@ -14,7 +14,10 @@ import SafariServices class ModalComponentViewController: UIViewController { private var currentModal: NavigationViewControlller? = nil - func presentWebview(url: String) { + func presentWebview(url: String?) { + guard let url = url else { + return + } guard let urlObj = URL(string: url) else { return } diff --git a/ios/Nativebrik/Classes/root.swift b/ios/Nativebrik/Classes/root.swift index 6c45f42..5de2c07 100644 --- a/ios/Nativebrik/Classes/root.swift +++ b/ios/Nativebrik/Classes/root.swift @@ -73,8 +73,9 @@ class ModalRootViewController: UIViewController { return } + // when it's webview modal if page?.data?.kind == PageKind.WEBVIEW_MODAL { - self.modalViewController?.presentWebview(url: page?.data?.webviewUrl ?? "https://nativebrik.com/intl/en/docs/reference/ios") + self.modalViewController?.presentWebview(url: page?.data?.webviewUrl) return } @@ -197,7 +198,7 @@ class RootView: UIView { // when it's webview modal if page?.data?.kind == PageKind.WEBVIEW_MODAL { - self.modalViewController?.presentWebview(url: page?.data?.webviewUrl ?? "https://nativebrik.com/intl/en/docs/reference/ios") + self.modalViewController?.presentWebview(url: page?.data?.webviewUrl) return }