Need sample App for Push Notification using ONLY REST Api service. Please share the link.
The sample applications available use the IBM MobileFirst Push SDK, which automatically invoke the MFP Push REST endpoints.
There are no samples available that invoke MFP Push endpoints directly without SDK.
All the MFP Push REST endpoints are published here.
You will have to create your own sample that invokes the REST endpoints. You can capture and analyze the network traffic between MFP Push SDK and Push service to understand the sequence of events.
Related
I am looking at using Azure Notifications Hub for device registrations on the backend. I was thinking about using Firebase to handle both Android and iOS as it has the capabilities of doing that. I am using ionic so would be using the firebase plugin.
Is it possible to send pus notifications from Azure Notifications Hub to iOS through firebase or does it have to only go through APNS?
Azure Notification Hubs sends Android Notifications through FCM and macOS/iOS notifications through the Apple Push Notification service (APNs).
Azure Notification Hubs has not been tested sending APNS notifications through Firebase Cloud Messaging (FCM); it's not a supported configuration.
If you don't mind me asking, what is it about FCM that makes you want to send Apple notifications through it? All that does is add an extra layer of complexity on top of something ANH already does quite well.
#AndySousa I answered your Azure Forums question on the same topic - copying the response here:
I'm trying to get a blog post published on this, but for Ionic 4 here's what I learned:
The Ionic team made a lot of changes to the framework plus released Capacitor, their alternative for Apache Cordova. Capacitor still supports Apache Cordova, but only a subset of the existing plugins. Ionic also built many common plugins into Capacitor, so you no longer ‘need’ Cordova plugins to deliver certain functionality to your app.
One example of this is the Capacitor Push Notifications plugin which adds support for registering for and processing push notifications to Capacitor. If you follow the procedure to create an Ionic 4 project, add the cordova-azure-notification-hubs plugin to it, and add the code that registers for and processes notifications like you did for Ionic 3 applications, you’ll find that your application registers successfully, but never ‘receives’ any notifications.
What’s happening is that the cordova-azure-notification-hubs plugin is properly managing the registration process with Azure Notification Hubs, but the Capacitor Push Notifications plugin intercepts all notifications that arrive on the device, circumventing the Azure Notification Hubs SDK.
This means that to automatically register for and receive notifications, your Ionic 4 application must use both plugins. The cordova-azure-notification-hubs plugin to manage automatic registration, and the Capacitor Push Notifications plugin to process them when they arrive. Special thanks to Matthew Podwysocki (Microsoft) and Mike Hartington (Ionic) for figuring this one out.
We created a sample application (https://github.com/Azure/azure-notificationhubs-samples/tree/master/Ionic/ionic-4) that shows how to use the plugin in an Ionic 4 app. The sample implements the same Ionic Provider for Azure Notification Hubs that manages registration, but adds additional code to use the Capacitor Push Notifications plugin to process received notifications. With that in place, it’s basically the same UI and logic as the Ionic 3 sample (updated for changes in Ionic 4).
The Capacitor Push plugin also supports a similar registration event listener you can use to grab the device push token and send it to your app backend for Azure Notification Hubs registration. Doing this eliminates the need to use the cordova-azure-notification-hubs plugin in your Capacitor application.
Note: The sample app I reference here is provided for educational purposes, we do not provide Ionic support.
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.
Is there way to send push-nofications in Appcelerator not from console (https://platform.axway.com/)?
For example does Appcelerator have custom API to send push-notifications? e.g. our server sends request to appcelerator API and it sends push-nofication to devices.
There are tons of free and open source modules out there with which you can set it up yourself. Some rely on services like Onesignal, others are completely open.
Keep in mind, for iOS you don't need a module, you just get the token (as per docs) and then you just send it to your backend and it works.
A good module for Android with which you can use your own backend is Ti.Goosh
Yes you can use axway REST API to send your push notifications.
https://docs.appcelerator.com/platform/latest/#!/guide/Push_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.
Not finding anything here:
https://console.ng.bluemix.net/docs/services/mobilepush/index.html
I'm looking for a web console for sending messages to apps - similar to what is offered by UrbanAirship and Parse (rest its soul).
Yes the IBM Push Notification service has a Push Dashboard where you can author messages, customize the notification payload, specify the target audience and send notifications to both iOS and Android in both Production and Sandbox modes.
Here's a screenshot of the Push Dashboard:
The docs go into it a bit here: https://console.ng.bluemix.net/docs/services/mobilepush/enablepush_ios.html#t_push_send
To access it you'll just need to create a Bluemix application using the MobileFirst Services Starter Boilerplate, and then navigate to the IBM Push Notifications instance from your application dashboard at which point you will be prompted to provide your .p12 certificate and/or GCM credentials.