Using Firebase Notifications cross platform - ios

I'm searching for a solution for push notifications. For me Firebase is really attractive.
My question now is can I use it cross platform?
I think Firebase is a google service and thus will require the Google PlayServices, right? How can I consume Firebase Cloud Messages / Notificataion in my iOS App or Windows Store app.
I have a own backend where all the auth stuff and data is, but because I want to save time I don't want to implement a own solution
Is this possible or not? Or can you recommend me any other framework/service?

Yes, it's possible. FCM routes all of your iOS notifications to APNs, so by the time these notifications reach your iOS device, they look just like any other iOS notification.
If you want all the nitty-gritty details, this video might help.

In addition to Todd's answer
I think Firebase is a google service and thus will require the Google PlayServices, right?
Yup. For Android devices.
How can I consume Firebase Cloud Messages / Notificataion in my iOS App or Windows Store app.
Like Todd said, FCM forwards the messages for iOS devices to APNs. There is currently no Windows Phones client for FCM.
I have a own backend where all the auth stuff and data is, but because I want to save time I don't want to implement a own solution
To use FCM effectively accross different platforms, specially between Android and iOS, it is important to note that the behavior of message types are different to both.
Update: A recent feature was added for FCM that gives an option to provide specific params for supported specific platforms, called Platform Overrides.

Related

iOS/Swift: Quick & dirty way to send a notification to another device?

I'm trying to write a super-simple iOS app, just for personal use (i.e. it doesn't need to conform to any App Store stuff). I want it to do the following. Assume it's installed on two devices, both of which I own/control.
On device 1, it has a button that, when pressed, will immediately cause a notification to pop up on device 2.
I'm fine with hardcoding specific apple IDs, device IDs, whatever; it's also fine if this only works when the two devices are on the same LAN/Wifi. all I want is for the above to work, in the easiest way possible, and preferably without needing anything to run on a server anywhere.
How simply can this be implemented? I've set up a whole push-notification system once before, but that required some server-side stuff. Hoping to be able to do this without any of that.
====
Update: realized I wasn't clear in the original post that I need the notification on Device 2 to pop up whether or not the app is currently open/running on that device.
I think that what you are searching for is multipeer connectivity framework.
The Multipeer Connectivity framework supports the discovery of
services provided by nearby devices and supports communicating with
those services through message-based data, streaming data, and
resources (such as files). In iOS, the framework uses infrastructure
Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area
networks for the underlying transport. In macOS and tvOS, it uses
infrastructure Wi-Fi, peer-to-peer Wi-Fi, and Ethernet.
source: https://developer.apple.com/documentation/multipeerconnectivity.
You can also check those tutorials:
https://www.ralfebert.com/ios-app-development/multipeer-connectivity/
https://www.hackingwithswift.com/example-code/networking/how-to-create-a-peer-to-peer-network-using-the-multipeer-connectivity-framework
Send sms to port is a way (the protocol will become SMS): https://developer.apple.com/documentation/foundation/nsportmessage
and Maybe Firebase Remote Config can help you: you can get your data in FCM remote config (key-value) from the app :
https://www.raywenderlich.com/17323848-firebase-remote-config-tutorial-for-ios
https://firebase.google.com/docs/remote-config/get-started?platform=ios
, and you can modify your data whenever you want, and the app can fetch it.
I have similar requirements, and it seems like APNS (Apple Push Notification Service) is required for this because it's one of the only ways to 'activate' an application that is in the background.
As a result, then the question is how to make APNS as painless as possible? It seems like combining Firebase Cloud Messaging (or FCM) (to manage APNS / sending messages), and Firebase Functions (to help manage FCM server-side requirements) is one decent option.

Best way to implement push notifications with Firebase

I am an iPhone app coder, and I'm using Firebase as my backend server. Firebase doesn't support Push Notifications, so I've been trying to figure out how to include them in my app. I've read this question: How to send an alert message to a special online user with firebase but it seems like more of a work-around than an actual solution.
Is there an answer on how to do this? Are there third parties or APIs that might seemlessly implement this functionality?
One solution I have tried is to use Zapier to connect Firebase to Pushover.
At this point, I've been able to observe events in the app that I'm coding and then get notifications in a pushover app on my iphone. However, ideally, I'd like to receive the notifications in my app, not in the pushover app, because I don't want users to need to have pushover in order to use my app and because I want users to receive their own distinct notifications, not notifications for everyone.
Does anyone have suggestions on how I should handle this issue?
Thanks for the help!
EDIT
This isn't a duplicate of this question: Does firebase handle push notifications? because I know Firebase doesn't directly handle push notifications. I'm looking for the best indirect way of handling push notifications with Firebase.
Now Google rebranded GCM to Firebase Cloud Messaging and it now offers this cross platform service. Firebase also offers notifications.
These are the differences between these two services:
Firebase Cloud Messaging provides a complete set of messaging
capabilities through its client SDKs and HTTP and XMPP server
protocols. For deployments with more complex messaging requirements,
FCM is the right choice.
Firebase Notifications is a lightweight, serverless messaging solution
built on Firebase Cloud Messaging. With a user-friendly graphical
console and reduced coding requirements, Firebase Notifications lets
users easily send messages to reengage and retain users, foster app
growth, and support marketing campaigns.
If you want a more detailed comparison. Read this.
If you want device to device push messages and not just server to device, the only solution I found was OneSignal. I was able to add basic device to device push message support for my app in about an hour and it is currently free.
Both Batch and Firebase only support server to device push messages, not what you want for a chat app
There are a couple of options: (well, more than a couple but here's two)
Parse handles push notifications very very well - they have that down pat and it's super simple. However, you may have issues with users and accounts - depending on what your app does.
You mentioned Pushover. We worked their API a while back but not through Zapier. If I remember correctly, I believe you can simply register your app, send an HTTPS: request to their server and then the notifications are sent from/to your app.
Also, you may want to evaluate how you are using push as it's possible you can roll a notification-like event just into the app itself.
Here's the answer I got from the Firebase team:
Firebase currently does not have push notification feature. You can use Firebase Queue and GCM to implement push notification in your app. Queues can be used in your Firebase app to organize workers or perform background work like generating thumbnails of images, filtering message contents and censoring data, or fanning data out to multiple locations in your Firebase database. Google Cloud Messaging (GCM) is a free service that enables developers to send messages between servers and client apps and it is available in both iOS and Android.
You can push an object with some data to the /queue/tasks location in your Firebase using any Firebase client or the REST API. Workers listening at that location will automatically pick up and process the job. From that, your workers can make a GCM push notification.
(end of message from Firebase team)
~~~~~~~~~
Here's my analysis:
It seems like there are a few solutions, but the two best ones are:
1) Use FirebaseQueue with Google Cloud Messaging.
2) Leverage the Push Notification functionality in Parse within the Firebase app.
I'm not sure which is better. Parse seems more proven, but Firebase Queue is more-easily integrated into the app (ie. it's nice have everything on Firebase and not having to set up a Parse app)
Anyways, I hope this thread helps out other people!
Just realized that they've come out this:
Batch
Firebase now has Notifications inbuilt.
https://firebase.google.com/docs/notifications/
I had the same problem and managed to figure out a solution a while back. I have detailed my solution in the following posts https://stackoverflow.com/a/44192515/7048719 and https://stackoverflow.com/a/42240984/7048719
You have to create a firebase data service class and use a shared instance to hold the observers in memory when the app goes into background. From there it is just a matter doing what you wish.

iOS Push Notification not sent from server (Jetpack)

I'm implementing an iOS application to manage my self-hosted website. My app make use of the many features already built for WordPress-iOS app, but it has differences and extra features.
One of the problem I'm currently having is that push notification was not sent from Jetpack (WordPress.com server) to Apple's APNs, because I'm not getting any notification on my device. I have already registered successfully my device token with Jetpack during app launch.
My problem could be the certificate key (.pem) file not getting uploaded to Wordpress.com (which I do not have access). Is this the reason why I'm not receiving any push notification to my iphone?
Additionally, I'm not getting any result on the NotificationsViewController. I do not have Simperium account setup yet. Could that be my problem for getting no results in NotificationsViewController?
Many thanks.
Sorry about the delay!. For the time being, i'm afraid that WordPress iOS doesn't support 3rd party apps integrations with its Notifications stack.
Meaning that if you'd like to handle Push Notifications support, you'd need to implement a WordPress.org plugin to handle the APN message delivery.
As per the Simperium side, there is no 3rd party app support -at least for now!- due to security restrictions.
If there's anything we could help you with, you may find us on the WordPress Slack (#mobile channel!).
Best,
Jorge

Parse.com push notifications VS. Google Cloud messaging for iOS?

I am using Parse Data Core and was planning to use Parse Push notifications for iOS, however Google just announced cloud messaging for iOS # I/O 2015. I'm a newbie and a little unclear so thought i'd ask. what are the pro's and Con's of using one service over the other? My thought is that since parse counts each push message as a request , GCM might be better since its free with no limit.I think I can trigger GCM in Parse cloud code. Parse notifications also have a large allowable quota under free tier, but not sure if it offers extra simplicity of use over GCM. Also not sure if google requires iOS device to have a linked google account on device to receive a notification. Thanks in advance
visit
http://www.quora.com/Push-Notifications/Which-is-best-to-use-Amazon-SNS-Google-Cloud-Messaging-or-Parse-Why
it would be helpful,
all you need it's there.

Amazon Simple Notification Service (SNS) for push notifications on iOS?

Amazon Web Services have an SDK for iOS which supports the Amazon Simple Notification Service (SNS).
Does this mean it would be possible to use SNS to send push notifications to a running iOS app? So for example you could make an real-time instant messaging app.
Is this right, or have I misunderstood what SNS does? It just seems to me that you would need to open a connection/socket in order to recieve push notifications from your server. How does the SDK actually work?
Update:
I've since asked this question on the AWS Mobile Development Forum: https://forums.aws.amazon.com/thread.jspa?threadID=81089&tstart=0
Apparently there is an article coming out (probably here: http://aws.amazon.com/articles/SDKs/iOS) shortly to explain everything.
Update 2
The article: http://aws.amazon.com/articles/9156883257507082
According to Apple documentation "Local notifications and push notifications are ways for an application that isn’t running in the foreground to let its users know it has information for them.".
So, technically speaking, any data, including notifications, received when the application is running in the foreground are not "Push Notifications" and can't be a reason for rejecting the application. They're simply data being consumed that way or the other by the application.
In this specific case you are not asking about Push Notifications per Apple's documentation, rather about a technology used to deliver data to the application when the application is running and user is interacting with it. It happens that the name Amazon SNS is similar to Push Notification.
In any case Apple wouldn't be able to see what is the technology behind delivering data to your application, whether it is Amazon SNS or anything else. All they can see is that the application may have some additional ports open when it's running, and that of course would be absolutely legal. In fact, many applications communicate with their back-end servers using sockets (not HTTP requests), and that is the same technology as used by Apple to deliver their Push Notifications.
According to the Amazon documentation, they in turn uses the APNS method and provide a much simpler frontend for Apple, Android and Kindle. A realtime instant messaging app could be considered as workable since by using the Amazon SNS platform, you could even consider the application to be available for all.
I mean by utilizing the Amazon SNS, the communication could be done between iOS and Android devices and to kindle also provided the applications are written accordingly. Though the Amazon documents do not provide a comprehensive example, there are bits and pieces. Also there is an upcoming event on the Aug 29 which could be seen from the Amazon SNS page.

Resources