Skip to content
 
 

Latest commit

 

History

81 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dropthought iOS Sdk

This repository contains all Dropthought iOS SDK sources.

Latest Version

  • 5.12.0

Features

  • Statement
  • File upload
  • Poll
  • Auto Close on End Page
  • Bijliride Theme
  • Picture Choice
  • Matrix choice
  • Multiple open question
  • Matrix rating
  • Dropdown
  • Rating slider
  • Ranking

Requirement

  • iOS 12.0+

Precondition

Contact Customer Support at cs@dropthought.com to get help on how to publish your program through SDK.

Installation

Step 1. Download Source Files

Select Download ZIP to download source files to your computer.


Step 2. Move/Copy Downloaded Repositories

Move/Copy these two repositories Dropthought and react-native-modules into your project root.
Note: Same path/level as the Podfile


There are two main repositories:

  • Dropthought

  • react-native-modules

The repository Dropthought contains the interfaces and functions for using Dropthought iOS SDK.

The repository react-native-modules contains the related react-native modules for Dropthought.


Step 3. Modify Your Podfile

We use CocoaPods to manage the SDK. You can find more detail about CocoaPods here
Open your Podfile and paste following scripts into your project target.
And execute pod install

+ require_relative './dropthought_sdk_pods.rb'

platform :ios, '12.0'

use_frameworks!

target '{your_project_target}' do

+  use_dropthought_sdk

post_install do |installer|
+   react_native_post_install(installer)

+   targets_to_skip_verification = [
+     'lottie-ios',
+     'lottie-react-native'
+   ]
    
+   installer.pods_project.targets.each do |target|
+     if targets_to_skip_verification.include?(target.name)
+       target.build_configurations.each do |config|
+         puts "Updating OTHER_SWIFT_FLAGS for target #{target.name} to include -no-verify-emitted-module-interface"
+         config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -no-verify-emitted-module-interface'
+       end
+     end
+   end

   {...}

end

Usage for Swift


import Dropthought SDK

Note: You need to import Dropthought whenever you want to use our SDK

import Dropthought

Initialize our SDK


Note: You can find you API key in the web dashboard. (If you don't have permission, please contact your admin)


In AppDelegate.swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    // Add this line to init our SDK
    Dropthought.instance().init(launchOptions, apiKey: "YOUR_API_KEY")

    // ...

    return true
}

Open a survey from a view controller

// self represent a UIViewController where you what to present a survey
Dropthought.instance().present(self, visibilityId: "YOUR_VISIBILITY_ID")

Note: You can find and copy your visibility ID here in Enterprise app



Additional features

- Set Survey Metadata

If you want to append metadata to each feedback. You can call this function before you open the survey

Dropthought.instance().setSurveyMetadata(metadata)

For example

Dropthought.instance().setSurveyMetadata(["name": "Barney", "age": "36"])

- Upload offline feedbacks

Dropthought SDK will cache user's feedbacks if there has no network connection. You can call this function and we will check if there's any cached feedbacks and submit them again.

When user finishes a survey under no network or a bad network, the survey feedback is saved offline. Dropthought SDK will try to upload the offline feedbacks(if any) when app start.

Or, you could call

Dropthought.instance().uploadOfflineFeedbacks()

manually to try to upload the saved results once if your app has network status monitor.

Usage for Objective-C


import Dropthought SDK

Note: You need to import Dropthought.h whenever you want to use our SDK

#import "Dropthought.h"

Initialize our SDK


Note: You can find you API key in the web dashboard. (If you don't have permission, please contact your admin)


In AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Add this line to init our SDK
    [[Dropthought instance] init:launchOptions apiKey:@"{YOUR_API_KEY}"];

    // ...

    return YES;
}

Open a survey from a view controller

// self represent a UIViewController where you what to present a survey
[[Dropthought instance] present:self visibilityId:@"{YOUR_VISIBILITY_ID}"];

Note: You can find and copy your visibility ID here in Enterprise app


- Set Survey Metadata

Note: If you want to append metadata to each feedback. You can call this function before you open the survey

[[Dropthought instance] setSurveyMetadata:(NSDictionary *)];

e.g.

NSDictionary *metadata = @{ @"name": @"Barney", @"age": @"36" };
[[Dropthought instance] setSurveyMetadata:metadata];

- Upload offline feedbacks

Dropthought SDK will cache user's feedbacks if there has no network connection. You can call this function and we will check if there's any cached feedbacks and submit them again.

When user finishes a survey under no network or a bad network, the survey feedback is saved offline. Dropthought SDK will try to upload the offline feedbacks(if any) when app start.

Or, you could call

[[Dropthought instance] uploadOfflineFeedbacks];

manually to try to upload the saved results once if your app has network status monitor.

About

Dropthought iOS SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages