Introduction

This Tutorial aims to teach the user how to integrate his iOs app with Appgain.io cloud using appgain.io SDK and how to use the appgain.io products

Prerequisites

Installing SDK

  1. Install SDK from cocoa Pod

  2. Open terminal

    cd your-application-directory pod init.

  3. Navigate to project directory will find podFile

  4. Open it and add pod ‘Appgain’.
  5. press ctrl + S

    pod update pod install

  6. Wait until pod finish install.

  7. Open your project from your-application.xcworkspace

  8. Configure SDK in app delegate.

  9. Allow application to access network by adding this in plist file.

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    
  10. You need to add your URL schema and Associated domain for your app , the value will be :

projectsubdomain.appgain.io or your custom domain if you have confgured it in project settings

  1. In AppDelegate.h, add

        #import <Appgain/Appgain.h>
    
  2. In AppDelegate.m , Inside didFinishLaunchingWithOptions add

        -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
                //configure
                [AppGain initializeAppWithID:<your app id  andApiKey: <—-your app api key —— whenFinish:^(NSURLResponse *response, NSMutableDictionary *result) {
                    //after app finish configure.
                    //response for match app to link.
                    //result show link matched data.}];
            return YES;
        }
    

Swift

• Create <project-name -Bridging-Header.h

• add this on it #import

    Inside didFinishLaunchingWithOptions

        AppGain.initializeApp(withID: <your-app-id> , andApiKey: <your-app-api-key )

            { (response, result) in


            }