Feature Description
Add support on Android to allow background processes to run that can respond to events and updates even when the app interface is not active.
import { AppRegistry } from 'react-native';
import { updateAndroidWidget } from '@use-voltra/android-client';
import CardWidget from './CardWidget';
const BackgroundTask = async (data) => {
try {
const response = await fetch(
'https://api.com/...'
);
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const results = await response.json();
console.log('Results:', results);
await updateAndroidWidget('card_widget', [
{
size: { width: 300, height: 200 },
content: <CardWidget json={results} />,
},
]);
console.log('Widget update');
} catch (error) {
console.error('Error task headless:', error);
}
};
AppRegistry.registerHeadlessTask(
'BackgroundTask',
() => BackgroundTask
);
Problem Statement
Improving the user experience by automatically performing tasks in the background, without requiring the app to be opened.
Proposed Solution
No response
Alternatives Considered
No response
Current Library Version
1.4.1
Implementation
Additional Context
No response
Feature Description
Add support on Android to allow background processes to run that can respond to events and updates even when the app interface is not active.
Problem Statement
Improving the user experience by automatically performing tasks in the background, without requiring the app to be opened.
Proposed Solution
No response
Alternatives Considered
No response
Current Library Version
1.4.1
Implementation
Additional Context
No response