Here is how to initialize the Wepin widget Android SDK.
First, create an instance of the Wepin widget. Then, use the App ID and App Key assigned after app registration to initialize the instance.
Create Wepin Instance
In the activity of your app where you want to use the Wepin widget, first create an instance of Wepin. When creating the instance, pass the activity where you want to use Wepin as a parameter.
wepin =Wepin.getInstance(MainActivity.this);
Initialize
Before using the created instance, initialize it using the App ID and App Key.
appKey: String
App Key assigned during registration
attributes: Object (optional)
Properties of the Wepin Widget
type: String
It determines how the app widget window will be displayed on initial loading. The default value is hide.
show: Show the widget window immediately after loading for the first time.
hide: Hide the widget window initially when loading and show it later using openWidget().
defaultLanguage: String
The language to be displayed on the widget. The default value is ko. The currently supported languages are enand ko.
defaultCurrency:String
The currency to be displayed on the widget. The default value is KRW. The currently supported currencies are USDand KRW.
isInitialized
You can use the isInitialized method to check if the Wepin instance has been initialized successfully.
The returned value is as follows.
boolean
init result; true if Wepin SDK is already initialized, otherwise false.
Register Error Listener
To handle errors that occur in the Wepin widget, implement an error listener and register it. It is not mandatory to register an error listener, as it is optional depending on your needs.
You can implement it in the activity of your app that uses the Wepin widget.