Initialization
SDK Initialization for Wepin React Native Provider SDK
Import SDK
To use the Wepin React Native Provider SDK, you first need to import the SDK. Add the following import statements:
import WepinProvider from '@wepin/provider-rn';Creating the WepinProviderSDK Instance
Before creating an instance of WepinProvider, you must register your app's Android/iOS information in the Wepin Workspace.
Using the registered app information, create an instance of WepinProvider. Create the WepinProvider instance as follows:
const wepinProvider = new WepinProvider({
appId: 'wepinAppId',
appKey: 'wepinAppKey',
});SDK Initialization (init)
When initializing the Wepin React Native Provider SDK, you can define the required widget properties.
await wepinProvider.init();Parameters
attributes <
IWepinSDKAttributes> optionaldefaultLanguage: -
defaultLanguage: The language to be displayed on the widget (default:'en') Currently, onlyko,en, andjaare supported.defaultCurrency: The currency to be displayed on the widget (default:
'USD') Currently, only'KRW','USD'and'JPY'are supported.
Return value
Promise<
boolean>
Example
await wepinPin.init({
defaultLanguage: 'ko',
defaultCurrency: 'KRW',
});Checking Initialization Status (isInitialized)
You can check whether the Wepin Provider SDK has been successfully initialized.
wepinProvider.isInitialized();Parameters
None
Return Value
<boolean>
Returns
trueif the initialization was successful, andfalseif it failed.
Changing Language
Change the language and currency of the widget.
await wepinProvider.changeLanguage({ language, currency });Parameters
<object>
language
<String> -The language to be displayed on the widget. Currently, only'ko','en'and'ja'are supported.currency
<String>optional - The currency to be displayed on the widget. Currently, only'KRW','USD'and'JPY'are supported.
Last updated
Was this helpful?