Skip to content

GetSocial Android SDK Manual Integration Guide

Basic Setup

Configure SDK Dependencies

GetSocial SDK is distributed as an Android Library in aar format. You can get it from our Maven Repository or Downloads page in the documentation.

  1. In your project, open build.gradle.
  2. Add GetSocial Maven Repository to the list of project dependencies repositories:

    repositories {
        maven { url '' }
  3. Add SDK dependency to your build.gradle:

    dependencies {
        implementation('im.getsocial:getsocial-ui:[7,8)@aar') // Note: add this dependency only if you plan to use GetSocial UI
        implementation '' // Optional. GetSocial is using it to obtain more accurate data about installs and make attribution more reliable
  4. Build your project.

  5. Add getsocial.json file to your project’s assets folder.
  6. Import GetSocial SDK into your app:

    import im.getsocial.sdk.GetSocial;

Configure Manifest

In this step, we will add your GetSocial App Id to your app and update your Android manifest with required permissions.

  1. Get your GetSocial App Id from the “App settings” section on the GetSocial Dashboard: GetSocial App Id
  2. Open your module-level build.gradle and add:

    android {
        defaultConfig {
            manifestPlaceholders = [getsocial_scheme: "[app_id_from_step_1]", getsocial_hostName_0:"[your_invite_url_domain0]", getsocial_hostName_1:"[your_invite_url_domain1]"]

    This step is required for manual initialization as well.

Smart Invites

Add Image Content Provider

To be able to attach images to the Smart Invite messages you have declare an Image Content Provider:

  1. Open AndroidManifest.xml in your project.
  2. Add GetSocial Image Content Provider to the application element:


Configure Dependencies

To obtain more accurate data about installs and make attribution more reliable, GetSocial is using Google Play Install Referrer API. To add library to your project:

  1. Open the Android application project build.gradle.
  2. Add library to the dependencies list:

    dependencies {
        implementation ''

    Using Gradle version before 3.0?

    Starting from version 3.0.0 Gradle deprecated compile dependency scope and replaced with implementation. If you are using Gradle version before 3.0.0, replace implementation keyword with compile to avoid build errors.

Url Scheme Configurations

Setup Url Schemes for Android 4+

  1. In your project, open AndroidManifest.xml.
  2. Add following intent filter to the activity that should be opened from the deep link. Do not forget to put your GetSocial App Id into the data tag:

        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
                android:host="[put your getsocial app id here]"
  3. To validate the configuration, send a Smart Invite and click on the link, your app should be opened:

    Smart Invite via Twitter with Custom Subdomain

To improve user experience on clicking the GetSocial Smart Invites link we highly recommend setup Android App links in your app in addition to Url Schemes.

Android 6.0 (API level 23) and higher allow an app to designate itself as the default handler for a given type of link. App Links allow taking the user directly to the app on the link click without the browser window in the middle. Check the official Android App Links docs for more details.

To set up App Links support follow the next steps:

  1. To setup App Links in your app open AndroidManifest.xml in your project.
  2. Copy Smart Link domain from the GetSocial Dashboard.

    Copy Smart Links Domain Configuration

    There are two options:

    • If you are using prefix for the default domain for Smart Links, you have to add intent filter with the following host configurations to the activity that must be opened from the Smart Link:
    <data android:scheme="https" android:host="[PREFIX]" />
    <data android:scheme="https" android:host="[PREFIX]" />
    • If you are using custom domain for Smart Links you have to specify both, custom domain and default domain configurations:
    <data android:scheme="https" android:host="[YOUR_CUSTOM_DOMAIN]" />
    <data android:scheme="https" android:host="[PREFIX]" />

    For instance for our Documentation Demo app we use prefix for domain for Smart Links, intent filter that must be added will be the following:

    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" android:host="" />
        <data android:scheme="https" android:host="" />
  3. To validate configuration:

    1. Go to “App info” → “Open by default”, domain(s) specified in the intent filter should be listed in “Supported links” section:

      Supported links section

    2. Send a Smart Invite and click on the link, and the app selector screen with your app should be opened, or you have to be taken to the app directly.

Push Notifications

Enable/Disable GetSocial Notifications on the Client Side

Specify special meta-tag in AndroidManifest.xml:

<application ...>
        android:value="false" />

Show Notifications In Foreground

Specify special meta-tag in AndroidManifest.xml:

<application ...>
        android:value="true" />

UI Configuration

Configuration Loading

Set a path to configuration file or directory in your AndroidManifest.xml:

<application ...>
        android:value="getsocial/ui-landscape.json" />

Give us your feedback! Was this article helpful?

😀 🙁