Skip to content

NativeScript plugin for Chrome CustomTabs on Android and SafariViewController on iOS.

License

Notifications You must be signed in to change notification settings

EddyVerbruggen/nativescript-advanced-webview

 
 

Repository files navigation

npm npm

NativeScript-Advanced-Webview

An advanced webview using Chrome Custom Tabs on Android and SFSafariViewController on iOS.

Here is a video showing off Chrome CustomTabs in NativeScript.

Perf Matters

Android Comparison

Android

CustomTabs

iOS

SFSafariViewController

Demo

Android iOS
Android Sample iOS Sample

Installation

To install execute

tns plugin add nativescript-advanced-webview

Example

TypeScript

import { openAdvancedUrl, AdvancedWebViewOptions } from 'nativescript-advanced-webview';
    //// or
import * as AdvancedWebView from 'nativescript-advanced-webview'

public whateverYouLike() {
    
    let opts: AdvancedWebViewOptions = {
        url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
        toolbarColor: '#ff4081',
        toolbarControlsColor: '#333', // iOS only
        showTitle: false // Android only
    };
    
    openAdvancedUrl(opts);
}

API

  • openAdvancedUrl(options: AdvancedWebViewOptions)
AdvancedWebViewOptions Properties
  • url: string
  • toolbarColor: string
  • toolbarControlsColor: string - ** iOS only **
  • showTitle: boolean - ** Android only **

About

NativeScript plugin for Chrome CustomTabs on Android and SafariViewController on iOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%