fingerprintjs / fingerprintjs-pro-ios

Fingerprint Identification SDK for accurate iOS device identification.
https://fingerprint.com
Other
37 stars 11 forks source link

Cannot set tags/linked id when requesting the visitor id #34

Closed mandelmonkey closed 6 months ago

mandelmonkey commented 6 months ago

As per https://github.com/fingerprintjs/fingerprintjs-pro-ios?tab=readme-ov-file#metadata

I am trying to set tags and linkedId via the following code

var metadata = Metadata(linkedId: "unique-id")
metadata.setTag("purchase", forKey: "actionType")
metadata.setTag(10, forKey: "purchaseCount")

let visitorId = try? await client.getVisitorId(metadata) 

However this returns a build error

'Metadata' cannot be constructed because it has no accessible initializers

mgutski commented 6 months ago

Hi @mandelmonkey, what SDK version do you use? If you added fingerprintjs-pro-ios via SPM, did you make sure to File -> Packages -> Update to Latest Package Versions? The initializer at question should be accessible starting with version 2.0.1, but we generally recommend to use the latest version available.

mandelmonkey commented 6 months ago

@mgutski thank you, working with 2.4.0 (not 2.0.1)