Initializing the SDK
- First, import
MetricSDK
into your project within yourAppDelegate
class
...
import MetricSDK
...
- 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).