Initialization
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.
Initialize
Before using the created instance, initialize it using the App ID and App Key.
WepinOptions
WepinOptions
The interface of the WepinOptions
class, which is used as a parameter for initialization, is as follows.
appId
: String App ID assigned during registrationappKey
: String App Key assigned during registrationattributes
: Object (optional) Properties of the Wepin Widgettype
: String It determines how the app widget window will be displayed on initial loading. The default value ishide
.show
: Show the widget window immediately after loading for the first time.hide
: Hide the widget window initially when loading and show it later usingopenWidget()
.defaultLanguage
: String The language to be displayed on the widget. The default value isko
. The currently supported languages areen
andko
.defaultCurrency
: String The currency to be displayed on the widget. The default value isKRW
. The currently supported currencies areUSD
andKRW
.
isInitialized
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, otherwisefalse
.
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.
Example
Last updated