Integration Steps - GluedIn
Introduction
The GluedIn SDK simplifies the process of incorporating the Shorts in-app community platform seamlessly into your application. It offers a prebuilt UI SDK that comes equipped with comprehensive built-in business logic, providing developers with extensive customization options for the UI's appearance and functionality. With minimal effort, developers can even control the placement of buttons and achieve a tailor-made user experience.
On this page, we provide a concise guide on integrating a high-quality, low-latency short video community platform into your app while retaining full control over its customizable UI features.
Integration Steps to launch GluedInSDK
Step 1: Console setup and get Keys:
  • Follow onboarding steps on console
  • Create your project in the dashboard and get the API Key and Secret key.
  • Follow the steps on console and copy and use the API and secret key into your application.
Step 2: Integrate Dependency
  • Add/Replace below listed dependency code inside your app/build.gradle file, as shown below.
  • 
    implementation com.gluedin.nocode:gluedin:4.0.3
    
  • Add below code into project build.gradle file
  • 
    maven {
          name = "GitHubPackages"
          url = uri("https://maven.pkg.github.com/plussaw/GluedIn")
          credentials {
              username = "plussaw"
              password = "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"
          }
    }
    
  • Click on the Sync Now button in Android Studio
  • Now Open GluedInQuickLaunchSampleApp folder in Android Studio
  • Open Application class of the project and add below code in onCreate()
  • 
    override fun onCreate() {
           super.onCreate()
           GluedInInitializer.initSdk(this)
    }
    
Step 3: Entry Point Configuration
We have multiple entry point options from where we can launch GluedIn SDK and GluedIn will behave differently will all of these different entry points.
1. Launch Gluedin as a Guest user on Button click:Sample code below:
				  
fun launchGluedAsGuestUser() {
    val callback: GluedInSDKCallBack = object : GluedInSDKCallBack {
          override fun onSdkInitSuccess(
              isSuccess: Boolean,
              gluedInSdkException: GluedInSdkException?
          ) = Unit

          override fun onSdkLogout() = Unit
          override fun onUserProfileClick(userId: String) = Unit
          override fun onAppAuthSuccess(
              isSuccess: Boolean,
              gluedInSdkException: GluedInSdkException?
          ) = Unit
          override fun onGluedInShareAction(shareData: ShareData) = Unit
          override fun onLoginRegistrationRequired(
              currentVideo: VideoInfo?,
              isLoginAction: Boolean
          ) = Unit
          override fun onProductCTAClicked(assetId: String, eventRefId: Int) = Unit
          override fun onSdkExit() = Unit
      }

      val gluedInConfigurations = GluedInInitializer.Configurations.Builder()
          .setSdkCallback(callback)
          .setApiKey("put_your_api_key")
          .setSecretKey("put_your_secret_key")
          .setFeedType(GluedInInitializer.Configurations.FeedType.VERTICAL) // GluedInInitializer.Configurations.FeedType.SQUARE
          .create()

      gluedInConfigurations.validateAndLaunchGluedInSDK(
          this,
          GluedInConstants.LaunchType.APP,
          intent
      )  
}
2. Launch GluedIn as a authenticated user: Sample code below:
				  
 func launchGluedAsRegisteredUser() {
  val callback: GluedInSDKCallBack = object : GluedInSDKCallBack {
            override fun onSdkInitSuccess(
                isSuccess: Boolean,
                gluedInSdkException: GluedInSdkException?
            ) = Unit
  
            override fun onSdkLogout() = Unit
            override fun onUserProfileClick(userId: String) = Unit
            override fun onAppAuthSuccess(
                isSuccess: Boolean,
                gluedInSdkException: GluedInSdkException?
            ) = Unit
            override fun onGluedInShareAction(shareData: ShareData) = Unit
            override fun onLoginRegistrationRequired(
                currentVideo: VideoInfo?,
                isLoginAction: Boolean
            ) = Unit
            override fun onProductCTAClicked(assetId: String, eventRefId: Int) = Unit
            override fun onSdkExit() = Unit
        }
  
        val gluedInConfigurations = GluedInInitializer.Configurations.Builder()
            .setSdkCallback(callback)
            .setApiKey("put_your_api_key")
            .setSecretKey("put_your_secret_key")
            .setFeedType(GluedInInitializer.Configurations.FeedType.VERTICAL) // GluedInInitializer.Configurations.FeedType.SQUARE
            .setUserInfoForAutoSignIn(UserInfoAutoSignIn("email_id", "password", "full_name", "profile_picture"))
            .create()
  
        gluedInConfigurations.validateAndLaunchGluedInSDK(
            this,
            GluedInConstants.LaunchType.APP,
            intent
      )  
}
3. Launch GluedIn from Deeplink:
If user is coming from the external deeplink (i.e. WhatsApp, FB or Instagram) and a particular SDK screen needs to be open then using the below SDK method, user can be navigated on respective screen.

val localIntent = Intent()
localIntent.data = "medium=medium_id".toUri()
gluedInConfigurations.validateAndLaunchGluedInSDK(
    this,
    GluedInConstants.LaunchType.APP,
    localIntent,
)

Medium Types
1. content
2. hashtag
3. challenge

Medium Id
1. In case of content, it must be the content/videoId
2. In case of hashtag, it must be the hashtagTitle
3. In case of challenge, it must be the challengeId
Steps 4: Project Configuration
Apply SDK custom color theme as per your app: you can change any theme color combination according to your product color theme. please go to “GluedIn Website Developer Page Structure | Apply theme in the app: “ section at left menu and see the more detail
Change the bottom bar configuration: Please follow “GluedIn Website Developer Page Structure | Bottom Bar Customization: “ link to see how you can customised SDK bottom bar. You can change the bottom bar title name along with Its image.
Multi Language Support in SDK: Please follow “GluedIn Website Developer Page Structure | MultiLanguage Support: “ instruction in left menu and see how you can apply multi language configuration with in your SDK.
Step 5: Feed Format and Callbacks:
We support two types of feed in GluedInSDK, 1) Vertical type and 2) Card Type to enable please follow below points:
  • Go to the Launch Method in the code
  • Add below code in the configuration settings
  • 
    setFeedType(feedType) 
    
    FeedType:
    
    Vertical: GluedInInitializer.Configurations.FeedType.VERTICAL
    Card: GluedInInitializer.Configurations.FeedType.SQUARE 
    
Call backs method:
Below are few CTA callbacks from the player.
		     
  override fun contentReplay(event: AnalyticsEvents) = Unit
override fun contentLike(event: AnalyticsEvents) = Unit
override fun contentPlay(event: AnalyticsEvents) = Unit
override fun contentStopPlay(event: AnalyticsEvents) = Unit
override fun contentSwipeEvent(event: AnalyticsEvents) = Unit
override fun contentUnlike(event: AnalyticsEvents) = Unit
override fun pause(event: AnalyticsEvents) = Unit
override fun resume(event: AnalyticsEvents) = Unit
override fun shareEvent(event: AnalyticsEvents) = Unit
override fun userFollow(event: AnalyticsEvents) = Unit
override fun userUnfollow(event: AnalyticsEvents) = Unit
Step 6: Run the app:
After all these settings run the app and app should look like the below image based on UGC or PGC use case: