Initialization
To initialize the SDK you have to add MBAudience to the array of plugins of MBurger.
1
import MBurgerSwift
2
import MBMessagesSwift
3
​
4
...
5
​
6
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
7
​
8
MBManager.shared.apiToken = "YOUR_API_TOKEN"
9
MBManager.shared.plugins = [MBAudience()]
10
​
11
return true
12
}
Copied!
You can set a delegate when initializing the MBAudience plugin, the delegate will be called when audience data are sent successfully to the sever or if the sync fails
1
let audiencePlugin = MBAudience(delegate: [the delegate])
Copied!
Last modified 1yr ago
Copy link