Setup Invite Channels on Android¶
Prerequisite¶
- Finished Getting Started with GetSocial Android SDK guide.
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/
- Integrate Facebook Android SDK into your app as described in the Official Guide.
- Copy implementation of the Facebook Share plugin from GetSocial GitHub repository into your project.
-
Register plugin with GetSocial:
CallbackManager facebookCallbackManager = CallbackManager.Factory.create(); Invites.registerPlugin( InviteChannelIds.FACEBOOK, new FacebookSharePlugin((Activity)this, facebookCallbackManager));
val facebookCallbackManager = CallbackManager.Factory.create() Invites.registerPlugin(InviteChannelIds.FACEBOOK, FacebookSharePlugin(this@MainActivity, facebookCallbackManager))
If you want to check Facebook’s referral data on your own, use the following property in your getsocial.json
file:
{
...
"disableFacebookReferralCheck": true
}
Setup Integration with VK SDK¶
Integration does not require VK application installed to be able to send invitations.
- Integrate VK Android SDK into your app as described in the Official Guide.
- Copy implementation of the VK Invite plugin from GetSocial GitHub repository into your project.
-
Register plugin with GetSocial:
Invites.registerPlugin( InviteChannelIds.VK, new VKInvitePlugin((Activity)this));
Invites.registerPlugin( InviteChannelIds.VK, VKInvitePlugin(this@MainActivity))
Setup Integration with KakaoTalk SDK¶
To be able to send Smart Invites via KakaoTalk, GetSocial requires:
- Mobile KakaoTalk application installed.
- Integration with KakaoTalk SDK.
Following steps will guide you through integration with KakaoTalk SDK:
-
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, openbuild.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:
1.6. In your project, open
AndroidManifest.xml
.
1.7. Add a meta-data referencing Kakao App Key to theapplication
element:<application android:label="@string/app_name" ...> ... <meta-data android:name="com.kakao.sdk.AppKey" android:value="[put your app key here]"/> ... </application>
-
When KakaoTalk SDK is added to the project, let’s integrate it with GetSocial.
- Copy implementation of the Kakao Invite plugin from GetSocial GitHub repository into your project.
-
Register plugin with GetSocial:
Invites.registerPlugin( InviteChannelIds.KAKAO, new KakaoInvitePlugin((Activity)this) );
Invites.registerPlugin( InviteChannelIds.KAKAO, KakaoInvitePlugin(this@MainActivity))
-
To validate integration, open the GetSocial Smart Invites view:
InvitesViewBuilder.create().show();
InvitesViewBuilder.create().show()
The list should contain Kakao:
Next Steps¶
- Send your first Smart Invite.
- Customize Smart Invite content.
- Secure Smart Invites with the Webhooks.
- Understand GetSocial Analytics for Smart Invites.