Implict purchase tracking doesn't work when using Google Play Billing Library
Checklist
- [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
Environment
Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:
- Java Version:
1.8 - Android SDK Version:
29 - Installation Platform & Verison:
Gradleversion5.6.4
Goals
Implicit purchase tracking events should be sent when a purchase happens inside an Android app.
Expected Results
What do you expect to happen?
Actual Results
They aren't sent when using the Google Play Billing Library instead of AIDL.
From InAppPurchaseActivityLifecycleTracker.java
private static final String SERVICE_INTERFACE_NAME =
"com.android.vending.billing.IInAppBillingService$Stub";
....
try {
Class.forName(SERVICE_INTERFACE_NAME);
hasBillingService = true;
} catch (ClassNotFoundException ignored) {
hasBillingService = false;
return;
}
The ClassNotFoundException gets thrown and so InAppPurchaseActivityLifecycleTracker never initializes.
A temporary workaround is to manually include the AIDL file so it's available to the Facebook SDK.
Thanks for reporting it. It's very valuable to us. Seems like there is a change in Google Play Billing service for V2+ and current Facebook SDK does not support it. This feature is critical and we will make the change within next a few major releases.
Thanks again!
Any update on that? thanks in advance
@YOUDAN any update?
@YOUDAN any planned updates about this issue? Or at least it's a good idea to add some note in docs that it won't work with newer versions of Billing Library.
No updates yet?
@YOUDAN is there anything new? I'm stuck, I can't receive any App-In purchase events while using V3 google pay and the facebook android sdk version is 9.0.0. Thanks in advance.
I have been tracking down all the documentations to find why purchases are not being logged. Tried to debug the code by looking at the source and finally found myself here.
I am totally amazed about this. One of the biggest companies in the world selling ads still has no support for v3 google play billing library while the other ways are being deprecated.
The worst part is there is no such warning in any of the documentations about the issue. I totally appreciate it.
@mrtcnnccn, it looks like v11, released a couple days ago adds support for v3 Google play billing. Change log here
@mrtcnnccn, it looks like v11, released a couple days ago adds support for v3 Google play billing. Change log here
Thanks for that. Has anybody checked it? Is it working correct?
Edit: FeatureManager.Feature.IapLogging and FeatureManager.Feature.IapLoggingLib2 are not getting enabled automatically so tracking is not starting. Anybody tested it?
FetchedAppGateKeepersManager.loadAppGateKeepersAsync(object: FetchedAppGateKeepersManager.Callback{
override fun onCompleted() {
FetchedAppGateKeepersManager.setRuntimeGateKeeper(RemoteConfigParams.getFBApplicationId(), GateKeeper("FBSDKFeatureIAPLogging", true))
FetchedAppGateKeepersManager.setRuntimeGateKeeper(RemoteConfigParams.getFBApplicationId(), GateKeeper("FBSDKFeatureIAPLoggingLib2", true))
FacebookSdk.setAutoLogAppEventsEnabled(true)
}
})
Looks like those features are closed remotely by Facebook. However, this code enables tracking 'purchases' for billing v2plus.
Note: As I see from the source code tracking is only enabled for purchases not for subscriptions. See line:47 and line 56 here: https://github.com/facebook/facebook-android-sdk/blob/0fbbf807c0715bf3c8e52ab57b2e710ba76397fe/facebook-core/src/main/java/com/facebook/appevents/iap/InAppPurchaseAutoLogger.java
- Both FBSDKFeatureIAPLogging & FBSDKFeatureIAPLoggingLib2 FG is always return false
- InAppPurchaseAutoLogger.java impl for Google Play Billing V2/V3 Only Support PURCHASE NOT SUBSCRIBE
FUNNY 11.0.0 CHANGE LOG, WASTE TIME
Still having this issue, extremely frustrating that there has been zero communication around this, as it's a pretty crucial part of the Facebook Ads platform.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
It still desperately needs attention
According the changelog (https://github.com/facebook/facebook-android-sdk/blob/main/CHANGELOG.md), 11.0.0 is supposed to support auto logging of Google billing v2/v3 purchases. However this feature is still default to off in the SDK and cannot be changed. Any updates from the team?
Expanded support for auto-logging of in-app purchases to support apps that use V2 and/or V3 of the Google Play Billing Library
UPDATE: I noticed that the feature switch "FBSDKFeatureIAPLoggingLib2" was set to false when graph API mobile_sdk_gk is called with user agent set to FBAndroidSDK.11.x.x. This has caused the SDK to not run auto logging for Google Play Billing v2/v3. The API returns true for the same switch value when a different user agent string is used.
If this is by-design, you should at least update the documentation.
Repro for FBSDKFeatureIAPLoggingLib2 feature switch issue (replace
curl "https://graph.facebook.com/v11.0/<APPID>/mobile_sdk_gk?fields=gatekeepers&format=json&sdk_version=11.3.0&sdk=android&platform=android" -H "ContentType: application/x-www-form-urlencoded" -H "User-Agent: FBAndroidSDK.11.3.0"
Are there any updates?
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Any more information about this?