The SDK allows for the host application to retrieve list of user subscriptions.
Fetch Subscriptions
To fetch the list of subscriptions, the following API can be used.
Concrete example
let service = SubscriptionService()
service.fetchContractDates(then: { result in
switch result {
case .success:
// fetch successful
case .failure:
// error
}
})
val subscriptionsService = SubscriptionsService()
subscriptionsService.fetch(callback = { result ->
val subscriptions = result?.value
val error = result?.throwable
if (subscriptions != null) {
completionHandler(subscriptions)
} else if (error != null) {
errorHandler(error)
}
})
The HostApp now have the list of subscriptions upon success.