Skip to content

Setup Invites Channels on Unity

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.

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 Unity SDK v7.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 Unity 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 before inviting via Facebook. We recommend registering in GameObject.onStart() method:

    void Start () {
        // ... other code
        GetSocial.RegisterInviteChannelPlugin(InviteChannelIds.Facebook, new FacebookSharePlugin());
    }
    
  4. To validate integration, open the GetSocial Smart Invites view:

    GetSocialUi.CreateInvitesView().Show();
    

    The list should contain Facebook:

    GetSocial Smart Ivites View

If you want to check Facebook’s referral data on your own, use the following setting:

Unity - GetSocial Menu

Setup Integration with Facebook Messenger for iOS

To enable FB Messenger invites on iOS:

  1. Download GetSocialFBMessengerInvitePlugin.unitypackage from our GitHub Repo.

  2. Imprort this package into your Unity project.

  3. Call GetSocialFBMessengerPluginHelper.RegisterFBMessengerPlugin(); on the app start, e.g., from Awake() method of your MonoBehaviour.

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

    GetSocialUi.CreateInvitesView().Show();
    

    Check if Facebook Messenger is listed there:

    GetSocial Smart Invites View

Setup Integration with Facebook Stories for iOS

  1. Integrate Facebook iOS SDK into your app as described in the Official Guide.
  2. Make sure, that the Facebook Stories provider is enabled on Dashboard.

Next Steps

Give us your feedback! Was this article helpful?

😀 🙁