I have a goal, and that goal is to have Local Notifications on my app, every week, in a specific day and time. I tried to do it with capacitor, but it doesn t seem to work, ans there is not to much doc on the web. So i decided to install th cordova plugin. But now i get an error when i build my app:
error: cannot find symbol
import android.support.v4.app.NotificationCompat;
^
symbol: class NotificationCompat
location: package android.support.v4.app
Do someone have an idea of how can I either do it with capacitor, or fix this error to do it with the cordova plugin.
I really wish people would stop using vague phrases like ādoesnāt workā. They convey almost zero useful information. Much more productive is describing in concrete detail:
what you tried
what it did
what you wanted instead
how those two things are different
In any event, what I would do in this situation is to pick an arbitrary number of notifications to preset based on how frequently people are expected to be using the app. Letās say four for the sake of discussion, which would be a monthās worth.
So at every app launch, I would ask getPending() whatās in the pipeline, and if there are fewer than four in there, I would use date-fns to walk out X more weeks one at a time, filling out until weāre up to four, and calling schedule() to book each one.
Thanks for the answer, actually, the problem is that i tried a lot of configurations for the capacitor Local Notifications, so itās hard to describe everything. Now i wanted to try with Cordovaā¦ but i get this error so I canāt, and itās pretty hard to fix it.
The prototype of the capacitor schedule is this one :
How about testing it by scheduling one on the same minute of every hour? That should give you quicker feedback.
Yeah I did with āonā, and itās working, but the problem is that, with āonā , i can t schedule every week, if I schedule like that: on: { day: 2, hour: 15, minute: 15}, it will send a notification every 2 of a month, at 3pm 15.
And with āeveryā, i tried also but it was not working, so i tried also while setting ārepeatsā on true, but then i had a notification every minute, and not every hour. I just scheduled again a notification with the config: {at: new Date(Date(now()+1000)), every: āhourā}.
Things changed today, I updated my java JDK, which magicaly fixed my errors, which mean i was able to use the cordova plugin. So i successfully added the notifications as expected. But now, for a misterious reason (I didn t changed the code or de dependencies) , I have back the same errors on android studio, as on the screen: