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.
  • Ones that require integration of 3rd-party SDKs: Facebook.

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

Setup Integration with Facebook SDK

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:

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

    1
    GetSocialUi.CreateInvitesView().Show();
    

    The list should contain Facebook:

    GetSocial Smart Ivites View

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:

    1
    GetSocialUi.CreateInvitesView().Show();
    

    Check if Facebook Messenger is listed there:

    GetSocial Smart Invites View

Next Steps

Give us your feedback! Was this article helpful?

😀 🙁