Skip to content

Instantly share code, notes, and snippets.

@hemanath-ss
hemanath-ss / survey_widget.js
Created January 27, 2023 05:25
Additional script code to block the survey_widget popup control at JS level
// This is a fairly brute-force
// attempt to make sure that if
// you don't want to fill in the survey
// or already did fill it in, you
// won't be asked again for a long time.
jQuery( document ).ready(function() {
if (jQuery('#ss_survey_widget').length != 1) {
return;
}
@hemanath-ss
hemanath-ss / AddCustomParamsSsViewControllerSurveyInstructions.md
Created April 16, 2021 12:55
Survey Sparrow iOS SDK - SDK integration - Add custom params to survey

Add custom params to a SsSurveyViewController

Use the created SsSurveyViewController and set params

var params = [String: String]()
params["email"] = "someone@email.com";
ssSurveyViewController.params = params;
@hemanath-ss
hemanath-ss / SsSurveyDelegetHandleResponseInstructions.md
Created April 16, 2021 12:49
Survey Sparrow iOS SDK - SDK integration - Handle survey response

Handle response

Implement the SsSurveyDelegate protocol to handle survey responses.

class ViewController: UIViewController, SsSurveyDelegate {
  //...
  func handleSurveyResponse(response: [String : AnyObject]) {
    // Handle response here
    print(response)
  }
 //...
@hemanath-ss
hemanath-ss / StartSsViewControllerSurveyInstructions.md
Last active April 16, 2021 12:36
Survey Sparrow iOS SDK - SDK integration - Start a survey

Present the SsSurveyViewController

present(ssSurveyViewController, animated: true, completion: nil)
@hemanath-ss
hemanath-ss / ConfigSsSurveyViewControllerInstructions.md
Last active April 16, 2021 12:37
Survey Sparrow iOS SDK - SDK integration - Configure SsSurveyViewController domain and token

Configure a SsSurveyViewController domain and token

Use the created SsSurveyViewController and set domain and token

ssSurveyViewController.domain = "<account-domain>"
ssSurveyViewController.token = "<sdk-token>"
@hemanath-ss
hemanath-ss / CreateSsSurveyViewControllerInstructions.md
Last active April 16, 2021 12:37
Survey Sparrow iOS SDK - SDK integration - Create and show a survey

Import framework

import SurveySparrowSdk

Create a SsSurveyViewController

let ssSurveyViewController = SsSurveyViewController()
@hemanath-ss
hemanath-ss / AddFrameworkInstructions.md
Created April 16, 2021 12:18
Survey Sparrow iOS SDK - SDK integration - Add SurveySparrowSdk Framework

Add SurveySparrowSdk Framework

Add SurveySparrowSdk Framework to your project either by using CocoaPods or directly embedding binary

Using CocoaPods

Add the following line to your Podfile file under target

pod 'SurveySparrowSdk', :git => 'https://github.com/surveysparrow/surveysparrow-ios-sdk.git', :tag => '0.2.0'

Not using CocoaPods! Directly import SurveySparrowSdk

Add SurveySparrowSdk.xcodeproj or SurveySparrowSdk.framework to your project.