Closed cliffordh closed 3 months ago
Following the iOS SDK instructions does not work, but I was able to get events to flow mimicing the Example app from 2022 in the project:
extension Amplitude {
static var amp = Amplitude(
configuration: Configuration(
apiKey: "xxx",
logLevel: LogLevelEnum.DEBUG,
callback: { (event: BaseEvent, code: Int, message: String) -> Void in
print("eventcallback: \(event), code: \(code), message: \(message)")
},
trackingOptions: TrackingOptions().disableTrackCarrier().disableTrackDMA(),
flushEventsOnClose: true,
minTimeBetweenSessionsMillis: 15000,
defaultTracking: .ALL
)
)
}
Hi @cliffordh, I'm glad you were able to get things working. We do recommend that you keep a reference to the Amplitude object as you've done, and we'll update the documentation to reflect this.
Expected Behavior
The Amplitude setup wizard web page should have detected events from my mobile app.
Current Behavior
Amplitude does not appear to be initializing.
Possible Solution
No soluttion.
Steps to Reproduce
Install Amplitude via Swift Package Manager Add following code to init() method of SwiftUI, SwiftApp.swift
The event "App Launch" is not tracked. The words "Amplitude initialized" and "NO user" are output to the console. The setup wizard web page does not detect any event. There is no other Amplitude related debug output in the console.
Environment