launch in existing app - GluedIn
Steps to configure SDK in existing app

Setup your development environment

  • Open terminal and add your project folder in terminal directory.
  • Run the “Pod init” command on the terminal incase there is no podfile in your project root folder.
  • Open Podfile in textedit, as shown in below image.
  • Add below listed pods code inside your pod file, as shown below.pod ‘GluedInSDK’pod ‘Alamofire’ (If required, and if you got a console error like – Frameworks/Alamofire.framework/Alamofire Symbol not found: _$s9Alamofire21URLRequestConvertibleP02asB010Foundation0B0VyKFTq)>
  • Open the terminal again and execute the “pod install” command. All the necessary dependencies along with Gluedin SDK will install in targeted projects.
Configuration

Mandatory

  • Right-click Info.plist, and choose Open As ▸ Source Code. Copy and paste the following XML snippet into the body of your file ( ...).
        <key>NSAppTransportSecurity</key>
      <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
      </dict>
      <!-- if you get custom server URL from +SAW Support team, then change this server URL key with the provided api endpoint base url -->
      <key>SERVER_URL</key>
      <string>${SERVER_URL}</string>
    
      <!-- Change API key in place of test which you have received from +SAW console console  -->
      <key>API_KEY</key>
      <string>Replace your App Key</string>
    
      <!-- Change Secret key in place of test which you have received from +SAW console console  -->
      <key>SECRET_KEY</key>
      <string>Replace your secret key</string>
    
      • Replace API_KEY and SECRET_KEY with your keys received from GluedIn console.
  • Add below permission in your info plist XML snippet into the body of your file ( ...).
        <key>NSCameraUsageDescription</key>
      <string>$(PRODUCT_NAME) app wants to access your video camera for record video and edit for that</string>
      <key>NSPhotoLibraryAddUsageDescription</key>
      <string>$(PRODUCT_NAME) app wants to save pictures and videos to your library and edit for that</string>
      <key>NSMicrophoneUsageDescription</key>
      <string>$(PRODUCT_NAME) app wants to access your microphone to record audio with video</string>
      <key>NSUserTrackingUsageDescription</key>
      <string>$(PRODUCT_NAME) will be used to deliver personalized ads to you.</string>
    
      <key>GADApplicationIdentifier</key>
      <string>ca-app-pub-3893727616817499~4911050982</string>
    
    
  • Add below facebook elements in your info plist XML snippet into the body of your file ( …). All facebook required keys can get from the facebook. developer portal console. Link:https://developers.facebook.com/apps/?show_reminder=true
    • LSApplicationQueriesSchemes: you can get values from facebook developer console.
    • FacebookAppID : Facebook App Id which you get from facebook developer console.
    • FacebookClientToken: Facebook Client token which you get from facebook developer console.
    • FacebookDisplayName: Facebook display name which you get from facebook developer console.
           <key>LSApplicationQueriesSchemes</key>
      <array>
        <string>fbapi</string>
        <string>fbapi20130214</string>
        <string>fbapi20130410</string>
        <string>fbapi20130702</string>
        <string>fbapi20131010</string>
        <string>fbapi20131219</string>
        <string>fbapi20140410</string>
        <string>fbapi20140116</string>
        <string>fbapi20150313</string>
        <string>fbapi20150629</string>
        <string>fbapi20160328</string>
        <string>fbauth</string>
        <string>fb-messenger-share-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
        <string>instagram</string>
        <string>fb</string>
      </array>
    <key>FacebookAppID</key>
    <string>248113447230045</string>
    <key>FacebookClientToken</key>
    <string>bbe9f698aecad7da2a10cae6d884ca08</string>
    <key>FacebookDisplayName</key>
    <string>GluedIn App</string>
    
    
    
  • Add below Bundle Url types elements in your info plist XML snippet into the body of your file ( ...).
         <key>CFBundleURLTypes</key>
      <array>
        <dict>
          <key>CFBundleTypeRole</key>
          <string>Editor</string>
          <key>CFBundleURLName</key>
          <string>Facebook SignIn</string>
          <key>CFBundleURLSchemes</key>
          <array>
            <string>fb248113447230045</string>
          </array>
        </dict>
        <dict>
          <key>CFBundleTypeRole</key>
          <string>Editor</string>
          <key>CFBundleURLName</key>
          <string>Google SignIn</string>
          <key>CFBundleURLSchemes</key>
          <array>
            <string>${REVERSED_CLIENT_ID}</string>
          </array>
        </dict>
      </array>
    
    
  • Add Apple sign in capability Add Apple Sign in Capability as shown in below image
  • Change GoogleService-Info plist files: Download GoogleService-Info file from google console and Drag and Drop GoogleService-Info plist file inside your project file, So it will look like the screen below.

Optional

  • Apply custom color theme for your app:Drag and Drop app theme file inside the project. Drag and drop AppTheme.json file inside your app project, app theme json file link can be found here for further change and use. As Shown in shinipet below, you can change button active, outline action color etc. In case if you leave blank then the application will run with the default Blue color theme.
      themeConfig": {
        "appColor": {
          "buttonActiveColor": "",
          "outlineButtonColor": "",
          "iconColor": "",
          "appPrimaryColor": "",
          "appSecondaryColor": "",
          "textColorBlack": "",
          "actionColorDefault": "",
          "dividerOutlineColor": "",
          "inActiveButtonColor": "",
          "inActiveButtonTitleColor": "",
          "selectedCellColor": "",
          "textfieldBorderColor": "",
          "secondaryButtonColor": "",
          "unreadNotification": ""
        },
      
    
Sign-in Sync section
This method will use if App has its own authentication in place, in that case they need to call “quickLaunch” method on @action entry point:
  • methods : quickLaunch.
  • Parameter:
  • Email (Mandatory field): “your logged in user email id”.
  • Password (Mandatory field): “your logged in user password”.
  • deviceId (Mandatory field): “device ID” .
  • deviceType (Mandatory): “iOS” .
  • fullName (Mandatory): “ logged in user full name” .
  • Sample to call:
      
      GluedinSDK.shared.quickLaunch(email: "amitch184@gmail.com",
              password: "123456789",
                                          firebaseToken: "",
                                          deviceId: "123456",
                                          deviceType: "ios",
                                          fullName: "Amit Choudhary",
                                          autoCreate: true) { vw in
                self.navigationController?.pushViewController(vw  ?? UIViewController(), animated: true)
            } failure: { error in
                print(error)
            }
    
    
    
Entrypoint Configurations
  • Go to scene delegate and import GluedIn SDK as show below.
  • Launch Gluedin Dashboard as a Guest user on Button click:


    call Gluedin Root tab view controller and initiate the navigation flow which is best fit for your application. We show sample code below:
      
      @IBAction func launchGluedinTabAsGuest(_ sender: Any) {
            GluedIn.shared.initSdk {
                let gluedinTab:UITabBarController = GluedIn.shared.rootTabController() ?? UITabBarController()
                self.navigationController?.pushViewController(gluedinTab, animated: true)
            } failure: { error, code in
                print(error)
            }
        }
    
    
  • Launch Gluedin SDK with Authentication Module:


    call Gluedin Signin screen method to init gluedin authentication module before going any other screen and process the navigation flow which fits to your application. We show the sample code below:
      
     @IBAction func launchGluedinAuthScreen(_ sender: Any) {
            GluedIn.shared.initSdk {
                let rootController =  GluedIn.shared.rootControllerWithSignIn()
                self.navigationController?.pushViewController(rootController ?? UIViewController(), animated: true)
            } failure: { error, code in
                print(error)
            }
        }
    
    
  • Register User and launch Gluedin Root controller as a authenticated user:


    call to register the user method with multiple parameter and call the root controller once you get the call back from register user method. We show the sample code below:
      
     @IBAction func registerUserAndlaunchGluedin(_ sender: Any) {
            GluedIn.shared.initSdk {
                GluedIn.shared.quickLaunch(email: "amitch184@gmail.com",
                                           password: "123456789",
                                           firebaseToken: "",
                                           deviceId: "1234",
                                           deviceType: "ios",
                                           fullName: "amit",
                                           autoCreate: true,
                                           termConditionAccepted: true) { [weak self] vw in
                    guard let weakSelf = self else { return }
                    weakSelf.navigationController?.pushViewController(vw ?? UIViewController(), animated: true)
                } failure: { err,arg  in
                    print(err)
                    print(arg)
                }
            } failure: { err,arg  in
                print(err)
                print(arg)
            }
        }
    
    
  • Initialised GluedInSDK and call entry point:call Signin controller at root view controller or any other entry point from where you wanted to get entered in GluedIn SDK (i.e. On Tabbar controller/ any button click). Please see below implementation for rootviewcontroller on scene delegate. Replace “willConnectTo” inside scene delegate class.
      
      func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
            guard let windowScene = scene as? UIWindowScene else { return }
            window = UIWindow(windowScene: windowScene)
            window?.rootViewController = UIStoryboard(name: "LaunchScreen", bundle: nil).instantiateInitialViewController()
            window?.makeKeyAndVisible()
            let controller: UIViewController = GluedinSDK.shared.rootControllerWithSignIn() ?? UIViewController()
                let navigationController = UINavigationController(rootViewController: controller ?? UIViewController())
                self.window?.rootViewController = navigationController
        }
    
    
Execute the project:
  • Run the project GluedIn
Pay as you grow