Getting Started with GetSocial Unity SDK

Welcome to Getting Started section of GetSocial documentation. Here you’ll find guides that describe how to accomplish a specific task with code samples you can re-use in your app.

System Requirements

In order to use GetSocial SDK your execution and development environment should match following requirements:

  • Unity 5.2 or above
  • To deploy on Android:

    • Android v4.0.3 (SDK v15) or higher
    • Android Developers Tools (ADT) version 19 or above
    • Google Play Services library v6.1.11 or above (for push notifications)
  • To deploy on iOS:

    • Xcode 8 or above
    • iOS 8 or higher

Not sure if GetSocial is going to work in your specific configuration, need support for the earlier versions of Unity? Feel free to reach us via Intercom or support@getsocial.im.

Creating a GetSocial Account

To start using GetSocial you have to create an account and login to GetSocial Dashboard. Dashboard provides a web interface to manage all GetSocial services.

GetSocial Dashboard

Adding GetSocial to Your Project

Import .unitypackage

  1. Download the latest GetSocial .unitypackage from our GitHub repository.
  2. Open your Unity project.
  3. Go to Assets → Import Package → Custom Package…, select downloaded .unitypackage and import all assets:

    Unity - Import all GetSocial Assets

  4. After the the project build you have to see GetSocial menu:

    Unity - GetSocial Menu

Well-done, GetSocial SDK is now part of your project. Time to configure it.

Configure GetSocial SDK

  1. Get your GetSocial App Id from the “App settings” section on the GetSocial Dashboard:

    GetSocial App Id

  2. Open GetSocial settings, go to GetSocial → Edit Settings:

    Unity - GetSocial Menu

  3. Press “Setup GetSocial” button to make required Unity project changes and copy GetSocial libraries to Plugins folder.

  4. Fill in the GetSocial App Id from Step 1.
  5. Select GetSocial modules to include in the project. If you do not plan to use GetSocial UI, uncheck corresponding setting in “Enabled Modules” section.

Configure Android Build

To start using GetSocial on Android we have to configure few more options in the GetSocial menu.

  1. Open GetSocial settings, go to GetSocial → Edit Settings.
  2. Open “Android Settings” section:

    Unity - GetSocial Settings

    If your project do not have AndroidManifest.xml yet, you will see a button to create it. Press the button.

  3. When Android Manifest will be in-place, press “Check Dependencies and AndroidManifest.xml” button, you will see result of analysis.

    Unity - GetSocial Settings

  4. To start using GetSocial your Android Manifest must pass all dependencies checks and have properly configured permissions, meta tags and content provider. Press corresponding fix buttons in analysis results to configure manifest.

    Unity - GetSocial Settings

Configure iOS Build

Basic GetSocial features on iOS will work right after configuring App Id in the GetSocial Settings. Let’s move on to the next step.

Start Using GetSocial

If the previous steps were executed properly at this point you have to be able to start using GetSocial. Let’s try to send a GetSocial Smart Invite via Email.

GetSocial SDK do not work in Unity Editor

Please note, that GetSocial SKD in Unity Editor is mocked. To test SDK features run the app on the Android/iOS emulators or real devices.

To run the test, add the code below to any button callback:

1
2
3
4
5
GetSocial.SendInvite(InviteChannelIds.Email,
    onComplete: () => Debug.Log("Invitation via EMAIL was sent"),
    onCancel: () => Debug.Log("Invitation via EMAIL was cancelled"),
    onFailure: (error) => Debug.LogError("Invitation via EMAIL failed, error: " + error.Message)
);

After calling this method email client will be opened:

GetSocial Smart Invite over Email

GetSocial UI

GetSocial UI module contains easy to customize views for all GetSocial features.

To start using GetSocial UI, create and show any of provided views, e.g. code below will create and show GetSocial Smart Invites view:

1
2
bool wasShown = GetSocialUi.CreateInvitesView().Show();
Debug.Log("Smart Invites view was shown: " + wasShown);

After invoking code above, GetSocial Smart Invites view will be shown:

GetSocial Smart Invites View

Note

The list of Smart Invites Channels in the view above will contain all social apps that are enabled on the GetSocial Dashboard and installed on the device.

Next Steps

Well-done! GetSocial SDK is now set up and ready to rock, check what you can do next: