This repository contains all Dropthought iOS SDK sources.
- 5.12.0
- Statement
- File upload
- Poll
- Auto Close on End Page
- Bijliride Theme
- Picture Choice
- Matrix choice
- Multiple open question
- Matrix rating
- Dropdown
- Rating slider
- Ranking
- iOS 12.0+
Contact Customer Support at cs@dropthought.com to get help on how to publish your program through SDK.
Select Download ZIP to download source files to your computer.
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.
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
Note: You need to import Dropthought whenever you want to use our SDK
import DropthoughtNote: 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
}// 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
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"])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.
Note: You need to import Dropthought.h whenever you want to use our SDK
#import "Dropthought.h"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;
}// 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
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];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.



