Skip to main content
Question

Error with Facebook SDK Integration in RevenueCat

  • January 7, 2024
  • 1 reply
  • 111 views

pilsen83

Hey,


I am currently integrating the Facebook SDK with RevenueCat in my project and have followed the instructions as per documentation. I recently updated to the latest version of the Facebook SDK using the package manager. However, I encountered an issue while setting up the Facebook anonymous ID.

Here is the snippet of the code I'm using:

Purchases.shared.attribution.collectDeviceIdentifiers()
Purchases.shared.attribution.setFBAnonymousID(FBSDKCoreKit.AppEvents.anonymousID)


The compiler throws the following error:
"Instance member 'anonymousID' cannot be used on type 'AppEvents'; did you mean to use a value of this type instead?"

I'm wondering if there have been any changes in the SDK or RevenueCat's integration process that I might have missed. Could you please provide some guidance on how to resolve this error or suggest an alternative way to correctly implement this functionality?

Regards

This post has been closed for comments

1 reply

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • January 10, 2024

Hi @pilsen83,

Facebook updated their SDK and changed how the methods work slightly.

Try this:

Purchases.shared.attribution.collectDeviceIdentifiers()
Purchases.shared.attribution.setFBAnonymousID(FBSDKCoreKit.AppEvents.shared.anonymousID)

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings