Pokoapp.xyz
  • Overview
    • πŸ› οΈWhat we do
    • 😎Our vision
    • πŸ“ŒKey products
    • πŸ€–Getting help & support
    • πŸ‘‹Meet our team
  • Onramp Aggregator
    • What is Onramp Aggregator
    • Getting Started
    • Why use Onramp Aggregator
    • Onramp Aggregator dashboard
    • SDK integration & documentation
      • Web integration
        • Parameters
        • Redirect integration
        • Iframe integration
        • Customized integration
        • Theme customization
        • Quote API
        • URL signature
      • Mobile integration
        • Android native
        • Poko SDK for React Native
      • Dashboard API
      • Check availability of pairs API
      • Deployment examples
      • Support for integration
    • Dashboard
    • Testing guideline
    • Token coverage
    • Country & payment method coverage
    • Pricing
    • FAQs
  • Direct Checkout
    • What is Direct Checkout
    • Why use Direct Checkout
    • Integration
      • NFT Checkout & Defi
      • Wallet
        • Whitelist Endpoints
      • Setup Widget
      • Off-chain integration
    • Dashboard
    • Testing guideline
    • Country & payment method coverage
    • Pricing
    • KYC
  • Coverage
    • πŸ–‡οΈToken coverage
    • 🌎Country & payment method coverage
    • πŸ“‹Request token & country coverage
  • Other resources
    • Readings about payments
Powered by GitBook
On this page
  1. Onramp Aggregator
  2. SDK integration & documentation
  3. Mobile integration

Poko SDK for React Native

Parameters

Name
Required
Data type
Description

fiat

false

string

Fiat currency (USD, VND,..)

crypto

false

string

Follow this format: SYMBOL-network (eg: ETH-ethereum, USDT-bsc,..)

fiatAmount

false

number

Fiat amount. fiatAmount is prioritized over cryptoAmount

cryptoAmount

false

number

Crypto amount

strictMode

false

boolean

Do/Don’t allow user to change fiat/crypto

receiveWalletAddress

false

string

Receiving wallet address. If not provided, user will be asked to input wallet address

fiatList

false

string

Whitelist a list of fiat currencies to be displayed, separated by comma (VND,USD,AUD,..). Otherwise all supported fiat currencies will be displayed

cryptoList

false

string

Whitelist a list of cryptocurrencies to be displayed, separated by comma (ETH-ethereum,USDT-bsc,..). Otherwise all supported crypto will be displayed

excludeProviderIds

false

string

List of providers to be disabled. Supported providers are: transak, xanpool, onmeta, loopipay, fiahub, chainverse, payfura, onramp_money, transfi, moonpay, localram, sardine

signature

false

string

providerId

false

string

To open directly that provider instead of Poko's first screen

paymentMethodId

false

string

Use along with providerId.

Installation

npm install @pokopayment/react-native-sdk

The SDK needs 2 other packages to work correctly, follow these command to install them:

npm install react-native-webview

npm install react-native-permissions

  • Android

Add this line to the AndroidManifest.xml

<uses-permission android:name="android.permission.CAMERA" />
  • iOS:

Install pod-install: npm install -D pod-install

Update your package.json

  "scripts": {
    ....
    "postinstall": "react-native setup-ios-permissions && pod-install"
  },
  "reactNativePermissionsIOS": [
    "Camera"
  ]

Then update your Info.plist with wanted permissions usage descriptions:json

  <key>NSCameraUsageDescription</key>
  <string>Some providers would need it for the KYC process</string>

Code Sample

// Root component
import {PokoWidgetProvider} from '@pokopayment/react-native-sdk';

function App(): JSX.Element {
  return (
    <PokoWidgetProvider apiKey="your API_KEY (optional)" environment="DEVELOPMENT (default) | STAGING | PRODUCTION">
      <HelloWorld />
    </PokoWidgetProvider>
  );
}

// HelloWorld component
import {usePokoWidget} from '@pokopayment/react-native-sdk';

const {launchWidget, setApiKey, setEnv, setUserId} =
    usePokoWidget();

setApiKey('YOUR API KEY'); // required, can ignore if already provided from the PokoWidgetProvider
setUserId('Your user ID'); // required
setEnv('PRODUCTION' | 'STAGING' | 'DEVELOPMENT'); // default DEVELOPMENT

const urlLaunched = launchWidget({
    fiat?: string; // VND, USD,..
    crypto?: string; // USDT-bsc, USDT-ethereum, BTC-bitcoin,...
    fiatAmount?: number; // 100.0
    cryptoAmount?: number; // 0.5
    strictMode?: boolean; // true | false (not allow users change fiat & crypto currency)
    fiatList?: string[]; // ['VND', 'USD']
    cryptoList?: string[]; // ['ETH-ethereum', 'BTC-bitcoin']
    excludeProviderIds?: string[]; // ['transak', 'payfura']
    signature?: string;
    providerId?: string;
    paymentMethodId?: string;
    receiveWalletAddress?: string;
});
PreviousAndroid nativeNextDashboard API

Last updated 1 year ago

See more at

Next, add the CAMERA permission to your application (See more ):

here
URL Signature