Skip to content

Getting started with GetSocial Unity SDK

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

System Requirements

To use GetSocial SDK your execution and development environment should match the following requirements:

  • Unity 2018.2 or newer.
  • 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 11 or above
    • iOS 8 or higher

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

Adding GetSocial to Your App

Create App on the Dashboard

  1. Login to GetSocial Dashboard.
  2. Open Add new app wizard.
  3. Fill in App name and upload App icon image.
  4. Select Unity platform and Finish the wizard.

Configure GetSocial Editor Plugin

  1. Download the latest GetSocial .unitypackage from the Downloads page.
  2. In your Unity project go to AssetsImport PackageCustom Package…, select downloaded .unitypackage and import all assets:

    Unity - Import all GetSocial Assets

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

    Unity - GetSocial Menu

  4. Configure GetSocial App Id, go to GetSocialEdit Settings:

    Unity - GetSocial Menu

    You can find GetSocial App id in the App settings section on the GetSocial Dashboard:

    GetSocial App Id

  5. Validate Android and iOS Settings.

    After specifying App id GetSocial Unity plugin will get application configuration from the GetSocial Dashboard and display it inside Unity. You can change the values by clicking on them (Dashboard will be opened):

    Keystore SHA 256 hash

Enable Supported App Stores on the Dashboard

Next step is to enable Google Play and Apple App Store on the GetSocial Dashboard:

  1. On the App settings section → App information tab.
  2. Enable Google Play store → fill in Package name and Signing-certificate fingerprint fields.

    Create new app on GetSocial Dashboard

    Package name is Bundle Identifier of your application in Player Settings.

    Signing-certificate fingerprint is a SHA-256 hash of the keystore you use to sign your application. To get it, open GetSocial settings in Unity, go to GetSocialEdit Settings:

    Keystore SHA 256 hash

  3. Enable Apple App Store → fill in Bundle ID, Team ID and optionally App Store ID fields:

    Create new app on GetSocial Dashboard

    Bundle ID is Bundle Identifier of your application in Player Settings.

    Team ID is a unique 10-character string generated by Apple that’s assigned to your team. You can find your Team ID using your Apple developer account → Membership.

    App Store ID number can be found in the iTunes store URL as the string of numbers directly after id. For Example, in https://itunes.apple.com/us/app/yourapp/id284709449 the ID is: 284709449.

GetSocial SDK Size

Android

Due to limited resources on mobile devices and 65k methods limitation in one DEX library size and added methods count play an important role in app development.

Below you can find size for GetSocial Android SDK v7.0.0. You can expect similar values for all future versions of the library.

Android Library Raw Aar Size
getsocial-core.aar 0.76 MB
getsocial-ui.aar 0.39 MB

iOS

On iOS GetSocial SDK adds ~ 1.5 MB to the application downloadable size. Please note that GetSocial.framework size included in Unity SDK is around 66 MB. Read more about framework size on iOS.

Start Using GetSocial

At this point, you should be able to start using GetSocial. Let’s try to send our first Smart Invite with and without GetSocial UI.

GetSocial SDK supports limited number of features in Unity Editor

Please note, that GetSocial SDK works in unity editor with a limited functionality. Features like sending/receiving invites or receiving push notifications.

Using IL2CPP

If you use IL2CPP as Scripting backend and Managed Stripping Level is set to High, please add link.xml file to Assets folder with the following content in order to avoid runtime issues:

<linker>
    <assembly fullname="Assembly-CSharp">
        <type fullname="GetSocialSdk.*" preserve="all"></type>
    </assembly>
</linker>

GetSocial UI

GetSocial UI library contains easy to customize views for all GetSocial features, e.g. code below will create and show GetSocial Smart Invites view:

bool wasShown = InvitesViewBuilder.Create().Show();
Debug.Log("Smart Invites view was shown: " + wasShown);

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

GetSocial Smart Invites View

Why there are only a few apps?

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

GetSocial without UI

If you plan to build your own UI, you can remove GetSocial UI library from dependencies and use only GetSocial data layer. To run the test, add the code below to any button callback:

Invites.Send(null, InviteChannelIds.Email,
    () => {
        Debug.Log("Invitation via EMAIL was sent");
    },
    () => {
        Debug.Log("Invitation via EMAIL was cancelled");
    },
    (error) => {
        Debug.LogError("Invitation via EMAIL failed, error: " + error.Message);
    });

After calling this method email client will be opened:

GetSocial Smart Invite over Email

SDK Initialization

GetSocial SDK is auto-initialized, just provide a GetSocial App Id in the GetSocial settings in Unity editor, and we will do the magic.

Manual Initialization

If you want to initialize GetSocial SDK manually, check this topic.

Most of GetSocial APIs require the SDK to be initialized. You can check the SDK initialization state synchronously or asynchronously.

if (GetSocial.IsInitialized) {
    // use GetSocial
}

If you want to be notified about initialization complete, you can set an action, that will be invoked when SDK gets initialized or invoked immediately if it is already initialized:

GetSocial.AddOnInitializedListener(() => {
    // GetSocial is ready to be used
});

Demo Application

To showcase all GetSocial SDK features, we have created a simple demo application. Explore it on the GitHub.

Next Steps

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

Give us your feedback! Was this article helpful?

😀 🙁