I want to use firebase but on of the features to this is when the application is in background I want to be notified (maybe create a notification) when the data is changed. Is it possible? Firebase supports this?
iOS has some limitations on this topic, but, I want to know if Firebase SDK support this feature or how i can implement this?
For Android, I think i can use a service to keep data updated and notify the users.
Nope. You'll have to roll your own for that.
See:
Best way to implement push notifications with Firebase
Does firebase handle push notifications?
Using Firebase to send and receive push notification for an iOS app
Real-time Push notifications with Firebase
https://www.quora.com/How-do-you-send-a-push-notification-with-Firebase
https://groups.google.com/forum/#!topic/firebase-talk/NcsozbcxEP4
https://groups.google.com/forum/#!topic/firebase-talk/t1MhR_qhohI
Related
I have built an application using phonegap. So far, all of the application features work in both Android and IOS. Now, I would like the app to receive push notifications.
I plan to use Firebase but a friend has warned that FCM can only send push notifications to IOS if a user manually types a message into the FCM console (As in there is no API which would allow my server to send push notifications to IOS manually). The docs haven't helped me prove or refute this warning. Can anyone tell me if I can programmatically send push notifications to IOS using Firebase?
Yes, it is possible to send messages to iOS through Firebase Cloud Messaging through its (server-side) API. You can either just target iOS devices, or send a message to both iOS and Android devices with specific details for each platform.
For full documentation, see https://firebase.google.com/docs/cloud-messaging/send-message.
I am new to iOS development. I want my app to periodically check a URL for data, and show a notification if data is available. I cannot use Google Cloud Messaging or Firebase Cloud Messaging as I am porting an Android app which doesn't use cloud messaging services.
Is there any way to implement this in swift?
Depends what you have in mind for "periodically".
You could set up Background fetch. In that situation, iOS will wake up your app to let it download things.
You can then use the local notifications whenever you detect new data.
The issue here is that you have no control over how often your app gets called. You can provide a hint, but iOS can decide not to wake your app for a while if it thinks it's appropriate. Don't count on being called more often than once an hour.
Another option is to have the app woken up by sending it a silent notification whenever there's something new (or at regular intervals).
The best option would still be to send notifications (silent or not) whenever there's actually something to send.
I would like to send a notification in every state (app in background or running) when some data in firebase are changed the database. Do I need to use push notification from firebase?
I use the xxx.keepSync(true) to sync with the firebase db. May I use this detect the change and how can I send the notification in the status bar?
You can use firebase cloud functions.
Refer to firebase documentation for details.
I'm working on an iOS application, and want to achieve behavior like push notifications using firebase real time DB.
In case my app is listening to some firebase node and i'll send local push notification to the user in case that node is updated.
The issue is, if the app is not running i.e. user has killed it, will my app continue listening to that particular node?
I guess, in Android we've support like this, as explained in this link (Link).
Can we achieve the same behavior in iOS. If no, what can be the alternative?
Thanks
Update:
1- There's nothing like triggering push notifications locally in iOS app. I wanted to achieve remote notification's behavior and that can't be done.
2- As far as listening to some event is concerned, it can't be done when app is not in foreground or background.
You can’t do anything if an iOS app is killed/not present in memory.
However, you can do some tasks if app is in background, and is present in memory.
You can use background fetch request in this case.
In Android, there are Services which run even when the app is killed. But on iOS, there is no such thing like this.
You can add Firebase observers in your root view controller, and implement background fetch request to continue observing data when app is in background.
When you app is killed, the listeners are disconnected.
The typical way to send messages to your app in this state is by using a push notification, which in Firebase maps to Firebase Cloud Messaging.
This is why you'll often see the Firebase Database and Firebase Cloud Messaging (FCM) used hand-in-hand: the database is used for messaging while the user has the app open, and FCM is used to send messages when the app is not active.
I am create a firebase based chat application for iOS. One of the features is to send push notification to the users in the same chat room (if they are offline).
I can't find a firebase function (for iOS) that can be used to send push notifications to the user.
Is it possible?
Displaying alert badges and notifications on iPhone applications is accomplished through Apple's Push Notification system. Since the application is not running on the user's phone when they receive notifications, the APN will have to be triggered from your server-side code.
You'll probably want to create a server-side module that listens for changes to your chat Firebase. When a message appears for a user that is offline, you'll have to schedule a remote notification with the APN. That latter part has nothing to do with Firebase, but has extensive documentation on Apple's developer web site.
I'm not sure if a web application can display alerts or badges. Otherwise this approach will only work if you create a native wrapper for your Firebase chat application.