Skip to main content

Integration

Add the Swift Package using Swift Package Manager.

SDK initialization

Initialize the SDK as soon as possible on your App life cycle.
Appdelegate.swift
let config = Configuration(
				clientID: "###CLIENT_ID###", 
				clientSecret: "###CLIENT_SECRET###", 
				appID: "###APP_ID###", 
				scope: "###SCOPE###", 
				debug: true/false)

let _ = AppinionSDK(with:config) { error in
	if let error {
	//TODO: Handle error
	}
}

Configure a stage

On the Viewcontroller you wish to call the proactive feedback prompt, first configure your stage.
The STAGE NAME must match the on you have created on the Appinion Dashboard.
ViewController.swift
var config = StoreFeedbackConfiguration(stage: ###STAGE_NAME###)
config.userData = ExtraInfo(user_id: ##OTHER INFO##) //Example

Launch Proactive feedback prompt

Launch the Proactive feedback prompt with the configuration for this stage.
ViewController.swift
StoreFeedbackManager.shared.start(on: ###LAUNCHING_VIEWCONTROLLER###, 
					   configuration: config) { ready in

	if(ready) {
		DispatchQueue.main.async {
			self.rsm.askFeedback()
		}
	}
}