- Print
API: Common
- Print
AccessKey setting
Set the issued accessKey
.
User authentication
JWT Authentication
ShopLiveCommon.setUserJWT(jwt: String)
Authenticate ShopLive JWT.
ShopLiveCommon.setUserJWT(accessKey: String, user: ShopLiveCommonUser)
Authenticate with JWT token using user information. User data can be reviewed in Data Insights.
ShopLiveCommonUser
Property name | Type | Description |
---|---|---|
userId | String | A value that ensures the uniqueness of a logged-in user (Required) |
name | String? | User name |
age | Int? | User age |
gender | ShopLiveCommonUserGender? | User gender |
userScore | Int? | Integers are available from -100 to 100. |
custom | Map<String, Any>? | Any data can be set up to 1KB. It allows checking the total/login viewers' data. |
Logged-in Check
Determine if JWT login has occurred.
Clear authentication information
Reset the configured authentication information.
Set UTM tag
You can track UTM Source/Medium/Campaign/Content. The data can be reviewed in the Data Insights.
ShopLiveCommon.setUtmSource(utmSource: String)
ShopLiveCommon.setUtmMedium(utmMedium: String)
ShopLiveCommon.setUtmCampaign(utmCampaign: String)
ShopLiveCommon.setUtmContent(utmContent: String)
fun setUtmSource(utmSource: String?)
fun setUtmMedium(utmMedium: String?)
fun setUtmCampaign(utmCampaign: String?)
fun setUtmContent(utmContent: String?)
Parameter name | Type | Description |
---|---|---|
utmSource | String? | It provides information on where the incoming traffic originated. |
utmMedium | String? | It conveys how the incoming traffic was generated. Google recommends setting the medium parameter to denote the marketing method through which the traffic was induced, such as CPC, banner, email, blog, social, etc. |
utmCampaign | String? | It communicates which advertising campaign the incoming traffic originated from. This can be divided into Campaign Name, Term, and Content. |
utmContent | String? | It informs about the posting/advertisement that led to the incoming traffic, often utilized as a subcategory under the campaign parameter. |
Sample code
Change all TextFont
Change the font type of internal TextView, EditText, and Button.
fun setTextTypeface(typeface: Typeface?)
Parameter name | Type | Description |
---|---|---|
typeface | Typeface? | Change fontType |
Sample code
Check the size of the stored cache (bytes)
Check the size (in bytes) of the cached directory for photos and videos (stored in the Shoplive cache directory).
fun getCacheDirectoryBytes(context: Context): Long
Parameter name | Type | Description |
---|---|---|
context | Context | context |
Sample code
ShopLiveCommon.getCacheDirectoryBytes(context: Context)
Delete cache
Delete Shoplive cache files
Parameter name | Type | Description |
---|---|---|
parent | File | Remove files and directories. |
Sample code