DsProfile

interface DsProfile

Functions

Link copied to clipboard
abstract fun balance(): Observable<BalanceInfo>

Get an observable that needs to be subscribed to in order to get the balance. This can also be started to run automatically with pollForBalance. Can be updated manually by calling updateBalance.

Link copied to clipboard
abstract fun getBalanceInfo(accessToken: String): Single<BalanceInfo>

Gets the latest balanceInfo returned from updateBalance or pollForBalance. If no balance have been returned before an updateBalance will be called to get the BalanceInfo

Link copied to clipboard
abstract fun getPlayerCard(accessToken: String): Single<PlayerCard>

Gets the users player card data.

Link copied to clipboard
abstract fun getProfileInfo(accessToken: String): Single<ProfileInfo>

Gets the players profile Info

Link copied to clipboard
abstract fun getProfilePage(pageRequest: PageRequest): Single<Page>

Use for getting the Page object used for opening different web profile pages.

Link copied to clipboard
abstract fun isGeoLocationAllowed(): Single<Boolean>

Use this to find out if GeoLocation the user is allowed to use the service in its current geolocation.

Link copied to clipboard
abstract fun pollForBalance(period: Long = 30, timeUnit: TimeUnit = TimeUnit.SECONDS, tokenProvider: ProfileTokenProvider)

Start this to poll for balance updates. Can be started with default values or with custom values. Its default wait time for each update is 30 seconds.

Link copied to clipboard
abstract fun stopPollForBalance()

Stop poll for balance Call this when the app goes into background.

Link copied to clipboard
abstract fun updateBalance(accessToken: String): Completable

Updates the balance and returns a completable that tells whether it succeeded or not.