Comment on page

Subscription

The SDK allows for the host application to retrieve list of user subscriptions.

Required information

*Identity: In order to fetch subscriptions data, the application must have a valid user (represented by the Identity). That user must be active.

Concrete example

To fetch the list of subscriptions, one can use the following snippet
Swift
Kotlin
let service = SubscriptionService(identity: identity)
service.fetchContractDates(then: { result in
switch result {
case .success:
// fetch successful
case .failure:
// error
}
})
val subscriptionsService = SubscriptionsService(identity)
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.
Last modified 2mo ago