facebook-ios-sdk
facebook-ios-sdk copied to clipboard
Facebook SDK automatic app events logging with StoreKit2
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing GitHub issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [X] I've read the Code of Conduct
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
Xcode version
15.1
Facebook iOS SDK version
16.3.1
Dependency Manager
SPM
SDK Framework
Core
Goals
We are currently making a switch from Original StoreKit to StoreKit2 in our iOS app. We have Facebook SDK of version 16.3.1 (but tried on 17.0.0 as well) that automatically logs our purchase events.
After the migration, we noticed drop in Purchase events quantity in our Events Manager.
While debugging Facebook App Events automatic logging I have noticed that purchase events that Facebook sends from mobile client to Events Manager do not work as expected when purchase is made using StoreKit2:
- when switched back to
Original StoreKit- purchase event logs immediately in the Facebook debug console after the actual purchase - when purchased using
StoreKit2- purchase event does not appear in the debug console. Sometimes they are being sent when I relaunch the app, usually not
I've researched Facebook SDK implementation and noticed that it uses public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) to listen for the payment updates (sorry if i missed something and it's not the only method that you use)
In my case, purchase made using StoreKit2 does not trigger any events in this function right after the purchase and my theory is that it leads to the drop in our Purchase events quantity.
So my question is if this is a known issue or StoreKit2 purchases should track in the same way as Original StoreKit and it looks like something's wrong with my code?
Thanks in advance!
Expected results
After user makes a purchase either with Original StoreKit or StoreKit2, Facebook SDK sends Purchase event to Events Manager
Actual results
If i make purchase using Original StoreKit SDK -> Facebook SDK logs Purchase event immediately and everything works as expected
if I make purchase using StoreKit2 API -> no event is being tracked. sometimes it's tracked on the next app session, but usually not
Steps to reproduce
- Install Facebook SDK to your project with automatic app events logging enabled
- Initiate test session with Events Manager
- Make in-app purchase using StoreKit2
- Observe that no
Purchaseevent is being tracked
Code samples & details
No response
We also encountered this issue. We also discovered that Firebase does not support StoreKit 2. Considering that StoreKit 2 does not have any particular advantages, we plan to fall back to StoreKit 1.
Sad to hear that you've also encountered this issue
We've taken a decision to switch to StoreKit2 and Server-to-Server Notifications v2 to make it easier to handle in-app purchases and therefore it's very important for us that SDKs also support this version of StoreKit
As for now, it'd be amazing to understand whether it's widespread issue and if Facebook Mobile SDK team considers to support that
With Storekit 1 officially being deprecated, it would be awesome to move this forward