> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appinion.pt/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS

### Integration

Add the Swift Package using Swift Package Manager.

### SDK initialization

Initialize the SDK as soon as possible on your App life cycle.

```swift Appdelegate.swift theme={null}
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.

<Info>
  The STAGE NAME must match the on you have created on the Appinion Dashboard.
</Info>

```swift ViewController.swift theme={null}
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.

```swift ViewController.swift theme={null}
StoreFeedbackManager.shared.start(on: ###LAUNCHING_VIEWCONTROLLER###, 
					   configuration: config) { ready in

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