- Print
Event handler
- Print
Through the ShopLiveShortformReceiveHandlerDelegate
function, notifications from Shoplive Shortform are delivered to the client and process as needed.
Shoplive Shortform provides the onEvent(command: String, payload: String?)
callback function that allows you to handle various events directly.
onError
Shoplive provides the onError(error: Error)
callback function that allows direct handling of errors occurring in Shoplive Shortform.
ShopLiveCommonError
Property name | Type | Description |
---|---|---|
code | Int | A Shoplive error code |
message | String? | An error message |
error | Error? | The original error message provided by operating system (if exists) |
class ViewController : UIViewController, ShopLiveShortformReceiveHandlerDelegate {
func onError(error : Error) {
if let error = error as? ShopLiveCommonError {
if let code = error.code {
//do something
}
if let message = error.message {
//do something
}
if let error = error.error {
//do something
}
}
}
}
handleShare
With the handleShare(shareMetaData: ShopLiveShareMetaData)
, you can develop direct sharing functionality in Shoplive Shortform.
ShopLiveMetaData
Property name | Type | Description |
---|---|---|
shortsId | String? | Shortform unique identifier |
shortsSrn | String? | ID containing unique information for Shortform |
title | String? | Shortform title (for og tag purposes) |
descriptions | String? | Shortform description (for og tag purposes) |
thumbnail | String? | Shortform thumbnail (for og tag purposes) |
class ViewController : ShopLiveShortformReceiveHandlerDelegate {
func handleShare(shareMetaData: ShopLiveShareMetaData) {
//Do something
}
}
onDidAppear
With the onDidAppear()
, you can receive the Shoplive Shortform's Full-type screen open event.
Product
Property name | Type | Description |
---|---|---|
brand | String? | Brand information of the product |
currency | String? | Currency of the product |
description | String? | Description of the product |
discountPrice | Double? | Discounted price of the product |
discountRate | Double? | Discount percentage of the product |
imageUrl | String? | Product image URL |
name | String? | Product name |
originalPrice | Double? | Regular price of the product |
productId | String? | Unique ID of the product, automatically issued upon product registration |
showPrice | Boolean | Displayed price of the product |
sku | String? | Unique SKU information of the product |
url | String? | URL of the product's detailed page |
handleProductBanner
With the handleProductBanner(shortsId: String, shortsSrn: String, scheme: String, shortsDetail: ShortsDetail)
, you can develop a direct product banner click feature in Shoplive Shortform.