apptentive / apptentive-kit-ios

ApptentiveKit SDK for iOS and iPadOS
https://www.apptentive.com
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Error: Cannot convert value of type 'String' to expected argument type 'Event' #17

Closed NishanthMurugan closed 2 years ago

NishanthMurugan commented 2 years ago

As per given document in readme, we used

Apptentive.shared.engage("purchase_complete", from: self) // whereselfis a UIViewController instance. }

But above statement prompting an error saying Cannot convert value of type 'String' to expected argument type 'Event'

image

is it code issue or yet to publish the updated syntax under readme ?

frankus commented 2 years ago

The new engage method takes an Event object as its first argument, but Event conforms to ExpressibleByStringLiteral, so passing a string literal should be working.

If you are passing a variable of type String, see the note here: https://learn.apptentive.com/knowledge-base/apptentive-kit-ios-integration/#using-a-variable-as-the-event-name

NishanthMurugan commented 2 years ago

Perfect. Thanks for the document link.