So I am assigned a job in which I am supposed to update the already existing Flutter app
I am told to add User Specific Push notifications, the issue here is the backend of the app is made using PHP and MySQL, and the website for the same runs on PHP since 2015.
Can someone guide me about how I should go about Making it,
Let's say someone posted a job on the app or a website, the users with matching keys skills of the job receive a push notification about the job posted, similarly, there are more scenarios like these like Messaging as well.
My Answer:
To implement user-specific push notifications in your Flutter app with a PHP and MySQL backend, you can follow these steps:
1. Update your MySQL database: Add a new table to store user device tokens and their corresponding user IDs. This table will be used to map users to their device tokens for sending push notifications.
2. Update your PHP backend: Create API endpoints in your PHP backend to handle user registration for push notifications and storing device tokens in the database. You will also need to create endpoints for sending push notifications to specific users based on their user IDs.
3. Update your Flutter app: Implement logic in your Flutter app to register the user for push notifications and send the device token to your PHP backend for storage. You can use packages like firebase_messaging to handle push notifications in your Flutter app.
4. Implement user-specific push notifications: When a job is posted on the app or website, you can query the database to find users with matching key skills for the job. Then, use the stored device tokens to send push notifications to those specific users.
5. Test and debug: Make sure to thoroughly test the user-specific push notification feature to ensure that notifications are being sent to the correct users based on their key skills.
By following these steps, you should be able to successfully implement user-specific push notifications in your Flutter app with a PHP and MySQL backend. Good luck with your project!
Rate this post
4 of 5 based on 3944 votesComments