Tokens
fetch_token_by_type allows to fetch a specific type of token, providing search parameters to further classify which token to return (e.g. the subscription id for a Subscription Receipt Token).
The result is a TokenSearchResult or an error if the token could not be fetched.
- Swift
- Kotlin
let search_options = TokenSearchOptions(
subscriptionId: "1",
ipAddress: nil,
endpointConfiguration: nil,
forceRefresh: false
)
let result = manager.tokens().fetchTokenByType(
tokenType: TokenNames.subscriptionReceiptToken,
advancedSearchOptions: search_options,
)
val searchOptions = TokenSearchOptions(
subscriptionId = "1",
ipAddress = null,
endpointConfiguration = null,
forceRefresh = false
)
val result = manager.tokens().fetchTokenByType(
tokenType = TokenNames.subscriptionReceiptToken,
advancedSearchOptions = searchOptions
)
Read existing tokens
info
This method does not refresh tokens automatically or fetches missing tokens. It only returns the items in the cache.
TokenSearchResult
info
See the different token types to learn more about the available options: