get-available-addons.md 1.38 KB
Newer Older
MickeyMoz's avatar
MickeyMoz committed
1
2
3
4
[android-components](../../index.md) / [mozilla.components.feature.addons.amo](../index.md) / [AddonCollectionProvider](index.md) / [getAvailableAddons](./get-available-addons.md)

# getAvailableAddons

MickeyMoz's avatar
MickeyMoz committed
5
`suspend fun getAvailableAddons(allowCache: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Addon`](../../mozilla.components.feature.addons/-addon/index.md)`>` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/feature/addons/src/main/java/mozilla/components/feature/addons/amo/AddonCollectionProvider.kt#L71)
MickeyMoz's avatar
MickeyMoz committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Overrides [AddonsProvider.getAvailableAddons](../../mozilla.components.feature.addons/-addons-provider/get-available-addons.md)

Interacts with the collections endpoint to provide a list of available
add-ons. May return a cached response, if available, not expired (see
[maxCacheAgeInMinutes](#)) and allowed (see [allowCache](get-available-addons.md#mozilla.components.feature.addons.amo.AddonCollectionProvider$getAvailableAddons(kotlin.Boolean)/allowCache)).

### Parameters

`allowCache` - whether or not the result may be provided
from a previously cached response, defaults to true.

### Exceptions

20
`IOException` - if the request failed, or could not be executed due to cancellation,
MickeyMoz's avatar
MickeyMoz committed
21
a connectivity problem or a timeout.