API: Option

    API: Option


    記事の要約

    setShareScheme

    [共有]を選択(タップ)すると、システム共有ポップアップへの転送する schemeが設定されます。 shareDelegateでは、iOSシステム共有ポップアップの代わりにカスタム共有ポップアップを直接実装できます。

    setShareScheme(_ scheme: String?, shareDelegate: ShopLivePlayerShareDelegate?)

    パラメーター

    説明

    scheme

    String?

    共有するスキームまたはURL

    shareDelegate

    ShopLivePlayerShareDelegate?

    ShopLiveShareDelegate

    サンプルコード

    let scheme = "shoplive://live"
    let scheme = "https://shoplive.cloud/live"
    
    class ViewController : UIViewController {
      
      func viewDidLoad(){ 
        // iOSシステム共有ポップアップ
    		ShopLive.setShareScheme(scheme, shareDelegate: nil)
      }
    } 
    extension ViewController : ShopLiveShareDelegate { 
      func handleShare(data : ShopLivePlayerShareData) {
        //show share sheet
      }
    }

    ShopLivePlayerShareData

    パラメーター

    説明

    campaign

    ShopLivePlayerShareCampaign

    現在の配信キャンペーンに関する情報

    url

    String

    共有するスキームまたは URL

    

    ShopLivePlayerShareCampaign

    パラメーター

    説明

    campaignKey

    String?

    現在のブロードキャストのcampaignKey

    title

    String?

    現在のライブ放送のタイトル

    descriptions

    String?

    現在の放送の説明

    thumbnail

    String?

    現在のライブ放送のサムネイル画像


    setChatViewFont

    チャットフォントを設定し、チャットボタンのフォントを送信します。

    setChatViewFont(inputBoxFont: UIFont, sendButtonFont: UIFont)

    パラメーター

    説明

    inputBoxFont

    UIFont

    チャットフォント

    sendButtonFont

    UIFont

    チャット転送ボタンのフォント

    サンプルコード

    /**
        // チャットフォントの設定
        let inputDefaultFont = UIFont.systemFont(ofSize: 14, weight: .regular)
    
        // チャット送信ボタンのフォント設定
        let sendButtonDefaultFont = UIFont.systemFont(ofSize: 14, weight: .medium)
    
    */
    
    let customFont = UIFont(name: "{Custom Font}", size: 16)
    
    // チャットフォントとチャット送信ボタンのフォント変更 
    ShopLive.setChatViewFont(inputBoxFont: customFont, sendButtonFont: customFont)


    setLoadingAnimation

    ビデオの読み込みの進行状況を [画像アニメーション] に設定します。

    setLoadingAnimation(images: [UIImage])

    パラメーター

    説明

    images

    UIImage array

    画像アニメーションに使用する画像 UIImage を配置する

    サンプルコード

    var images: [UIImage] = []
    
    for i in 1...11 {
        images.append(.init(named: "loading\(i)")!)
    }
    
    ShopLive.setLoadingAnimation(images: images)


    setInAppPipConfiguration

    InAppPip 関連のオプションを設定します。 setInAppPipConfiguration(config:) に設定された値は、以前に非推奨になった API によって設定された値よりも優先されます。

    setInAppPipConfiguration(config: ShopLiveInAppPipConfiguration?)

    パラメーター

    説明

    pipSize

    ShopLiveInAppPipSize

    • init(pipMaxSize : CGFloat)

    • init(pipFixedHeight : CGFloat)

    • init(pipFixedWidth : CGFloat)

    • pipMaxSize.scaleAspectFill に設定されています。 たとえば、pipMaxSizeは100です 横向きモードでは、100 x 100 x (アスペクト比) ポートレートモードでは、縦100、横100x(アスペクト比)になります。

    パラメーター

    説明

    config

    ShopLiveInAppPipConfiguration

    • pipSize: ShopLiveInAppPipSize

    • useCloseButton: Bool

      • (InAppPip の左上隅に閉じるボタンを表示するかどうかを設定します。デフォルト: false)

    • pipPosition: ShopLive.PipPosition

      • (デフォルトは.bottomRight)

    • enableSwipeOut: Bool

      • (アプリ内PIPを画面外に移動して終了するかどうかを設定します、デフォルト:false)

    • pipRadius: CGFloat

      • (アプリ内PIPのcornerRadiusを設定、デフォルト:10)

    📘Objective-C 環境では、ShopLiveInAppPipConfigurationObjc オブジェクトを使用します。

    サンプルコード

    //maxSize
    let pipSize = ShopLiveInAppPipSize(pipMaxSize : 200)
    //fixedHeight
    let pipSize = ShopLiveInAppPipSize(pipFixedHeight : 200)
    //fixedWidth
    let pipSize = ShopLiveInAppPipSize(pipFixedWidth  :200)
    
    let inAppPipConfig = ShopLiveInAppPipConfiguration(pipSize: pipSize,
                                                       useCloseButton: true,
                                                       pipPosition: .bottomLeft,
                                                       enableSwipeOut: true,
                                                       pipRadius : 10)
    ShopLive.setInAppPipConfiguration(config: inAppPipConfig)


    getPreviewSize

    プレビューのサイズを取得します。

    getPreviewSize(inAppPipConfiguration: ShopLiveInAppPipConfiguration, videoRatio: CGSize) -> CGSize

    パラメーター

    説明

    inAppPipConfiguration

    ShopLiveInAppPipConfiguration

    ShopLiveInAppPipConfiguration

    videoRatio

    CGSize

    動画の比率(例:16:9、9:16)


    addSubViewToPreview

    Shoplive preview上にお客様のcustomViewを表示します。

    注意

    customView を表示する場合は、ShopLiveInAppPipConfiguration(useCloseButton: false) を使用します。

    addSubViewToPreview(subView: UIView)

    サンプルコード

    func setCustomerPreviewCoverView() {
        var previewViewCoverView = UIView()
        previewViewCoverView.addSubview(someView1)
        previewViewCoverView.addSubview(someView2)
        NSLayoutConstraint.activate([
            someView1.topAnchor.constraint(equalTo: previewViewCoverView.topAnchor),
            someView1.trailingAnchor.constraint(equalTo: previewViewCoverView.trailingAnchor),
            someView1.widthAnchor.constraint(equalToConstant: 70),
            someView1.heightAnchor.constraint(equalToConstant: 30),
                
            someView2.bottomAnchor.constraint(equalTo: previewViewCoverView.bottomAnchor),
            someView2.leadingAnchor.constraint(equalTo: previewViewCoverView.leadingAnchor),
            someView2.trailingAnchor.constraint(equalTo: previewViewCoverView.trailingAnchor),
            someView2.heightAnchor.constraint(equalToConstant: 40)
        ])
        ShopLive.addSubViewToPreview(subView: previewViewCoverView)
    }


    startPictureInPicture

    フルスクリーンモードからピクチャーインピクチャーモードに切り替えます。

    startPictureInPicture(with position: ShopLive.PipPosition, scale: CGFloat)
    startPictureInPicture()

    パラメーター

    説明

    position

    ShopLive.PipPosition

    ピクチャーインピクチャーモード開始時の位置

    デフォルト: default

    scale

    CGFloat

    0.0 ~ 1.0 の値を入力します。

    サンプルコード

    // 0.4倍(デフォルト)サイズでアプリ内PIPモードに切り替えます。
    ShopLive.startPictureInPicture()
    
    // 画面右下から0.1倍サイズでアプリ内PIPを切り替えます。
    ShopLive.startPictureInPicture(with: .bottomRight, scale: 0.1)
    
    // 画面左上から0.8倍サイズでアプリ内PIPを切り替えます。
    ShopLive.startPictureInPicture(with: .topLeft, scale: 0.8)

    サイズ設定の例

    大きさ

    ピクチャーインピクチャー画面

    0.1

    0.4 (デフォルト)

    0.8


    stopPictureInPicture

    ピクチャーインピクチャーモードをフルスクリーンモードに切り替えます。

    stopPictureInPicture()

    サンプルコード

    ShopLive.stopPictureInPicture()


    hookNavigation

    商品またはバナーを選択すると、パラメーターに設定した custom  Callback 関数 (パラメーターとして入力した navigation)を使用してイベントを直接受信します。

    hookNavigation(navigation: @escaping ((URL) -> Void))

    パラメーター

    説明

    navigation

    URL

    商品やバナーを選択するときに呼び出されるブロック

    - 選択した商品またはバナーのURLを転送します

    サンプルコード

    ShopLive.hookNavigation { url in
           // url: 選択した商品またはバナーに設定された詳細情報 URL
           print("hookNavigation \(url)")
    }


    KeepWindowStyleOnReturnFromOsPip

    setKeepWindowStyleOnReturnFromOsPip

    OS PIPを使用している場合、Shoplive Playerの再生中(PIP、フルスクリーン)に動画がOS PIPに入り、ホーム画面または別のアプリに移動します(バックグラウンド状態に切り替わります)。 アプリに戻ったときに、最後に再生していた状態(PIP、フルスクリーン)に切り替えるか、常に全画面表示にするかを選択できます。

    setKeepWindowStyleOnReturnFromOsPip(_ keep: Bool)

    パラメーター

    説明

    keep

    Bool

    OSのピクチャーインピクチャー状態からアプリに戻ったときのプレーヤーの再生状態を設定します

    • true: 最後の再生状態(pip、フルスクリーン)に切り替えます(デフォルト)

    • false: 常に全画面表示に切り替えます

    サンプルコード

    // OS PIPに切り替わる前の最後の再生中の状態を維持するように設定します。
    ShopLive.setKeepWindowStyleOnReturnFromOsPip(true)
    
    // OS PIP状態からアプリに切り替わり、常に全画面表示に切り替わるように設定する
    ShopLive.setKeepWindowStyleOnReturnFromOsPip(false)

    isKeepWindowStyleOnReturnFromOsPip

    現在設定されているマントを返します。

    • true: 最後の再生状態(PIP、フルスクリーン)に切り替えます(デフォルト)

    • false: 常に全画面表示に切り替えます

    isKeepWindowStyleOnReturnFromOsPip() -> Bool

    サンプルコード

    print(ShopLive.isKeepWindowStyleOnReturnFromOsPip())


    ShopLiveCommonUser

    Shoplive を使用している認証済みユーザーです。 ユーザーを認証するためのユーザーの情報を入力します。

    var user: ShopLiveCommonUser? { get set }

    // ユーザーの性別
    public enum ShopliveCommonUserGender : String, CaseIterable {
        case female = "f"
        case male = "m"
        case neutral = "n"
    }

    public class ShopLiveCommonUser: NSObject {
        var userId: String?
        var name: String?
        var age: Int?
        var gender: ShopliveCommonUserGender?
        var userScore : Int?
        var custom : [String : Any]?
    }

    📘Objective-C 環境では、ShopLiveCommonUserObjc オブジェクトを使用してください。


    authToken

    Shoplive 文字列を使用した認証済みユーザーのセキュリティ認証トークン (JWT)。 認証されたユーザーのセキュリティ認証トークン (JWT) 文字列を入力して、ユーザーを認証します。

    var authToken: String? { get set }

    サンプルコード

    let generatedJWT = "eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MTA1NzA1dfadsfasfadsfasdfwO"
    
    ShopLive.authToken = generatedJWT

    style

    これは現在のShoplivePlayerスタイルです。

    var style: ShopLive.PresentationStyle { get }

    public enum PresentationStyle: Int {
        case unknown
        case fullScreen
        case pip
    }

    サンプルコード

    print(ShopLive.style)


    playerMode

    これは、現在のShoplivePlayerのmodeです。

    var playerMode: ShopLive.PlayerMode { get }

    public enum PlayerMode: Int {
        case play
        case preview
        case none
    }

    enum PlayerMode

    タイプ

    説明

    play

    Play API で実行されているプレーヤーで動画 (リハーサル、ライブ、リプレイ) を再生する

    preview

    プレビューは、プレビューAPIで実行されているプレーヤーで再生されています

    none

    プレーヤーが実行されていません


    orientationMode

    これは、Shoplive Platyerで現在再生されているライブ放送の動画の割合情報です。

    var orientationMode: ShopLive.VideoOrientation { get }

    public enum VideoOrientation: Int {
        case portrait
        case landscape
        case unknown
    }

    enum VideoOrientation

    タイプ

    説明

    portrait

    縦長比モードで放送(縦長比の例 - 9:16)

    landscape

    アスペクト比モードでの放送(16:9の比率の例)

    unknown

    モードが不明であるか、ブロードキャストされていないか、ブロードキャスト情報が SDK でまだ更新されていません。


    playerWindow

    Shoplive Player が現在表示されている UIWindow のインスタンス。

    var playerWindow: ShopLiveWindow? { get }

    playerWindow.forceAddSubView

    この関数は、ShopLive フレームワークの上にクライアントのビューを配置する場合に使用します。

    一般的なaddSubViewの場合、ShopLiveのポリシーにより、クライアントのビューが追加されない場合があります。

    ShopLive.playerWindow?.forceAddSubView({YOUR_VIEW})


    viewController

    これは、Shoplive Player が現在表示されている UIViewController のインスタンスです。

    var viewController: ShopLiveViewController? { get }

    サンプルコード

    // Shoplive Player上にAlertを表示
    let alert = UIAlertController.init(title: "Alert on Player", message: nil, preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
    
    ShopLive.viewController?.present(alert, animated: true, completion: nil)


    setVisibleStatusBar options

    Shoplive Playerが全画面表示で再生されているときに、アプリのステータスバーを非表示にすることができます。 inAppPipの場合、ステータスバーが自動的に表示されます。

    setVisibleStatusBar

    setVisibleStatusBar(isVisible : Bool)

    パラメーター

    説明

    isVisible

    Bool

    ステータスバーを非表示に設定します。

    • true: ステータスバーを表示(デフォルト)

    • false: ステータスバーを隠す

    サンプルコード

    ShopLive.setVisibleStatusBar(isVisible : Bool)


    indicatorColor

    ローディングインジケーターの色を設定します。

    var indicatorColor: UIColor { get set }

    サンプルコード

    ShopLive.indicatorColor = UIColor.red


    isSuccessCampaignJoin

    ブロードキャスト エントリが成功したかどうかを確認します。

    • 関連 callback: handleReceivedCommand - ON_SUCCESS_CAMPAIGN_JOIN

    isSuccessCampaignJoin() -> Bool

    サンプルコード

    print(ShopLive.isSuccessCampaignJoin())


    AutoResumeVideoOnCallEnded options

    通話が終了した後にビデオに戻ったら、自動再生に設定します。

    setAutoResumeVideoOnCallEnded

    setAutoResumeVideoOnCallEnded(_ autoResume: Bool)

    パラメーター

    説明

    autoResume

    Bool

    通話が終了すると、ビデオが自動再生されます

    • true:自動再生

    • false:自動再生しません(デフォルト)

    サンプルコード

    ShopLive.setAutoResumeVideoOnCallEnded(true)

    isAutoResumeVideoOnCallEnded

    現在設定されている値を返します。

    • true: 通話終了後の自動再生

    • false: 通話終了後にビデオが停止する

    isAutoResumeVideoOnCallEnded() -> Bool

    サンプルコード

    print(ShopLive.isAutoResumeOnCallEnded())


    KeepPlayVideoOnHeadphoneUnplugged options

    イヤホン(またはヘッドセット)が切断されたら、ビデオを停止せずに自動再生するように設定します。

    setKeepPlayVideoOnHeadphoneUnplugged

    イヤホン(またはヘッドセット)が切断されたら、ビデオを停止せずに自動再生するように設定します。

    setKeepPlayVideoOnHeadphoneUnplugged(_ keepPlay: Bool)

    パラメーター

    説明

    keepPlay

    Bool

    イヤホン(またはヘッドセット)を外すと、ビデオの再生が続行されます

    • true: 自動再生

    • false: 自動再生しません(デフォルト)

    サンプルコード

    ShopLive.setKeepPlayVideoOnHeadphoneUnplugged(true)

    isKeepPlayVideoOnHeadPhoneUnplugged

    現在設定されている値を返します。

    • true: ビデオは再生を続けます

    • false: 切断するとビデオが停止します

    isKeepPlayVideoOnHeadPhoneUnplugged() -> Bool

    サンプルコード

    print(ShopLive.isKeepPlayVideoOnHeadPhoneUnplugged())


    NextActionOnHandleNavigation options

    ユーザーが商品、お知らせ、バナーなどのリンクを選択すると、Shoplive Playerに次のアクションが設定されます。

    public enum ActionType: Int {
        case PIP
        case KEEP
        case CLOSE
    }

    enum ActionType

    タイプ

    説明

    PIP

    PIP 変換

    KEEP

    状態を維持

    CLOSE

    終了

    setNextActionOnHandleNavigation

    setNextActionOnHandleNavigation(actionType: ActionType)

    パラメーター

    説明

    actionType

    ActionType

    ユーザーがリンクを選択すると、Shoplive Player が次に動作します

    サンプルコード

    // PIP切り替え
    ShopLive.setNextActionOnHandleNavigation(.PIP)
    
    // 状態を維持する
    ShopLive.setNextActionOnHandleNavigation(.KEEP)
    
    // 終了
    ShopLive.setNextActionOnHandleNavigation(.CLOSE)

    getNextActionTypeOnHandleNavigation

    Shoplive Player では、ユーザーがリンクを選択したときに設定される次のアクションに注目してください。

    getNextActionTypeOnHandleNavigation() -> ActionType

    サンプルコード

    print(ShopLive.getNextActionTypeOnHandleNavigation())

    sendCommandMessage

    コマンドとペイロードをサーバーに配信します。コマンドとペイロードを事前定義された形式で渡すことができます。 (あるいは、Shoplive と相談してコマンドとペイロードを定義することもできます。)

    @objc static func sendCommandMessage(command: String, payload: [String:Any]?)

    Swift

    Parameter name

    Type

    Description

    command

    String

    The pre-defined command

    payload

    [String:Any]?

    The pre-defined payload

    Sample code

    let command: String = “COMMAND_NAME”
    var payload: [String : Any] = [:]
    
    payload[“Int_Data” : 1]
    payload[“String_Data” : “Sample_String”]
    
    ShopLive.sendCommandMessage(command: command, payload: payload)

    Swift



    setMuteWhenPlayStart

    Shoplive Player の起動時にサウンドをオンまたはミュートに設定します。 (デフォルト: サウンドがオンになった状態で Shoplive Player が起動します。)

    @objc static func setMuteWhenPlayStart(_ mute: Bool)

    Swift

    Parameter name

    Type

    Description

    mute

    Bool

    Determine whether to mute : Start with mute : Start with sound on

    • true: Start with mute

    • false: Start with sound on

    Sample code

    // Mute when player started
    ShopLive.setMuteWhenPlayStart(true)
    
    //Sound on when player started
    ShopLive.setMuteWhenPlayStart(false)

    Swift



    setEnabledPictureInPicture

    アプリが InAppPip と OSPip をサポートするかどうかを決定します (デフォルト : true )

    @objc static func setEnablePictureInPicture(isEnabled: Bool)

    Swift

    Sample code

    // Enable InAppPip and OSPIP
    ShopLive.setEnabledPictureInPicture(isEnabled: true)
    
    // Disable InAppPip and OSPIP
    ShopLive.setEnabledPictureInPicture(isEnabled: false)

    Swift



    setEnableOSPictureInPicture

    アプリが OS の PIP をサポートするかどうかを決定します (デフォルト : true)

    @objc static func setEnabledOSPictureInPictureMode(isEnabled: Bool)

    Swift

    Sample code

    // InAppPip(Enabled), OSPIP (Disabled)
    ShopLive.setEnabledPictureInPicture(isEnabled: true)
    ShopLive.setEnabledOSPictureInPicture(isEnabled: false)
    
    // InAppPip, OSPIP both enabled
    ShopLive.setEnabledPictureInPicture(isEnabled: true)
    ShopLive.setEnabledOSPictureInPicture(isEnabled: true)
    
    // InAppPip, OSPIP both disabled
    ShopLive.setEnabledPictureInPicture(isEnabled: false)
    ShopLive.setEnabledOSPictureInPicture(isEnabled: true)

    Swift



    setPictureInPicturePadding

    アプリ内の PIP で PIP パディングを設定します。 (上、左、右、下)(デフォルト: 上、左、右、下はすべて 20 に設定)無効な値が設定されている場合は、false を返し、デフォルト値を適用します。

    @objc static func setPictureInPicturePadding(padding: UIEdgeInsets) -> Bool

    Swift

    Parameter name

    Type

    Description

    padding

    UIEdgeInsets

    Set padding values ​​such as top, left, right, bottom, etc.

    Sample code

    // left: 20 right: 30 bottom: 10 top: 10
    
    let padding: UIEdgeInsets = .init(top: 10, left: 20, bottom: 10, right: 30)
    
    ShopLive.setPictureInPicturePadding(padding: padding)

    Swift


    setPictureInPictureFloatingOffset

    アプリ内PIPで、PIPが移動できる領域を設定します。 無効な値が設定されている場合は、切り上げられ、 falseデフォルト値が受け入れられます。

    @objc static func setPictureInPictureFloatingOffset(offset: UIEdgeInsets) -> Bool

    パラメーター

    説明

    offset

    UIEdgeInsets

    上、左、右、下のオフセット値を設定します。

    サンプルコード

    // left: 20, right: 30, bottom: 10, top: 10でオフセット値を設定します。
    
    let offset: UIEdgeInsets = .init(top: 10, left: 20, bottom: 10, right: 30)
    
    ShopLive.setPictureInPictureFloatingOffset(offset: offset)


    setUsingLocalStorage

    ローカルストレージの保存機能を使用するかどうかを設定します。

    @objc static func setUsingLocalStorage(_ use: Bool)

    パラメーター

    説明

    use

    Bool

    ローカルストレージ機能を使用することは可能ですか?

    • true:ローカルストレージ保存機能を使う

    • false:ローカルストレージストレージ機能を無効にする

    サンプルコード

    // ローカルストレージの保存機能を使用するように設定
    ShopLive.setUsingLocalStorage(true)
    
    // ローカルストレージの保存機能を使用しないように設定
    ShopLive.setUsingLocalStorage(false)


    setAppVersion

    アプリのバージョンを設定します。

    • API を呼び出さなくても、既定でアプリのバージョンが読み取られ、サーバーに渡されます。

    • この機能を使用する場合は、Shoplive の担当者にお問い合わせください (ask@shoplive.cloud)。

    @objc static func setAppVersion(_ appVersion: String)

    パラメーター

    説明

    appVersion

    String

    アプリのバージョン

    サンプルコード

    let appVersion: String = “1.0.0”
    
    ShopLive.setAppVersion(appVersion)


    setMixWithOthers

    外部音声で放送を視聴できます。

    @objc static func setMixWithOthers(_ isMixAudio: Bool)

    パラメーター

    説明

    isMixAudio

    Bool

    • true: 外部オーディオでライブ放送を視聴 (デフォルト: true)

    • false: 外部オーディオの再生時にプレーヤーが一時停止します

    サンプルコード

    // 外部オーディオが再生されるとPlayerは一時停止します。
    ShopLive.setMixWithOthers(false)
    
    // 外部オーディオと一緒に放送を視聴する
    ShopLive.setMixWithOthers(true)


    useCloseButton

    閉じるボタンは、プレビューモードとピクチャーインピクチャーモードでアクティブにできます。

    @objc static func useCloseButton(_ use: Bool)

    パラメーター

    説明

    use

    Bool

    • true: プレビューとピクチャーインピクチャーモードで閉じるボタンを使用  

    • false: プレビューとピクチャーインピクチャーモードで閉じるボタンを使用しません

    サンプルコード

    // PreviewとPIPモードで閉じるボタンは使用しない。
    ShopLive.useCloseButton(false)
    
    // PreviewとPIPモードで閉じるボタンを使用します。
    ShopLive.useCloseButton(true)


    addParameter

    プレーヤーを起動する前に、カスタムデータを追加できます。

    @objc static func addParameter(key: String, value: String)

    パラメーター

    説明

    key

    String

    キーを適用するための追加のカスタムパラメータ

    value

    String

    カスタムパラメータの値

    サンプルコード

    ShopLive.addParameter(key: "key", value: "value")


    removeParameter

    プレーヤーを起動する前に、addParameterで追加したカスタムデータを削除します。

    @objc static func removeParameter(key: String)

    パラメーター

    説明

    key

    String

    削除するカスタムパラメータキー

    サンプルコード

    ShopLive.removeParameter(key: "key)


    setUtmSource

    UTM Sourceを追跡できます。データは データインサイトにあります。

    func setUtmSource(utmSource: String?)

    パラメーター

    説明

    utmSource

    String?

    ライブへの流入のリファラ情報

    サンプルコード

    ShopLive.setUtmSource(“{utm_source}”)


    setUtmMedium

    UTM Mediumを追跡できます。データは データインサイトにあります。

    func setUtmMedium(utmMedium: String?)

    パラメーター

    説明

    utmMedium

    String?

    流入がどのように発生したかがわかります。Googleは、流入につながったマーケティング手法を参照するためにmediumパラメータを設定することを推奨しています。(例:CPC、バナー、メール、ブログ、SNSなど)

    サンプルコード

    ShopLive.setUtmMedium(“{utm_medium}”)


    setUtmCampaign

    UTM Campaignを追跡できます。データは データインサイトにあります。

    func setUtmCampaign(utmCampaign: String?)\

    パラメーター

    説明

    utmCampaign

    String?

    どの広告キャンペーンが流入を生み出したかがわかります。これは、キャンペーン名、キャンペーン期間、キャンペーンコンテンツに分けることができます。

    サンプルコード

    ShopLive.setUtmCampaign(“{utm_campaign}”)


    setUtmContent

    UTM Contentを追跡できます。データは データインサイトにあります。

    func setUtmContent(utmContent: String?)

    パラメーター

    説明

    utmContent

    String?

    流入がどのような投稿/広告によって引き起こされたかがわかります。これは、キャンペーンパラメータの細分化としてよく使用されます。

    サンプルコード

    ShopLive.setUtmContent(“{utm_content}”)

    setResizeMode

    ビデオのアスペクト比を維持できます。 (デフォルト: .CENTER_CROP)

    ShopLive.setResizeMode(option : ShopLiveResizeMode)