How to get the app I'm developing to send me a notification to remind me for an event? - flutter

I'm making a student organizer app, where I have a module to register the student for an event. Once it has been registered, I want the app to send a notification 10 minutes before the event. How do I proceed with this, since I have no knowledge about it?
P.S., I know I'll have to use flutter-local-notifications, but I don't know how to do it.
Any help would be appreciated!

You don't need to use flutter_local_notifications, you need to use firebase_messaging.
Install the package according to instructions.
Subscribe your users to topics whose names ( topics' names ) will be associated with the name of event so users will receive notifications for that event.
You may push notifications from Firebase console -> Clod messaging.
Here you will create new notification and configure it.

Related

Send push notification if user is not active in Swift

I would like to add a feature to my social app, which can send a push notification to a specific user, is he's not active.
For exemple, if the user has not logged in for 7 days: I would like to send him a push notification "Hey, it's been a while since you've logged in! Come see the new posts".
I know how to send a push notification to a specific user (that's not the problem), but I don't know how to create an automatic function which is able to know if the user didn't logged in for 7 days.
Do you know if it is possible ?
Ps: I'm using Firebase.
You can use local notification here which is good solution I guess.
Whenever user open's the app schedule the local notification of after 7 days from current date. ( Make sure to remove previously schedule notification before adding new one. )
In this case if user open the app notification will reschedule automatically else notification will fire based on last schedule of it.
I did this way in one app and it worked as I explained.
I think this feature can be executed on the Front-end side. All you need is about Local Notifications. When the user opens the app, you will create a local notification for next 7 days and delete the old one in case user open the app within 7 days.

Send push notification to specific user?

I'm making an app where I want to be able to set a basic notification (title, message, fire date) and have been trying to figure out the best way to setup the notifications. I'm working with Swift 3 and Firebase 3.
I don't want to use local notifications because if the user is logged in on multiple devices I want it to push to all those devices.
Is there a way to do this with FCM where a user can set a notification to fire at a specific date and time and have it fire on all (iOS) devices logged in?
If FCM doesn't have this, is there another APK that does? I've looked at Batch briefly but I'm already using Firebase.
Thanks in advance!
If your main use case is to send a push notification to a single user for his multiple devices, I suggest you make use of Device Group Messaging on iOS. As per the docs, it is typically used for:
With device group messaging, app servers can send a single message to multiple instances of an app running on devices belonging to a group. Typically, "group" refers a set of different devices that belong to a single user.
When it comes to sending the notification on a specific date, I'm pretty sure you can set it up in the Firebase Console.
However, if you intend it to be sent from the server, you have to implement it yourself, since I think, there is no currently API available or a parameter you can set in the payload that can be modified for the message to be sent for a specific date.

Send reminder notifications for user's birthday

I am creating an app using Swift and Parse as my backend platform. In my application a User can send an invitation to be connected to another user and as soon as they are connected the app should send notifications to remind the user about his friend’s birthday.
In this scenario I have two moments in which the app should send a notification:
1- When user A sends an invitation to user B, user B should receive a notification
2- When it’s user’s B birthday, user A should receive a notification and vice versa
I created a Parse object called AppNotification that is responsible for storing information about the notifications the user should receive. So when a user sends an invitation to another user I am adding a line in the AppNotification table, the same happens when it’s a birthday of a friend. Using this I can calculate the number of unread notifications and show it to the user in the UI using the components badge.
My question is more related to the best way to send the birthday notification. What I am considering is:
1- When user A sends and invitation to user B I have to send a push notification to user B.
2- As soon as the users are connected I can schedule local notifications to remind them about the birthday. This solution would use Local Notifications instead of Push Notifications.
3- Or create a Job in Parse that will be executed every day and will read all the users whose birthday is today and send a push notification to his friends. This solution would use Push notifications and I would not need to worry about scheduling local notifications.
Between the points 2 and 3 which one is the best solution? Is there any other approach I could use? When should I consider using Local Notifications other than Remote Notifications?
Thank you in advance.
Regarding points 2 and 3: there are pros and cons for both options: Having the reminders as local notifications is basically what your local calendar app does, i.e. you don't need a connection the Internet / Parse. However: what happens if one party (A) decides that she no longer wants to be a "friend" (of B)? Should notifications still be sent? If not, you could easily delete the scheduled notification on the server. This would also ensure that the other party (B) wouldn't receive notifications of a former friend (A) if she didn't open the app in the meantime and synced the list of friends.
There are of course more pros and cons, so it is really a matter of your preference and possibly other constraints (e.g. should an active internet connection be necessity?).

Can I delete a push notification from a device which have receive this push notification?

I have the following problem.
I look for a capability to delete a push notification from a device (iPhone respectively Apple Watch) but this device have receive the push notification.
The use case is that a USER A send a request to all available USER Bs. A push notification is send to all these USER Bs. At the moment the push notification arrive it will shown on their Apple Watch. One of the USER Bs answer that he accept this request. After he press the button to accept the request the notification should be deleted on all the other devices.
I really do not know a capability to do this.
But I know that you can handle this problem in Android as provide a unique ID for this notification. After that you can delete the other notifications with this particular ID.
Is their maybe a same way for iOS like it is provided in Android?
This doesn't really have anything to do with WatchKit/Apple Watch.
To answer your main question: no, you can't do this as it describe. Once you fire off a notification, it's in the user's hands to decide what they want to do with it.
As an alternative, you could maintain an "inbox" with every notification in your app and use the notification to prompt the user to check it. That way you could remove a notification from the inbox on the server side of things.

Could one iOS application support multiple push notification registration?

This is the first time that I approach the push notification service and I'm little bit confused. I 'd like to have just some conceptual help, not code.
I need to build an app that should receive and register for different kind of notifications. For instance in my app I'd like that users could register for PROMO notifications category and NEWS notifications category, I'd like that they could choose which one they want to be notified.
Reading the Apple doc, that was not so clear to me, it seems that once the app device is registered I receive just one token and seems impossible to receive more tokens for different kind of registration(NEWS and PROMO for instance), because the token is related to the app and the device. Is that correct?
The other thing that is not so clear to me is, if a device is registered for a specific notification is it possible to send the notification only to a set o devices?
If nothing of that is offered by Apple Push services do you think that is possible to manage everything like that:
-I register the app device for notification if (PROMO || NEWS) are selected
-I get the token
-I send the token to my server giving also as additional info about the service which the user wants to subscribe
-The server (provider) register the token and the kind of subscription (PROMO || NEWS)
-Later when I have a notification to push I ask the server all the tokens registered for that specific category and then I send the notification only to those devices registered for that category.
Thanks for helping me out I'm really confused.
"Reading the Apple doc, that was not so clear to me, it seems that once the app device is registered I receive just one token and seems impossible to receive more tokens for different kind of registration(NEWS and PROMO for instance), because the token is related to the app and the device. Is that correct?"
YES
The other thing that is not so clear to me is, if a device is registered for a specific notification is it possible to send the notification only to a set o devices?
YES, you need a DB where you connect a Push Token with the related Services (promo | news). If you have a new Promo Push Message you send the message to all related token. on the app site, everytime the user change the categorie (promo / news) you should prpvide these infos to your service with the push token.
These are all problems that you have to solve yourself on the server side. The push service simply provides a means to send a single message to a single device. You have to figure out yourself which messages you want to send to which devices. Each message has to be sent individually, there's no way to "broadcast" a message to all your users directly.
You could think of the push tokens as email addresses – of course, one email address might be subscribed to different newsletters from the same publisher, but it's the publisher's job (yours) to figure out whom to send which newsletters, not the email provider's (Apple's).
You should think of the push notification registration like my I send the user push notifications. Not what kind of push notification can I send the user.
Then you need to do serverside filtering on you categories, like the ones in your example promo and news.
The perferance of the user should be stored on your server, so you will know what kind of notification to send to which user.