android-components / mozilla.components.feature.accounts.push / SendTabFeature

SendTabFeature

class SendTabFeature (source)

A feature that uses the FxaAccountManager to receive tabs.

Adding push support with AutoPushFeature will allow for the account to be notified immediately. If the push components are not used, the feature can still function while tabs would only be received when refreshing the device state.

See SendTabUseCases for the ability to send tabs to other devices.

Parameters

accountManager - Firefox account manager.

owner - Android lifecycle owner for the observers. Defaults to the ProcessLifecycleOwner so that we can always observe events throughout the application lifecycle.

autoPause - whether or not the observer should automatically be paused/resumed with the bound lifecycle.

onTabsReceived - the callback invoked with new tab(s) are received.

Constructors

Name Summary
<init> SendTabFeature(accountManager: FxaAccountManager, owner: LifecycleOwner = ProcessLifecycleOwner.get(), autoPause: Boolean = false, onTabsReceived: (Device?, List<TabData>) -> Unit)
A feature that uses the FxaAccountManager to receive tabs.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.