Skip to content

Setup Invite Channels on Android

Prerequisite

Setup Invite Channels

GetSocial Smart Invites has two types of Invite Channels:

  • The one that works out of the box, e.g., SMS, Email, WhatsApp, Messenger, Kik, Line, Twitter, Facebook.
  • Ones that require integration of 3rd-party SDKs: KakaoTalk.

In this step, we will integrate GetSocial with the 3rd-party SDKs.

Setup Integration with Facebook SDK

Starting from the GetSocial SDK v6.20.7 we provide Facebook invite channel without the need to integrate Facebook SDK. The following guide shows how to integrate GetSocial with Facebook SDK for the older GetSocial SDK versions and to provide better invite flow UX.
The benefits of Facebook SDK integration:

  • You can track onSuccess/onError/onCancel events.
  • User is brought back to your application after an invite.
  • Invite is done by Facebook application, or WebView inside your app if Facebook is not installed.

GetSocial is compatible with Facebook Android SDK v4.x, older versions are not supported. Integration does not require Facebook application installed to be able to send invitations.

Facebook is deprecating App Invites

Facebook is deprecating App Invites from February 5, 2018.

New GetSocial integration with Facebook will allow posting Smart Invite to the timeline, friend’s timeline or a group. To upgrade, replace FacebookInvitePlugin with FacebookSharePlugin .

More: https://blog.getsocial.im/facebook-deprecates-app-invites-are-you-ready/

  1. Integrate Facebook Android SDK into your app as described in the Official Guide.
  2. Copy implementation of the Facebook Share plugin from GetSocial GitHub repository into your project.
  3. Register plugin with GetSocial:

    ```java tab=”Java”
    CallbackManager facebookCallbackManager = CallbackManager.Factory.create();

    GetSocial.registerInviteChannelPlugin(
    InviteChannelIds.FACEBOOK,
    new FacebookSharePlugin((Activity)this, facebookCallbackManager));

    ```kotlin tab="Kotlin"
    val facebookCallbackManager = CallbackManager.Factory.create()
    
    GetSocial.registerInviteChannelPlugin(InviteChannelIds.FACEBOOK,
        FacebookSharePlugin(this@MainActivity, facebookCallbackManager))
    

If you want to check Facebook’s referral data on your own, use the following property in your gradle file:

getsocial {
    ...
    disableFacebookReferralCheck true
}

Setup Integration with VK SDK

Integration does not require VK application installed to be able to send invitations.

  1. Integrate VK Android SDK into your app as described in the Official Guide.
  2. Copy implementation of the VK Invite plugin from GetSocial GitHub repository into your project.
  3. Register plugin with GetSocial:

    ```java tab=”Java”
    GetSocial.registerInviteChannelPlugin(
    InviteChannelIds.VK,
    new VKInvitePlugin((Activity)this));

    ```kotlin tab="Kotlin"
    GetSocial.registerInviteChannelPlugin(
            InviteChannelIds.VK,
            VKInvitePlugin(this@MainActivity))
    

Setup Integration with KakaoTalk SDK

To be able to send Smart Invites via KakaoTalk, GetSocial requires:

  1. Mobile KakaoTalk application installed.
  2. Integration with KakaoTalk SDK.

Following steps will guide you through integration with KakaoTalk SDK:

  1. Integrate KakaoTalk Android SDK into your app as described in the Official Guide. Alternatively (if you are not good with the Korean language), follow the steps below.
    1.1. In your project, open build.gradle.
    1.2. Add KakaoTalk to the list of repositories:

    repositories {
        maven { url 'http://devrepo.kakao.com:8088/nexus/content/groups/public/' }`
    }
    

    1.3. Add dependency to kakaolink library:

    dependencies {
        compile 'com.kakao.sdk:kakaolink:1.0.52'
    }
    

    1.4. Create the new app on Kakao Developers Dashboard.
    1.5. Provide keystore sha1 fingerprint on the Dashboard. To get hash, use the command:

    keytool -exportcert -alias [release_key_alias] -keystore [release_keystore_path] | openssl sha1 -binary | openssl base64
    

    1.5. Add GetSocial Smart Link domain to the list of Site Domains on Kakao Developers Dashboard:

    Kakao Developers Site Domain Configuration

    1.6. In your project, open AndroidManifest.xml.
    1.7. Add a meta-data referencing Kakao App Key to the application element:

    <application android:label="@string/app_name" ...>
        ...
        <meta-data android:name="com.kakao.sdk.AppKey" android:value="[put your app key here]"/>
        ...
    </application>
    
  2. When KakaoTalk SDK is added to the project, let’s integrate it with GetSocial.

  3. Copy implementation of the Kakao Invite plugin from GetSocial GitHub repository into your project.
  4. Register plugin with GetSocial:

    ```java tab=”Java”
    GetSocial.registerInviteChannelPlugin(
    InviteChannelIds.KAKAO,
    new KakaoInvitePlugin((Activity)this)
    );

    ```kotlin tab="Kotlin"
    GetSocial.registerInviteChannelPlugin(
                    InviteChannelIds.KAKAO,
                    KakaoInvitePlugin(this@MainActivity))
    

  5. To validate integration, open the GetSocial Smart Invites view:

    ```java tab=”Java”
    GetSocialUi.createInvitesView().show();

    ```kotlin tab="Kotlin"
    GetSocialUi.createInvitesView().show()
    

    The list should contain Kakao:

    GetSocial Smart Ivites View

Next Steps

Give us your feedback! Was this article helpful?

😀 🙁