facebook-android-sdk
facebook-android-sdk copied to clipboard
`queryPurchases` is called from inside sdk, however `queryPurchasesAsync` is much better option
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
Java version
8
Android version
api23+
Android SDK version
12.1
Installation platform & version
Gradle
Package
Core & AppEvents
Goals
Avoid queryPurchases
and use queryPurchasesAsync
instead. In our code we use queryPurchasesAsync
because earlier we discovered that queryPurchases
can lead to ANR and now we have a bunch of reports (manually collected) that contains fb sdk running queryPurchases
in the main thread and blocking it for a long time. Please consider queryPurchasesAsync
instead of queryPurchases
. In "Code samples & details" you can find one of the reports we've collected in our app. Thank you very much!
Expected results
Avoid queryPurchases
and use queryPurchasesAsync
instead
Actual results
queryPurchases
is used inside fb sdk
Steps to reproduce
No response
Code samples & details
Thread state: TIMED_WAITING
sun.misc.Unsafe.park(Unsafe.java:N)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:N)
java.util.concurrent.FutureTask.awaitDone(FutureTask.java:N)
java.util.concurrent.FutureTask.get(FutureTask.java:N)
com.android.billingclient.api.BillingClientImpl.queryPurchases(com.android.billingclient:billing@@N.N.N:N)
java.lang.reflect.Method.invoke(Method.java:N)
com.facebook.appevents.n.h.c(InAppPurchaseUtils.kt:N)
com.facebook.appevents.n.c.o(InAppPurchaseBillingClientWrapper.kt:N)
com.facebook.appevents.n.b.c(InAppPurchaseAutoLogger.kt:N)
com.facebook.appevents.n.f.b(InAppPurchaseManager.kt:N)
com.facebook.appevents.internal.a.w(ActivityLifecycleTracker.kt:N)
com.facebook.appevents.internal.a$e.onActivityResumed(ActivityLifecycleTracker.kt:N)
android.app.Application.dispatchActivityResumed(Application.java:N)
android.app.Activity.dispatchActivityResumed(Activity.java:N)
android.app.Activity.onResume(Activity.java:N)
android.app.Instrumentation.callActivityOnResume(Instrumentation.java:N)
android.app.Activity.performResume(Activity.java:N)
android.app.ActivityThread.performResumeActivity(ActivityThread.java:N)
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:N)
android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:N)
android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:N)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:N)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:N)
android.os.Handler.dispatchMessage(Handler.java:N)
android.os.Looper.loop(Looper.java:N)
android.app.ActivityThread.main(ActivityThread.java:N)
java.lang.reflect.Method.invoke(Method.java:N)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:N)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:N)
same issue,so many anr online ,need fixed!
fix it please!