so i have a web app and a mobile app, the web app works fine with signalR and SQL, and i'm trying to create an ionic mobile app using the same backend from the web app, so i am a little limited to using signalR as well. in the web app, i have certain triggers set up to fire popup notifications when certain events occur, and it works great with signalR in the webapp. the problem is : due to some restrictions i have to use ionic,and i've been searching for 3 days on a way to implement push notifications without having to resort to FCM but i haven't reached anything. is there a way to do this with ionic 3? to implement push notifications with signalR instead of FCM?
1 Answers
I'm not sure I completely understand your question, but let me see if I can start a dialog.
Ultimately, for push notification, you have to contact both APNS (Apple push notification server) and GCM (Google Cloud Messaging) to enact push notifications on both ios and android phones. So, that means that you can contact the servers directly from your app. (kind of a pain for ios, not so much for android) or you can use a middle man such as:
FCM
Onesignal: https://onesignal.com/
Amazon Simple Notification Service: https://aws.amazon.com/sns/
or a bunch of others: http://www.businessofapps.com/guide/push-notifications/
I'm not familiar with signalR per se... but I'm very familiar with push notification. You can do everything you need with http api calls from signalR, but the certification requirements for the GCM and APNS servers are difficult to keep up on the app itself. (hence so many businesses that will do it for you.)
Although, I guess one thing I'm a little confused about exactly who you are pushing to... a web service? a phone? (I'm assuming a phone since you mentioned FCM)
Edit after first comment: So, the answer (as I understand your question) is that you cannot go from signalR to a mobile device directly without using something like FCM (which I recommend) or Onesignal.
For Why... Let's start with a diagram:
You'll notice the bidirectional flow from the cloud marked APNS, GCM and FCM between the device. That means that only way to get to the phone via push notification is via APNS, and FCM, which you'll have to do through a push notification service.... such as FCM
Before any confusion sets in, let me point out some important point: 1. FCM and GCM are pretty much synonymous. FCM is the updated version of GCM that added some functionality. more info here
- FCM is both a push notification service and the messaging service. That is to say that FCM provides both the services of the gray box and the gray cloud below. As far as I know, there is nothing similar in the ios world that does both. FCM allows you to pass along messages to both android and ios phones (via FCM and APNS)
So, you don't HAVE to go through FCM to do push notifications, but even if you picked OneSignal, they will still communicate with FCM to actually send out the push notification to the phones themselves.
You're doing the right thing by starting in the android world. Push notification is significantly easier there than in ios. (The difficulty lies in the certification process which is easy after you get to know it... but it was tough for me to understand at first)
In short, this is what I would recommend: 1. use ionic native push to communicate with FCM as a push notification service (the gray box) 2. setup FCM so that it can communicate with the APNS servers as well when the time comes.
for ionic native, I'd use their github site for documentation (I'm sure you've already been there) https://github.com/phonegap/phonegap-plugin-push
For setting up FCM, I'd recommend the documentation at the firebase website: https://firebase.google.com/docs/cloud-messaging/
Note: When using firebase products in ionic... choose "web" for all documentations. For example, despite the fact that you're planning on using ios and android phones, you'd pick "get started for web" at this link: https://firebase.google.com/docs/

- 3,484
- 4
- 31
- 41
-
hello, thank you for answering! i am pushing to a phone, i'm using asp.net as my backend, ionic for mobile frontend ,and signalR to maintain a connection between my frontend and backend, i am confused as to how i can use push notifications for android at least (leaving iOS aside for now), i've been reading tutorials and the documentation of push native for ionic and haven't been able to understand well how to implement it, hence my confusion about whether or not to use FCM to send push notifications to mobile devices,if you could provide any assistance in understanding that i would be grateful – Mie ElMansy Mar 25 '18 at 08:37
-
Did any of that help? – William Terrill Mar 27 '18 at 02:40