Reputation: 88
i am working on a project and i am implementing this SDK https://docs.drivequant.com/trip-analysis/ios/get-started and I am implementing it in appdelegeate.m
here how I import the module
@import DriveKitCoreModule;
@import DriveKitTripAnalysisModule;
and here how I initialise it
[[DriveKit shared] initialize];
[[DriveKit shared] setApiKeyWithKey: @""];
[[DriveKit shared] setUserIdWithUserId: @""];
[[DriveKit shared] enableLoggingWithShowInConsole:YES];
[[DriveKitTripAnalysis shared] initializeWithTripListener: self appLaunchOptions:launchOptions];
but I always get this warning with initializeWithTripListener
and after running I got this error
does anyone know why I am getting this error? and how to fix it?
Upvotes: 0
Views: 718
Reputation: 131503
See this link for a description of how you declare that an Objective-C class conforms to a protocol. (Specifically the section titled "Conforming to Protocols".)
Looking at the readme for the framework you are using, it says:
Make the AppDelegate class implement TripListener protocol. This protocol contains 6 methods to implement:
func tripPoint(tripPoint: TripPoint) {
}
func tripStarted(startMode: StartMode) {
}
func tripCancelled(cancelTrip: CancelTrip) {
}
func tripFinished(post: PostGeneric, response: PostGenericResponse) {
}
func tripSavedForRepost(){
}
func beaconDetected(){
}
func significantLocationChangeDetected(location: CLLocation){
}
func sdkStateChanged(state: State){
}
So you will need to add implementations for those 6 methods to your app delegate. (Those method declarations are in Swift. If you're writing your app delegate in Objective-C you'll need to find the Objective-C function prototypes.)
Upvotes: 1