I am trying to add facebook app events, and I installed FacebookSDK. Then I have next code:
import FacebookCore
static func logViewContentEvent(contentType : String, contentData : String, contentId : String, currency : String, price : Double) {
let params : AppEvent.ParametersDictionary = [
.contentType : contentType,
.content : contentData,
.contentId : contentId,
.currency : currency
]
let event = AppEvent(name: .viewedContent, parameters: params, valueToSum: price)
AppEventsLogger.log(event)
}
But I get error from the title. What I am doing wrong, and why this type is missing?
.viewedContent
in the name param of AppEvent? – Sty. viewedContent
for some string? – Styimport FBSDKCoreKit
– StyFacebookCore
doesn't seem to be necessary to log events which I do withAppEvents.log(AppEvents.Name("foobar"))
. But I cannot log custom events! – Moores