Methods
The following shows the methods provided by the Wepin widget flutter SDK.
openWidget
openWidget
The openWidget
method shows the widget window.
Example
closeWidget
closeWidget
The closeWidget
method closes the widget window.
Example
getAccounts
getAccounts
The getAccounts
method returns user accounts of the networks available in the app. The returned value is an array of Account
object. getAccounts
is a method available after widget login.
Account
Account
The interface of the class returned by the getAccounts
function is as follows, and it is defined in wepin_outputs.dart
.
network
: dynamic The blockchain network of the account. The name of each network can be found below.
address
: dynamic The account address
finalize
finalize
The state of Wepin is initialized.
Example
getStatus
(Supporting from version 0.0.4-alpha
or higher)
getStatus
(Supporting from version 0.0.4-alpha
or higher)It returns the Lifecycle state value of Wepin.
Example
The Returned Values
not_initialized
: Wepin is not initialized.initializing
: Wepin initialization is in progress.initialized
: Wepin initialization is completed.before_login
: Wepin initialized, but the user is not logged in.login
: The user is logged in.
login
(Supporting from version 0.0.4-alpha
or higher)
login
(Supporting from version 0.0.4-alpha
or higher)If the user is not logged in, it shows the widget window. If the user is already logged in, it returns the logged-in user information.
Example
WepinUser
WepinUser
The interface of the returned value class for the function is defined as follows, and it is defined in wepin_outputs.dart
.
status
: <'success' | 'fail'> login success status <'success' | 'fail'>UserInfo
: Information about the useruserId
: User IDemail
: User email addressprovider
: Information about the logged-in provider <'google'|'apple'|'email'|'naver'|'discord'|'external_token'>
getSignForLogin
(Supporting from version 0.0.4-alpha
or higher)
getSignForLogin
(Supporting from version 0.0.4-alpha
or higher)loginWithExternalToken()
returns a signed token value used for login.
Example
Parameters
privateKey
<String>: PrivateKey value used to sign the token forloginWithExternalToken()
.token
<String>: Token value received after logging in with OAuth.
The key for signing can be obtained from Wepin Workspace. In the Development Tools menu, click Get your authentication key on the Login tab to retrieve the authentication key.
Returned Values
signedToken
<String>: The value of the token signed with theprivateKey
.
loginWithExternalToken
(Supporting from version 0.0.4-alpha
or higher)
loginWithExternalToken
(Supporting from version 0.0.4-alpha
or higher)Log in to Wepin with the token value received after logging in with OAuth.
Example
Parameters
token
<String>: External token value to be used for login (e.g., idToken).signedToken
<String>: The signature value received after executinggetSignForLogin()
as the first parameter.
Returned Values
WepinUser
The interface of the returned value class for the function is defined as follows, and it is defined in
wepin_outputs.dart
.status
: <'success' | 'fail'> login success status <'success' | 'fail'>UserInfo
: Information about the useruserId
: User IDemail
: User email addressprovider
: Information about the logged-in provider <'google'|'apple'|'email'|'naver'|'discord'|'external_token'>
logout
(Supporting from version 0.0.4-alpha
or higher)
logout
(Supporting from version 0.0.4-alpha
or higher)It logs out the user logged into Wepin.
Example
Returned Values
WepinUser
The interface of the returned value class for the function is defined as follows, and it is defined in
wepin_outputs.dart
.status
: <'success' | 'fail'> login success status <'success' | 'fail'>UserInfo
: Information about the useruserId
: User IDemail
: User email addressprovider
: Information about the logged-in provider <'google'|'apple'|'email'|'naver'|'discord'|'external_token'>
Last updated