Add the iOS SDK via SPM

Sense360 supports Swift Package Manager (SPM) with Xcode. Swift Package Manager support requires Xcode 15 or higher.
  1. In Xcode, navigate to File > Add Packages...

    Alternatively, select your project in the Project Editor, go to the Package Dependencies tab and click Add icon. Add.

  2. Select the Sense360 iOS GitHub repository.
    Enter this GitHub repository URL on the search bar:
    https://github.com/medallia/sense360-ios-sdk

    Enter https://github.com/medallia/sense360-ios-sdk on the search bar at the top right of the dialog.

  3. Select the Sense360 iOS SDK version
    For new projects, we recommend using the newest version of the Sense360 iOS SDK.

    By default, Up to Next Major Version is selected. To integrate a specific version of the Sense360 iOS SDK, specify the version number you need.

    Set the version number.

  4. Click Add Package
    Wait for Xcode to finish verifying and downloading the Swift package into your project

    Downloading package.

  5. Choose the Sense360 iOS SDK product
    After selecting the product, click Add Package to include it in your application.
    Choose the package product(s) to add to your application.
  6. Implement Sense360.restore
    1. On the AppDelegate of your app, add this line at the end of the import list:
      import SenseQuinoaLib
      Note: Make sure to import SenseQuinoaLib anytime you reference the Sense360 public class.
    2. Add this code snippet to the AppDelegate class:
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
              // Override point for customization after application launch.
              let _ = Sense360.restore(sendNotifications: true)
              UNUserNotificationCenter.current().delegate = self
              
              return true
          }
      
  7. Implement Sense360.start()
    Call Sense360.start() method once the user has granted .authorizedAlways location permissions and only once during the permission request flow.
    func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
            switch status {
            case .notDetermined, .denied, .restricted:
                    // Do some thing
            case .authorizedWhenInUse:
                  //  Proceed to subsequent request
            default:
                break
            }
        }
    
    func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
            switch status {
            case .authorizedAlways:
                try! Sense360.passThirdPartyUserId("1234") // Contact Sense360 Support to obtain the ID
                let _ = Sense360.start(sendNotifications: true)
            default:
                break
            }
        }
    
    Note: The above example uses the Sense360 SDK to notify survey availability.
You have now integrated the Sense360 SDK for iOS via SPM.