source 'https://github.com/CocoaPods/Specs.git'
# Match the Version with the Project's Minimum Supported Version
# Shoplive iOS SDK requires iOS 11.0 or later.
platform :ios, '11.0'
use_frameworks!
# Set the Project Target for Shoplive iOS SDK Installation
target 'ShortformProj' do
pod 'ShopliveShortformSDK', '1.5.5'
pod 'ShopliveSDKCommon', '1.5.5'
end
Swift Package Manager
Add the following contents to Package Dependencies.
Connecting WebView to the BridgeInterface alone provides the following functionalities:
Automatically closes the preview when exiting the product screen.
Shortform preview, view, and close actions are operational.
// Connect Webview to BridgeInterface
ShopLiveShortform.BridgeInterface.connect(webview) // Required
ShopLiveShortform.ShortsReceiveInterface
If you set up the ReceiveInterface handler on the customer's web UIViewController, you can utilize the following callbacks
public protocol ShopLiveShortformReceiveHandlerDelegate: AnyObject {
// Delivers the share URL when the share button is pressed.
func handleShare(shareUrl: String)
func handleShare(shareMetadata: ShopLiveShareMetaData)
// Delivers an error if one occurs. By default, error is passed as ShopLiveCommonError:Error.
func onError(error: Error)
// Delivers events that occur in the shortform.
func onEvent(command: String, payload: String?)
// Delivers the close event of the shortform screen.
func onDidDisAppear()
// Delivers the open event of the shortform screen.
func onDidAppear()
// Delivers the product click event.
func handleProductItem(shortsId: String, shortsSrn: String, product: ProductData)
// Delivers the product banner click event.
func handleProductBanner(shortsId: String, shortsSrn: String, scheme: String, shortsDetail: ShortsDetailData)
}