Integrate Linkus SDK for iOS

To integrate 'Linkus SDK for iOS', you need to import 'Linkus SDK for iOS' to your iOS project and initialize it.

Requirements and Prerequisites

Requirements

Make sure that your development environment meets the following requirements:

  • iOS: Version 11 or later
  • Xcode: Version 14.3 or later
Prerequisites
You have enabled Linkus SDK and bound APNs certificate.

Demo and Source code

Before the integration, we recommend that you try out the Demo and review the source code of 'Linkus SDK for iOS' to have an overview of the framework and workflow of 'Linkus SDK for iOS'.

For more information, go to the GitHub Repository of 'Linkus SDK for iOS'.

Step 1. Import 'Linkus SDK for iOS'

Use either of the following methods to import 'Linkus SDK for iOS':
Use CocoaPods to integrate 'Linkus SDK for iOS'
Note: Before the integration, make sure that you have installed CocoaPods. For more information, see Getting Started with CocoaPods.
  1. In the iOS project, open Podfile and add the following code, then save it.
    Note: If there is no Podfile, you can enter the project root directory in Terminal and run the pod init command to generate it.
    pod 'linkus-sdk'
  2. In Terminal, run the following command to install 'Linkus SDK for iOS'.
    pod install

    After the installation is completed, the Terminal will display Pod installation complete!, and a new file with a suffix of .xcworkspace is generated under the project folder.

  3. Use Xcode to open the file with the .xcworkspace suffix.
Manually integrate 'Linkus SDK for iOS'
  1. Go to the GitHub Repository of 'Linkus SDK for iOS', and download 'Linkus SDK for iOS'.
  2. In Xcode, add the linkus_sdk_iOS.framework to the corresponding Target, and select Copy items if needed in the pop-up window.
  3. In the iOS project, go to Build Phases > Link Binary With Libraries and add the following libraries:
    libz.dylib
    libc++.dylib
    libxml2.dylib
    libresolvdylib

Step 2. Initialize 'Linkus SDK for iOS'

  1. In the iOS project, open PrefixHeader.pch file and import header files.
    #import <linkus_sdk_iOS/linkus_sdk.h>
  2. Use the following code snippet to initialize 'Linkus SDK for iOS' within the application:didFinishLaunchingWithOptions: method of AppDelegate.m file.
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        [[YLSSDK sharedYLSSDK] initApp];
        return YES;
    }

What to do next

Request the SDK login signature from PBX server for authentication and login to 'Linkus SDK for iOS'.

For more information, see Obtain Login Signature for 'Linkus SDK for iOS'.