GetSocial iOS SDK Manual Integration Guide¶
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. GetSocial SDK is available via CocoaPods.
- Follow the official guide or the guide below to set up CocoaPods in your project:
Add the GetSocial SDK pods to your
pod "GetSocial/Core" pod "GetSocial/UI"
GetSocial/UIdependency only if you plan to use GetSocial UI.
Change the deployment target in the podfile if is different from the one you defined in your project.
From the terminal, install the SDK:
Make sure that from now on, you open the
.xcworkspaceinstead of the
Integrating the Dynamic Framework¶
- Download the latest GetSocial frameworks from the Downloads page.
GetSocial.frameworkand, if you plan to use GetSocial UI,
GetSocialUI.frameworkinto your project.
GetSocialUI.frameworkinto the Embedded Binaries section of your target:
Add a new
Run Scriptphase in your target’s
Build Phases. Paste the following line in this Run Script Phase’s script text field:
Avoid App Store Rejections
If an iOS framework contains a fat binary with the simulator (i386/x86_64) and device (ARM) slices, any application that attempts to embed that framework will be rejected from App Store submission. This script works around an App Store submission bug triggered by universal binaries.
Run Script Phaseis below the
Embed Frameworksbuild phase. You can drag and drop build phases to rearrange them:
The last step before using GetSocial is to add your GetSocial App Id to
Get your GetSocial App Id from the “App settings” section on the GetSocial Dashboard:
Add an element to the root of the
Info.plistwith the key
im.getsocial.sdk.AppIdand value of your GetSocial App Id:
Setup URL Schemes for Invite Channels¶
Since iOS 9, Apple requires apps to specify which URL schemes will be used inside the app. The GetSocial SDK uses URL schemes to interact with some of the Invite Channels, therefore you will need to add them to the
- In your project open
Create a new plist item with name
Arraytype and following URL schemes as elements:
1 2 3 4 5 6 7 8
<key>LSApplicationQueriesSchemes</key> <array> <string>kik-share</string> <string>line</string> <string>tg</string> <string>viber</string> <string>whatsapp</string> </array>
In the editor result should look like:
Setup Url Schemes for iOS 8¶
Deep linking on iOS 8 works through Url Schemes. You can register an Url Scheme like
getsocial:// in your app, and the OS will open your app when the user clicks on a link or is redirected to an URL that starts with that Url Scheme.
To register an Url Scheme in your app, open the
.plist file in your project and create an array key called
URL types with a single array sub-item called
Add a single string item inside with this content
getsocial-[GETSOCIAL_APP_ID]. You can find the
[GETSOCIAL_APP_ID] in the App Settings section of the GetSocial Dashboard.
1 2 3 4 5 6 7 8 9
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>getsocial-[GETSOCIAL_APP_ID]</string> </array> </dict> </array>
Setup Universal Links for iOS 9+¶
Apple introduced Universal Links on iOS 9 to remove some of the pain points of Url Schemes. Universal Links allows you to use regular URLs instead of the Url Schemes and takes care automatically of the fallback if your app is not installed on the device.
Although Universal Links sound great, their configuration can be a bit painful.
Let us help you through the setup process:
- Open your Xcode project.
Enable Associated Domains in your app. In Xcode, go to Capabilities tab → Associated Domains section and copy Smart Invite Link domain from the GetSocial Dashboard.
There are two options:
If you are using prefix for
gsc.imdomain for Invite Links, you have to add following two lines to Associated Domains:
If you are using custom domain for Invite Links:
For instance for our Documentation Demo app we use prefix for
gsc.imdomain for Invite Links, Associated Domains configuration will be the following:
Enable/Disable GetSocial Notifications on the Client Side¶
By default on the application start, GetSocial SDK automatically register at push server, and the user will start receiving push notifications.
To prevent this behaviour:
im.getsocial.sdk.AutoRegisterForPushproperty with value
To start receiving GetSocial push notifications call:
To enable push notifications, just remove the
im.getsocial.sdk.AutoRegisterForPush property in from
.plist or set its value to
Show Notifications In Foreground¶
im.getsocial.sdk.ShowNotificationInForeground property with value
YES in your
To load UI Configuration file
im.getsocial.sdk.UiConfigurationFile property with value
getsocial/ui-landscape.json in your