VS 2022 Xamarin.Forms Firebase Cloud Messaging working example - xamarin.forms

Trying to add Push Notifications to my Xamarin.Forms app, and cannot find any working example to implement Firebase Cloud Messaging.
I mean, not a single working example of all the examples/tutorials.
Can you point me to one, please?

You can first check document Firebase Cloud Messaging. This article provides an overview of how FCM works, and it explains how to configure Google Services so that your app can use FCM.
The implementation process in xamarin android is similar to that on xamarin forms.
You can also find more tutorials in your browser.
For example:
Implement Push Notifications with Xamarin.Forms (Android) and FCM
and
Implement Push Notifications with Xamarin.Forms (iOS) and FCM .

Related

Push Notification on Web view app using Xamarin and Firebase

How can I send push notification to a web view application using Xamarin and Firebase Cloud Messaging?
To add push notification ability to your app ,you have to implement it in each platform project:
For Android, please read the document, there are detailed steps about how to implement remote Notifications with Firebase Cloud Messaging.
For iOS, You can use Xamarin.Firebase.iOS.CloudMessaging to send iOS push notification by FCM.
There are also steps here: Firebase Cloud Messaging on iOS

Push notification in xamarin.forms

I asking this question for clarification about push notification in xamarin. I have a xamarin.forms app which will display certain items in list view.The back-end of my app is in .Net. The items which shows in list view inside app is added from back-end.What I am trying to achieve is whenever items add in back-end, I want to receive notification in my app.
For the notification part I found two options.
FirebasePlugin Link
Azure push notification
I need some clarifications about
Which way should I follow? Is there any other cost effective way to implement push notifications in ios and android in cross platform way(Xamarin.forms)?
For implementing push notifications in ios ,is APN certificate is mandatory? Currently I don't have apple developer account.So for testing notification in ios seems difficult.
Any help or guidance is appreciated
Which way should I follow? Is there any other cost effective way to implement push notifications in ios and android in cross platform way(Xamarin.forms)?
From my experience the easiest way for me was to use firebase console to manage notifications both for Android and iOS. I have similar platform that uses push notifications to users whenever webapp database is updated, by certain users. To my disappointment Azure Push were more complicated to manage.
For implementing push notifications in ios ,is APN certificate is mandatory? Currently I don't have apple developer account.So for testing notification in ios seems difficult. Any help or guidance is appreciated
Yes. Apple developer account is mandatory. Moreover you cannot test your push notifications on iOS emulator. You must use physical device.
App Center Push is what I've started using now. Push services are free (which is great) and they have Xamarin SDKs which handle most of the platform specific config so it's really quick to get push working.
As the other answer has stated, you will still need an apple developer account and physical device to test on iOS.
It's part of the the Microsoft App Center offering which provides many other useful services for mobile development.
#groveale App Center Push feature is being retired(https://learn.microsoft.com/en-us/appcenter/push/) so I would suggest using firebase or the implementation provided by xamarin docs.

SDK for creating Push Notification for Xamarin Forms

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.

push notification in Xamarin.forms PCL

I need to implement push notification in xamarin.forms project.
I go through these links but cannot find a good sample code.
How to approach push notifications on Xamarin.Forms project?
Add push notifications to your Xamarin.Forms app
Xamarin Push Notifications Using Azure Notifications Hub
implemented Push Notifications in awesome Xamarin.Forms
Most of sample is using azure service. I do not use that one. The back end team will manage to send notification to device. I just need to pass token of notification and handle the given notification at my end.
I got one plugin for Push Notification but cannot find a sample or some useful code for how to use or implement it.
xamarin-plugins for PushNotification

Can use Google's Cloud Messaging for iOS in a hybrid app?

I am planning to build a "hybrid app" using PhoneGap which needs to have a iOS push notification engine.
And I want to use Google Cloud Messaging for sending push notifications to the iOS (I have used this for sending notifications to Android).
My questions here are:
Can I use Google Cloud Messaging for iOS in an hybrid app (using PhoneGap's https://github.com/phonegap-build/PushPlugin)?
Are there any changes that I may have to do while using the above plugin?
I have used the above PhoneGap plugin to receive notifications from GCM and APNS separately but this time I want to use the GCM for both iOS and Android.
Any help will be appreciated.
I also have used GCM and APNS separately for send push notifications to Android and iOs devices independently.
For all the documentation I've read, GCM for iOs devices is an approach of the APNS service but using the same structure that GCM is using for Android devices. I think that if you have used the APNService, you have found all the hard steps (certificates, using strictly a Mac for some things, ...) so, answering to your questions:
Yes, you can use the GCM for iOs with Phonegap plugin because GCM Server sends the data that PhoneGap's plugin is ready to receive (as you can see in the GCM Server Reference there are some data specific for APNS (nothing that you don't know if you have worked with APNS)).
If you are preparing a native app for iOs, you should see the GCM iOs Client documentation because you will have to use the iOs API but it's not your problem.
I don't expect that you have to do changes while using PhoneGap's plugin. You will only have to use PhoneGap's implementation for iOs devices and get ready to receive push notifications (but if you have some troubles, please, I will be pleased to know them).
Good luck!

Resources