Skip to main content

Initializing the SDK

  1. First, import MetricSDK into your project within your AppDelegate class
...
import MetricSDK
...
  1. Within your didFinishLaunchingWithOptions function, you can initialise your SDK with the .initialize function.
 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
...
Metric.initialize(clientKey: "<Your client key here>",
secretKey: "<Your secret key here>")
...

To learn how to generate the clientKey and secretKey, kindly refer to this section of the documentation (Generate Id and Secret pair).