Android native

Installation

Implement pokopaymentsdk-release.aar to your project. Contact Poko's team at help@pokoapp.xyz to get this file.

Next, add the CAMERA permission to the AndroidManifest.xml of your application:

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

Code Sample

import xyz.pokoapp.pokopaymentsdk.Environment;
import xyz.pokoapp.pokopaymentsdk.PokoPaymentSDK;
import xyz.pokoapp.pokopaymentsdk.WidgetOption;

String apiKey = 'YOUR API KEY';
String userID = 'Your user ID';
String walletAddress = 'Receiving wallet address';
String fiat = 'VND';
String crypto = 'USDT-bsc';
String[] fiatList = { "VND", "USD" };
String[] cryptoList = { "ETH-ethereum", "BTC-btc" };
String[] excludeProviderIds = { "provider_id_1", "provider_id_2" };
Environment env = Environment.STAGING; // or Environment.PRODUCTION
Activity mContext = getActivity();


// See full list of params here: https://pokoapp.gitbook.io/documentation/onramp-aggregator/sdk-integration-and-documentation/mobile-integration/android-native

WidgetOption options = new WidgetOption.Builder(
  userID // required
)
  .withFiat(fiat) // optional
  .withCrypto(crypto) // optional
  .withFiatAmount(1000.0) // optional, has higher priority than `withCryptoAmount`
  .withCryptoAmount(100.0) // optional
  .withReceiveWalletAddress(walletAddress) // optional
  .withFiat(fiat) // optional
  .withCrypto(crypto) // optional
  .withFiatList(fiatList) // optional
  .withCryptoList(cryptoList) // optional
  .withStrictMode(true) // optional
  .withExcludeProviderIds(excludeProviderIds) // optional
  .withProviderId("provider_id") // optional
  .withPaymentMethodId("payment_id") // optional
  .build();

PokoPaymentSDK.initialize(apiKey, env).launchWidget(mContext, options);

Last updated