Detect unpremium user #116
-
How can I detect if a user has not buy any product or subscription purchases?The functions 'onSubscriptionRestored' or 'onProductRestored' are not triggered if the user has not buy any purchase.Please add this callback to the library in future versions. |
Beta Was this translation helpful? Give feedback.
Answered by
jdleung
Jun 12, 2023
Replies: 1 comment
-
It might a wrong way, but that's a solution I can find:
Important: be sure that the connection |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
akshaaatt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It might a wrong way, but that's a solution I can find:
addBillingClientConnectionListener
to check billing connection when app starts.status
istrue
inonConnected
, set all subscription and nonconsume products tofalse
.onSubscriptionRestored
will be called if product is valid, just set the product totrue
again.Important: be sure that the connection
status
is true before setting a product tofalse