Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add action button on notification #60

Open
sulabh9999 opened this issue Dec 4, 2020 · 8 comments · May be fixed by #86
Open

How to add action button on notification #60

sulabh9999 opened this issue Dec 4, 2020 · 8 comments · May be fixed by #86
Labels
enhancement New feature or request work-in-progress

Comments

@sulabh9999
Copy link

Thanks for building excellent module for background task.
In my case, want to add action buttons as well on notification, i couldn't find any api for this. How can we achieve this? Please help.

Example:

Thanks

@sulabh9999 sulabh9999 changed the title Want to add action button on notification How to add action button on notification Dec 4, 2020
@Rapsssito
Copy link
Owner

@sulabh9999, there is not such functionality at the moment. However, you can achieve similar results using Deep Linking.
Thanks for your feedback! I will tag this issue as a feature request.

@Rapsssito Rapsssito added the enhancement New feature or request label Dec 4, 2020
@klaakso
Copy link

klaakso commented May 12, 2021

Hi @Rapsssito ! We would also like to use this feature. Have you started work on this yet? If not, I'd be happy to help out! 🙂

@Rapsssito
Copy link
Owner

@klaakso, I have been very busy lately. If you want to help, you are very welcome! 💯

@harshadghoghari84
Copy link

i can't use pedometer in background action ,help please!

@JosueCont
Copy link

How could I get two or more notifications when I used BackgroundService.start() in different parts?

@Rapsssito
Copy link
Owner

@JosueCont, you cannot run more than one background service at the same time. Please, read the documentation and open a new issue if you have any more questions.

@jkyriakou
Copy link

Nice Job Guys!!

I am trying to validate that service JS function taskRandom is being kept alive when app is teminated/closed. However I am having an issue because when I close the app it seems like it not working(Notification bar is disappearing).
Could you please help me ?
const taskRandom = async (taskData) => {
await new Promise(async (resolve) => {
// For loop with a delay
const { delay } = taskData;
console.log(BackgroundJob.isRunning(), delay)
for (let i = 0; BackgroundJob.isRunning(); i++) {
console.log('Runned -> ', i);
await BackgroundJob.updateNotification({ taskDesc: 'Runned -> ' + i });
await sleep(delay);
}
});}

@thepouria
Copy link

Nice Job Guys!!

I am trying to validate that service JS function taskRandom is being kept alive when app is teminated/closed. However I am having an issue because when I close the app it seems like it not working(Notification bar is disappearing). Could you please help me ? const taskRandom = async (taskData) => { await new Promise(async (resolve) => { // For loop with a delay const { delay } = taskData; console.log(BackgroundJob.isRunning(), delay) for (let i = 0; BackgroundJob.isRunning(); i++) { console.log('Runned -> ', i); await BackgroundJob.updateNotification({ taskDesc: 'Runned -> ' + i }); await sleep(delay); } });}

you can listen on appState and close task when state is removed and i suggest to close task on return method of useEffect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work-in-progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants