1.0.0-beta.3 • Published 2 years ago
@transak/web-view v1.0.0-beta.3
Transak WebView
An SDK for react native integration of Transak widget.
Wrapped over webview(react-native-webview
), it provides option to listen to order events.
Using this you get Google Pay integrated by default.
Installation and usage
yarn add @transak/web-view
Install these required peer dependencies to facilitate auto-linking (If not already part of your app)
yarn add react-native-webview react-native-inappbrowser-reborn @react-native-community/netinfo
Then use it in your app:
import TransakWebView from '@transak/web-view';
function TransakReactNativeIntegration() {
return (
<TransakWebView
config={{
apiKey: '<your-api-key>',
environment: '<environment: STAGING/PRODUCTION>',
}}
onTransakEventHandler={(event, data) => console.log(event, data)}
/>
);
};
Props
The component accepts all the valid props for react-native-webview except the following: injectJavaScript, sharedCookiesEnabled, injectedJavaScript, injectedJavaScriptBeforeContentLoaded
Prop | Description |
---|---|
config | Refer here for a full list of valid options |
onTransakEventHandler | Accepts callback function to listen to order related events |
License
MIT Licensed. Copyright (c) Transak Inc. 2022.