Closed South2AK closed 8 months ago
Jobs are periodic, not scheduled, so your timing won't work out well.
You have to use RequestAccess for notifications (and pretty much everything in Shiny) in the foreground to get the users permission.
Hi Aritchie,
I did ask for the permissions and allowed them on the phone, but it doesnt Show anything on where ios nor android even though i ve been running it for hours now.
Any ideas?
Im not going to guess. You have to submit a sample.
Try sending a notification in the foreground to ensure notifications is setup properly. Jobs will run, but it can be hours before they do
I´ll create a example as fast as I can but it will take some time...
Foreground works as intended.
Also what I´ve found out is that in foreground the console has a log with shinyjobs entries in it, but when I set RunOnForeground to false nothing get´s written in it
I would encourage you to look into the code and how the perspective platforms work. You basically have to wait until jobs start running. I run this scenario all over the place.
Okay...
I left them open yesterday for the whole day but nothing really happened unfortunately. What I just found out is, the first time I open the App on android or on IOS I´ll receive a notification immediately.
Is there maybe a task needed which repeats it self in background mode?
If you're swiping away the app or killing the debugger, you're killing the app which prevents things from running.
The sample app in this repo does this stuff and works. Please provide a reproducible sample, I'll take a look, but this seems like a case of misunderstanding of how periodic jobs work on the platforms.
Component/Nuget
Jobs (Shiny.Jobs)
What operating system(s) are effected?
Version(s) of Operation Systems
17.2.1 IOS Android 14
Hosting Model
Steps To Reproduce
in Code Sample
Expected Behavior
After the user has clicked on start, it should start a counter and set a DateTime into Preferences
When more than 8 hours (in the codesample I´ve set it to one minute so i won´t have to wait that long) it should show a notification saying "App is runing since more than 8 hours" so the user is reminded
Actual Behavior
Nothing happens, whether in console or in app
Exception or Log output
No response
Code Sample
Hey,
how can I actually use a combination of both?
What I want to to is the following:
In my app there is a start / stop button which sets a DateTime into preferences and when ever a user has the app in background I want the App to remind him after 8 Hours that he still is on running
This is my Job:
This is mauiprogram.cs (ofc .UseShiny() is set)
Is there anything else that I need to set in order for this to work? Android Manifest has been Updated (Post Notifications is active), Apple Item.plist has also been added
Code of Conduct