I want to create my own push notification mechanism for my own iOS applications.
I compared some services like pushy.me or Google Firebase. I think Pushy is the only service that can push notifications independent from Apple APNs, but it uses simple HTTP long-poll requests to receive notifications (in the iOS SDK).
But how does Firebase work? Does it still depend on Apple's APNs? How will it affect my battery life?
Firebase Cloud Messaging (FCM) delivers push notification to iOS devices via Apple's Push Notifications service. Also FCM extends functionality of push notifications.
How FCM extends?
FCM works with iOS and Android. Cool feature if you have the app for both platforms;
Don't need to develop backend for sending notifications, storing pn tokens etc. Just register your app in the Google Developer Console and follow User Guides. For sending a push just execute request to https://fcm.googleapis.com/fcm/send with params;
Broadcast notifications. The app subscribes to a topic and then you can send a notification to all topic subscribers. Very cool;
Upstream messages (send data to the server)
Also Google has others services you can extend FCM with. For example Cloud Functions.
I didn't find that FCM integration take big affect to battery life in my apps.
UPDATE:
FCM framework sends push notification token (and other info) to Google services. Also as I mentioned above you can subscribe app for a specific topic. Than Google knows which device needs to send a push to.
There is a possibility to setup FCM in iOS automatically(with using method swizzling). FCM exchange AppDelegate methods and knows your's device pn token.
Firebase Cloud Messaging (FCM) utilizes APNs (Apple push notifications services) for delivering the messages to iOS devices.
So basically, FCM wraps iOS methods like registerForRemoteNotifications or didReceiveRemoteNotification using method swizzling (BTW, you can disable this if you wish, although I can't see any reason...).
On the technical side - the phone is keeping an open connection with APNs and this tunnel is used for sending the messages themselves.
Related
I'm about to develop an app similar to a birthday reminder and I plan to use firebase for push notifications but what makes me second question my choice is whether users will be able to receive a birthday notification if they are offline(not connected to internet for the whole birthday day). I know firebase has some offline persistence support but I'm not sure if this includes push notifications support. Are there any options to achieve that with firebase or with any other tool compatible with react native?
If the device is not connected to the internet, it is going to be impossible to deliver messages to it through Firebase Cloud Messaging or other internet protocols.
The common way to deal with such a scenario is to deliver the message to the device when the user does have an internet connection, and then only display it once it's the right time. By sending a data-only message through FCM, your application code controls exactly what happens with the message data.
There are essentially two types of notifications: in app messaging and cloud messaging. Both are offered by Firebase: In App Messaging and FCM (Firebase Cloud Messaging).
The details you've given about your app is a little bit vague but if you're asking for push notifications, then FCM does the job. FCM will send notification when the app is on background or killed (exited out). When you say device is offline I'm assuming you mean when the user isn't using the phone. Yes, the notification will still come.
https://firebase.google.com/docs/cloud-messaging
I'm confused about the implementation of cloud messaging through FCM. To send an iOS device a remote (push) notification, an iOS device token is needed for APNs. However, a Firebase app doesn't interface with APNs, it interfaces with FCM, which interfaces with APNs. But to send a push notification (or message) to any client through FCM requires an FCM token. Does this mean that the iOS device token is not needed for a Firebase app to send push notifications to iOS devices?
Only an FCM token is required to send a message to a device. There is no Apple-specific data required. Firebase handles the details of each underlying push notification system.
Firebase uses method swizzling to automatically map your FCM token to your APNs token, as explained in the Firebase Docs here (or see images below).
I was able to integrate Firebase Push Notification into my android/ios app. My apps started getting international users and my question is Firebase Push Notification still works fine for them?
Is there anything i need to do to support Firebase Push Notification internationally?
No extra implementation needed. The notifications target the devices. So long as the device meet the pre-requisite to receive a message (just a stable connection) then it should be able to receive the sent notifications.
newbie here. I was doing some research on using Xamarin Forms for Push Notification. Understand there are APN (Apple Push Notification), FCM(Google) and WNS (Microsoft). However, I could not understand the iOS App rule on using Push Notification:
1) Push Notifications
https://developer.apple.com/app-store/review/guidelines/2016-06-13/
1.1) Apps that provide Push Notifications without using the Apple Push Notification (APN) API will be rejected
1.2) Apps that use the APN service without obtaining a Push Application ID from Apple will be rejected
what if I use FCM ?
2) What is the SDK for Xamarin forms to build a push notification app which will doing the registration and interacting with app back-end?
What is the best approach for Xamarin Forms?
Thanks
Apple Push Notification Service or (APNS) is the only one who can send push notifications to an iOS device. This is why we provision our app with the proper certificate.
The same applies to FCM or WNS. However, services like Amazon Simple Notification Service (AWS SNS), wrap around all three providers and allow us to make one simple API call to recieve notifications from all 3 providers.
For example, we then provide our certificate that Apple provides us to authorize SNS to send a notification to APNS on our behalf. Push notifications are usually device/platform specific.
AWS SNS Xamarin SDK documentation has good pointers : http://docs.aws.amazon.com/mobile/sdkforxamarin/developerguide/sns.html
This is a Xamarin.Forms Github example for the AWS SNS service.
I am novice in notification sending.
I have read some materials and I encountered with the words like
pushwoosh
and
google cloud messaging
For me it(and pushwoosh and GCM) looks like a resource for sending notification.
Also I understand that these words are related but I don't understand this relation(hierarchy)
Please clarify this relation.
Google Cloud Messaging, or GCM, is a free service by Google that can deliver messages from your server to your Android app. The app can choose to handle such messages by displaying notifications to the user.
PushWoosh is a 3rd party service (one of several, such as UrbanAirship and Parse) that has an API for sending push notifications for multiple platforms, including Android and iOS.
PushWoosh uses Google Cloud Messaging under the hood to send the messages to Android devices.
Your server can interface directly with Google's GCM server or interface with a 3rd party provider, which can cost you money, but can be easier to implement.