Secures <WebView />
UI component provided by [email protected] and allows to access to private/corporate network resources through BlackBerry Dynamics SDK. The JavaScript API remains unchanged.
NOTE: on Android
BBWebView
library is used under the hood.
- iOS
- Android
- 0.66.x (deprecated)
- 0.67.x (deprecated)
- 0.68.x (deprecated)
- 0.69.x (deprecated)
- 0.70.x
- 0.71.x
- 0.72.x
- HTTP redirection
- File upload
- Secured cookies storage
- Page resource and content loading
- MTD Safe browsing
- DLP (secure cut/copy/paste) within WebView
- Browsing history -
GoBack
,GoForward
,Reload
andStopLoading
API
- AutoZSO
- File download
- New architecture (fabric)
- HTTP authentication (Basic, Digest, NTLM, Kerberos, Client Cert)
- URL schemes
mailto:
,geo:
,tel:
- Secured HTTP cache
- WebSocket
- WebWorker
- SSO
BlackBerry-Dynamics-for-React-Native-WebView
is dependent on BlackBerry-Dynamics-for-React-Native-Base
module, so please install required modules first.
$ yarn add <path>/ui-components/BlackBerry-Dynamics-for-React-Native-WebView
$ cd ios
$ pod install
$ cd ..
$ react-native run-ios
$ react-native run-android
Import the WebView
component from BlackBerry-Dynamics-for-React-Native-WebView
and use it like so:
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { WebView } from 'BlackBerry-Dynamics-for-React-Native-WebView';
// ...
class MyWebComponent extends Component {
// ...
webView = {
canGoBack: false,
canGoForward: false,
ref: null
}
// ...
render() {
return <WebView source={{ uri: 'https://reactnative.dev/' }} />;
}
}
// ...
import FS from 'BlackBerry-Dynamics-for-React-Native-FileSystem';
// ...
// add this handler on button click
async openDownloadsFolder() {
// programatically open Downloads screen
this.webView.ref.openDownloadsFolder();
// get path to secure Download folder within secure container
const bbDownloadsFolderPath = await this.webView.ref.getDownloadsDirectoryPath();
// read downloaded files using FS module
const bbDownloadsFolder = await FS.readDir(bbDownloadsFolderPath);
bbDownloadsFolder.map(item => {
console.log('Downloaded file:\n');
console.log(item);
console.log('\n');
});
}
For more, read the API Reference and Guide of original WebView
component.
$ cd <appFolder>
$ yarn remove BlackBerry-Dynamics-for-React-Native-WebView
$ cd ios
$ pod install
$ cd ..