@waxio/sdk-react-native
v0.3.0
Published
somthing
Downloads
16
Readme
Wax Mobile SDK enables developers to easily connect their dapps with the WaxCloudWallet Mobile.
🗃️ Table of Contents
React Native
📦 Installation
Install the SDK package.
npm install @waxio/sdk-react-nativeor
yarn add @waxio/sdk-react-native🧑💻 Usage
We recommend using React Native v0.71.4 or higher to avoid performance issues on Android.
See the React Native Example and read the documentation for using the SDK with React Native for more information.
First, set up your application to work with deep links across different platforms. Read the document.
Then Add mycloudwallet to LSApplicationQueriesSchemes in your Info.plist and AndroidManifest.xml.
// ...
<key>LSApplicationQueriesSchemes</key>
<array>
<string>mycloudwallet</string>
</array> //...
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mycloudwallet" android:host="*" />
</intent>
</queries>Wrap your application in the provider
import { WaxDeeplinkProvider } from '@waxio/sdk-react-native';
export default function RootLayout() {
return (
//...
<WaxDeeplinkProvider
opts={{ pollingInterval: 2000 }}
metadata={{
name: 'DappExample',
origin: 'dappexample',
description: 'This is test dapp example',
scheme: 'dappexample',
icon: 'https://example.com/200/300',
}}
activationEndpoint="..."
relayEndpoint="..."
relayRegion="..."
>
...
</WaxDeeplinkProvider>
);
}Use the SDK in your components:
import { useWaxSDK } from '@waxio/sdk-react-native';
// ...
const { connect, disconnect, transact, user } = useWaxSDK();💎 Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
