Skip to content

7. Query User's Subscribed Products

Saeed Moradi edited this page Feb 23, 2022 · 1 revision

You can query user's subscribed products by using getSubscribedProducts function in Payment class:

payment.getSubscribedProducts {
    querySucceed { subscribedProducts ->
        ...
    }
    queryFailed { throwable ->
        ...
    }
}

Note that

getSubscribedProducts runs on a background thread and notifies you about the query result in the main thread, this means that you don't have to handle threading by your self.

Reactive way of this

payment.getSubscribedProducts()
    .subscribe({ subscribedProducts ->
        ...
    }, { throwable ->
        ...
    })