Skip to main content

Usage SDK

Initialization

First, import the following frameworks to your AppDelegate file.
import FeatureUsage
And then, add the following code inside didFinishLaunchingWithOptions’s AppDelegate
Wave.shared.setup(apiKey: "your_api_key")
The code above is used to initialize the WaveSDK, you must pass the api_keyprovided by Wave. Your code will look like this:
class AppDelegate: NSObject, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        Wave.shared.setup(apiKey: "")
        print("AppDelegate didFinishLaunching")
        return true
    }
}

Usage

You can start using the Usage feature by adding the following code: First, import the FeatureUsage
import FeatureUsage
The Usage Feature is customizable and allows you to choose between two types of charts: semicircular and bar. To define the chart type when calling the method, use the choosing by the following parameters: .bar or .semicircle. Therefore, when calling the HomeUsageView() component, you must insert the selected chart.
HomeUsageView(externalCode: "your_external_code", chartType: .semicircle)
With this, the Wave Usage feature will already be integrated into your application.