I know I have already made a post on it Push Notifications using Firebase but many people faced difficulties in it because I hadn’t provided proper instructions and there were some mistakes in my code as well. So this time, instead of an Example App to take reference from, I have made this available as a proper dependency
I thought about merging this post into the Original Topic but that would have made things messy since it has more than 30 replies and this post would have been buried under all of it.
By the way I tried deleting the original post but apparently I don’t have permission to do it?
If you wish to keep your users informed with Push Notifications, you can do that for your Anvil App as well! This Dependency will allow you to easily send Push Notifications to your users using Firebase Cloud Messaging (FCM). The best part is that it works even in background so even if Users have closed your Anvil App, they can still receive notifications.
And if you are wondering why there is no Clone link here, that’s because when you will visit the site and fill the details there, the code will be modified for your needs and a personalized .yaml file will be generated which can be imported as an Anvil App (Tried something new this time )
If you encounter any problems, feel free to tell me about it.
Awesome, so much for a beginner like me, there’s more I would like to learn here in this thread. please keep it live so I can always come back to learn it later.
If you were already using the previous dependency in your app and wish to use the new features, you can remove the existing dependency and generate a new one for yourself from the website.
PS: I tried using the Material Design 3 theme for the first time in a project and it indeed gives what it promises - much prettier apps without making too much changes to CSS.
In your clone link, when you were using server.call, the function was not a string and that’s why you were getting error for the function not being defined.
Also, once you accept the notification prompt, you don’t need to accept it every time. You can just use the token you got the first time to send notifications. (For development purposes, you can reset notification permissions for the website on your browser and try again).
Thanks for the recording. I understood your error. You will have to run your app in a new tab (since your app runs as an iframe on Anvil Editor and iframes do not have notification permissions).