1단계 SDK 설치

    1단계 SDK 설치


    기사 요약

    ShopLiveHandler 를 반드시 등록하세요

    ShopLive.setHandler 인터페이스를 통해서 버튼의 기능을 구현할 수 있습니다. 아래 Handler 등록하기 가이드를 참고하세요.

    Library 선택

    app/build.gradle에 Live 라이브러리, 통합된 라이브러리, 분할된 라이브러리 중 선택해서 추가하세요.

    Live library

    dependencies {
        def shoplive_sdk_version = "1.5.15"
      
        // Shoplive live player
        implementation "cloud.shoplive:shoplive-sdk:$shoplive_sdk_version"
    }

    통합된 library

    dependencies {
        def shoplive_sdk_version = "1.5.15"
        
        // Shoplive combined packaging
        implementation "cloud.shoplive:shoplive-sdk-all:$shoplive_sdk_version" // live + short-form
    }

    분할된 library

    dependencies {
        def shoplive_sdk_version = "1.5.15"
        def your_exoplayer_version = "2.19.1"
        def your_media3_version = "1.4.1"
        def shoplive_exoplayer_version = your_exoplayer_version + "." + "8"
        def shoplive_media3_version = your_media3_version + "." + "8"
        
        // Shoplive split packaging
        implementation "cloud.shoplive:shoplive-common:$shoplive_sdk_version" // must required
        implementation "cloud.shoplive:shoplive-exoplayer:$shoplive_exoplayer_version" // must required
        // When using media3. Exoplayer will be deprecated soon.
        // https://developer.android.com/guide/topics/media/media3/getting-started/migration-guide
        // implementation "cloud.shoplive:shoplive-media3:$shoplive_media3_version" 
        implementation "cloud.shoplive:shoplive-network:$shoplive_sdk_version" // must required
      
        implementation "cloud.shoplive:shoplive-sdk-core:$shoplive_sdk_version" // for live player
      
        implementation "cloud.shoplive:shoplive-short-form:$shoplive_sdk_version" // for short-form player
    }
    


    Handler 등록하기

    Shoplive Android SDK로부터 여러 이벤트를 수신할 Handler를 등록하세요.

    ShopLive.setHandler(object : ShopLiveHandler() {
        override fun handleNavigation(context: Context, url: String) {
            // Do something
        }
    })


    Proguard Rule 추가

    R8 Build를 하면 난독화 문제가 발생할 수 있습니다. 아래의 내용을 추가해주세요.

    -keep public class cloud.shoplive.** { *; }
    -dontwarn cloud.shoplive.**
    -keep class org.json.** { *; }