Hello Everyone,
I’m making my first app for the CWC assignment and it’s an event app. I’d like to use this for my company as well, so I’m trying to set up local notifications. I’ve found a ton of tutorials on interval notifications and calendar notifications, but for the most part they function in the same way where the user is setting up the notifications. I’ll like to have the ability to set up multiple local notifications for my users, so they will receive preset notifications throughout the event.
To date, I’ve put made 3 apps from 7 tutorials and have spent up to 14 hours trying to learn enough to figure it out, but it feels like it’s time to ask for help. Any support would be greatly appreciated.
I’ve been doing some digging and I think I found what I like but I can’t figure out how to implement it due, because I’m a beginner. Does that look real to you?
You could do it this way, but really only if you know the exact date / time you want these local notifications to be scheduled, for every user that’s downloaded the app
Otherwise you’d have to use push notifications from a server
If all the notification dates are known in advance - use Local Notifications.
This is a simple tutorial that covers it.
If all the notification dates are not known in advance, but will happen live - use Push Notifications sent from a server. If I were you I’d hook this up with Firebase. If you don’t have experience with Cloud Functions and/or APIs, this is about to be a bit of a rabbit hole, but it’s definitely worth learning.
I’ll know all the dates and times in advance so I’d like to use the local notifications, but I’ve attempted to put it all in a file and it never builds. I’m assuming it’s considerably easier for someone who has experience. Are there specific classes/lessons here that would help me understand how to do that? Or maybe other tutorials?
@CalStark That’s a good one too, but it doesn’t help with scheduling multiple notifications for the user. Or maybe it does, but I’m too junior to understand it.
Articulate what you’re trying to do
Break down the problem into steps
You’ve put the notification dates into a file - is a JSON file? Which part of your code doesn’t build? If you have a specific problem it’ll be easier to help you
@CalStark When you say it like that, that makes so much more sense that what I’ve been doing. Thank you for your patience and guidance. I’ll collect all my thoughts and work and have it out shortly. I’m also a lot further along so I have code to share.
@CalStark I’ve set up a demo app. I’m trying to have the user, grant permissions and that’s it in terms of set up. The notifications should be local and annual, but I’m running into trouble with the notifications array and for each notification I’m getting an error "Cannot infer contextual base in references to member ‘noteOne’
it’s been a while maybe you’ve solved this already, asking just in case
When it comes to .noteOne that is not compiling: what is the type of the expected argument “repeatInterval” and what is the type of the value “.noteOne” ? If they aren’t the same then there you go
pro tip: hold the “option” key while clicking on code to pull up its docs, including argument types etc