Firebase Push Notification in Xamarin Forms - Xamarin Forms Tutorial

Поділитися
Вставка
  • Опубліковано 17 гру 2024

КОМЕНТАРІ • 122

  • @bellekassouf8852
    @bellekassouf8852 4 роки тому +19

    Thank you for the guide! Do you by chance have an iOS version setup or a link to it?

  • @manjunathams8958
    @manjunathams8958 4 роки тому +2

    Thanks bro, after some time i reopened app and checked working fine. Thanks bro, you saved my life. God Bless you..

  • @gilbertoalexandre534
    @gilbertoalexandre534 5 років тому

    I was already thinking that push notification in Xamarin only worked in ancient times ... Thanks so much for your contribution!

  • @manjunathams8958
    @manjunathams8958 4 роки тому +1

    Bro, Its working fine with android Oreo, but when i move to android pie, the code which we have written is deprecated and Applcation get crashed when i send push notification, in debug mode i got the bellow error
    Java.Lang.RuntimeException: Unable to instantiate receiver com.google.firebase.iid.FirebaseInstanceIdInternalReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" on path: DexPathList[[zip file "/data/app/com.isat.GraduateGuru-tmLocHA5EVv0pwFs-XolYg==/base.apk"],nativeLibraryDirectories=[/data/app/com.isat.GraduateGuru-tmLocHA5EVv0pwFs-XolYg==/lib/arm64, /data/app/com.isat.GraduateGuru-tmLocHA5EVv0pwFs-XolYg==/base.apk!/lib/arm64-v8a, /system/lib64]]
    Is there any way to come out of this issue? or is there any separate implementation?
    thank you

  • @JaraFPV
    @JaraFPV 3 роки тому +1

    Do you have by chance a working sample of iOS too? OR that is already implemented in the sample source code?

  • @Pushpendrasingh-rt9eh
    @Pushpendrasingh-rt9eh 4 роки тому +1

    Hi i am using vs 2019 and facing an error in Notificationhelper class Resource doesn't contain a definition for raw... please suggest what should i do to overcome this bugs

    • @SPTutorials
      @SPTutorials  4 роки тому

      you have to add a folder name "Raw" inside resource folder and put your file there.

  • @teatimewithdre
    @teatimewithdre 4 роки тому

    Thank you very much! I have been struggling with this issue for weeks

  • @lessknownindeed
    @lessknownindeed 5 років тому

    Very clear explanation..great!

  • @SubhashTiwary
    @SubhashTiwary 4 роки тому

    Getting an Error "java.exe" exited with code 1. While checking the Buld Log it says " PROGUARD : warning : there were 100 unresolved references to classes or interfaces.
    1> PROGUARD : warning : there were 2 unresolved references to program class members.". Please suggest what to do? Disabling the Proguard option in Release mode solves the problem but in that case the app size increases.

    • @SPTutorials
      @SPTutorials  4 роки тому +1

      Use linker option as Sdk Aasemblies Only and enble Multi-Desk from Android options.

  • @shahidouahdi3814
    @shahidouahdi3814 4 роки тому

    I have a small question. how can i do an action when notification received ? should i creat an interface or something ? can u help me with that ?

  • @Mryesify
    @Mryesify 5 років тому +1

    Can Xamarin allow users to send push notifications to other users? Like an Administrator having special permissions on their app?

    • @SPTutorials
      @SPTutorials  5 років тому

      yes it can.

    • @Mryesify
      @Mryesify 5 років тому +1

      @@SPTutorials Do you have a tutorial similar to this idea? Thanks!

  • @cissemy
    @cissemy 3 роки тому

    Great.
    I am getting an error @ mBuilder.SetChannelId(NOTIFICATION_CHANNEL_ID);
    NotificationCompat.Builder does not contain a definition for SetChannelId.

  • @RACKEEPTEACHER
    @RACKEEPTEACHER 4 роки тому

    Thanks was very helpfull, best regards

  • @InvincibleCosmicEnigma
    @InvincibleCosmicEnigma 4 роки тому

    Can you please tell me how do I get fcm token for my device which you pasted @1:50 ??

    • @SPTutorials
      @SPTutorials  4 роки тому

      Latest xamarin firebase messaging plugin changes,you will get an OnTokenReceived override function inside FirebaseMessagingService class

    • @InvincibleCosmicEnigma
      @InvincibleCosmicEnigma 4 роки тому

      @@SPTutorials Yes I solved it.. btw thanks for the reply. The video was great🙏😊

  • @deivydrodrigoquispepoma8344
    @deivydrodrigoquispepoma8344 4 роки тому

    Excellent video, but a question as I show the notifications that are in the background. I would appreciate your answers.

  • @damarhardy7710
    @damarhardy7710 4 роки тому +1

    Hi first of all thank you for this tutorial. But i'm having some troubles, first the notification doesn't show on Head-up display and the sound + vibrate doesn't execute as well. Do you have a solution for this?

  • @sheikhshuaib8451
    @sheikhshuaib8451 4 роки тому

    Sir, How can I achieve suppose I added a new employee from another project's FORM(responsible to add the employee) to database and in our xamarin project the notification appears about that employee and on clicking on that notification the details should be shown inside a page

    • @SPTutorials
      @SPTutorials  4 роки тому +1

      You have to pass the data payload notification,then notify to your device,and you can extract the payload from notification click intent.

    • @sheikhshuaib8451
      @sheikhshuaib8451 4 роки тому

      @@SPTutorials Sir, I am a newbie to Xamarin, please can you elaborate or send me any link or video where I can get some idea about this. And thanks for you replay, highly appreciated !

    • @SPTutorials
      @SPTutorials  4 роки тому +1

      Dear I recommand to you,to join my online xamarin training.It will help you to learn xamarin easily and deeply.Ton know more details you can contact whatsapp +918444835044

    • @sheikhshuaib8451
      @sheikhshuaib8451 4 роки тому

      @@SPTutorialsThanks for your reply , will join contact on whatsapp. And again thanks

  • @infosys9741
    @infosys9741 4 роки тому

    Thankyou, from where we can get firsbaseinstanceid

  • @3dtotalrig26
    @3dtotalrig26 4 роки тому

    In the file MyFirebaseIIDService how do you implement the method SendRegistrationToServer to send the newtoken back to firebase server ?

    • @SPTutorials
      @SPTutorials  4 роки тому +1

      yes,when you will received the new token always update it to the server.Its your custom logic,how you save it.

    • @3dtotalrig26
      @3dtotalrig26 4 роки тому

      So in your video, since you didn't implement it does it mean that the google firebase server doesnt care about it to make the cloud messaging working ? As I understand from your explanation, the device must send this token to the google firebase server to register itself. This implementation should be something common? right? Btw your video is very instructive. we really appreciate it

    • @SPTutorials
      @SPTutorials  4 роки тому

      Dear,saving the token to the database,its a user responsibility,not google.Because we manage our database externally.So that we dont need the dependency of google for saving token.

    • @3dtotalrig26
      @3dtotalrig26 4 роки тому

      Thank you very much. I finally get it. It was little bit complicated for me to understand the data flow since the API did a lot of thing automatically. The API actually send the firebase token to the google cloud messaging at the very first time without any need of coding.

  • @phamquangtrung8425
    @phamquangtrung8425 3 роки тому +1

    How to get token device?

  • @BlalKhalidTech
    @BlalKhalidTech 4 роки тому +1

    hi i am working xamarin Forms with Sql Server Database i want to show notification to all users when data insert in specific table
    Thanks

    • @SPTutorials
      @SPTutorials  4 роки тому

      use firebase,after succesfully save data to table then send notification to users.

    • @BlalKhalidTech
      @BlalKhalidTech 4 роки тому

      @@SPTutorials how i send me server data to firebase?

    • @SPTutorials
      @SPTutorials  4 роки тому +1

      @@BlalKhalidTech You dont need to send data to firebase.After saving data to sql server database,just call firebase API for sending message to user.Learn firebase properly

    • @dreamhunter2895
      @dreamhunter2895 4 роки тому

      @@SPTutorials kindly help to share code..... thanks in advance

  • @asadullahqamar4874
    @asadullahqamar4874 4 роки тому

    Nice videos on notifications! I was wondering, is it possible to use Firebase to send client to client notifications? (One user of the app on one phone sends notification to another user using the same app on another phone)

    • @SPTutorials
      @SPTutorials  4 роки тому

      Yes,using the token.

    • @tagathangelou
      @tagathangelou 3 роки тому

      @@SPTutorials Hi great tutorial - any example how to send notification to specific token device?

  • @meetgurl
    @meetgurl 4 роки тому

    Hi Sir, i have problem when installing Xamarin.Firebase.Messaging and xamarin.googleplayservices.base. it says not compatible with netstandard2. i already download net 3.0 but cannot change in my project at Target framework. please help me to solve this sir. thank you.

    • @SPTutorials
      @SPTutorials  4 роки тому

      Install latet XF version,also use latest target framework.Then try.

    • @maava
      @maava 3 роки тому

      netstandar2 error is because you need to install it on android project not on the whole project. You need to check if the package is intended for only IOS or Android or if it doesn't have a property. Usually says in the name. Example. Xamarin.Firebase.IOS.Core, Xamarin.Firebase.Android.Core etc. Also the Firebase.Messaging Nuget package is faulty, I see that its been 8 months ago since you posted this comment, but their versions still contains bugs and shows errors when running them, so that's why he used another version of Firebase.Messaging package in the video if you noticed. AND.....don't forget to clean and rebuild after each nuget installation for it to take its place in the IDE.

  • @mulayamsingh7170
    @mulayamsingh7170 4 роки тому +1

    Great explanations..
    I have implemented this code in my xamarin forms application so i got the notifications when my app is running conditions. But when i have killed my app so notification is not coming just like whatsapp, linkdin and other applications.
    So can you please let me know what should i need to do when my app is killed and I can get the notifications?
    Thanks in advance :)

    • @SPTutorials
      @SPTutorials  4 роки тому +1

      Its a big deal to implement this,read this and you can understand what you need to implement for achive your requirements
      www.quora.com/How-does-WhatsApp-or-Gmail-receive-notification-even-after-force-closing-them

    • @anassnassim
      @anassnassim 4 роки тому

      any idea dude how you do it ?

  • @AnkitChawdaRajlaxmi
    @AnkitChawdaRajlaxmi 4 роки тому

    Thanks, bro it's working for me

  • @utkarshshukla3704
    @utkarshshukla3704 3 роки тому

    Thanks for the guidance but there are two queries i want to have a look at it
    first- app icon is not able show in notification
    second- i want to navigate user to playstore on the click of notification

  • @bikeismybestfriend6875
    @bikeismybestfriend6875 3 роки тому

    Firebaseinstanceiid is deprecated, what to do now..

    • @SPTutorials
      @SPTutorials  3 роки тому

      Use FirebaseMessagingService class,inside this you will get token.

    • @bikeismybestfriend6875
      @bikeismybestfriend6875 3 роки тому

      @@SPTutorials will there be any change in the manifest then

    • @bikeismybestfriend6875
      @bikeismybestfriend6875 3 роки тому

      @@SPTutorials notification compact is obsolete, but tried converting to notification class...but there is not set title method in it

  • @vinodgomes9500
    @vinodgomes9500 4 роки тому +1

    Thanks for the video on Android. Would appreciate if you can post the same on iOS.

  • @manjunathams8958
    @manjunathams8958 4 роки тому

    is converted to when i build and showing the errorTag attribute name has invalid character '$'.

    • @SPTutorials
      @SPTutorials  4 роки тому

      if your applicationId variable is not in global,then remove this and directly set your package name here.
      Example android:name="com.yourrPackageName.android"
      just replace this.(get your package name from android project properties.)

  • @MrJesha28
    @MrJesha28 4 роки тому

    hi, how firebase message to display as display alert on xamarin?

    • @SPTutorials
      @SPTutorials  4 роки тому +1

      when receive firebase message then pass this message using messaging center and show display message.Simply use messaging center.Watch my messaging center video carefully.

    • @MrJesha28
      @MrJesha28 4 роки тому

      @@SPTutorials thank you, its work

    • @MrJesha28
      @MrJesha28 4 роки тому

      @@SPTutorials Hi again, how get data in additional options of firebase messaging?

    • @SPTutorials
      @SPTutorials  4 роки тому

      @@MrJesha28 See docs.

  • @shanmuhammad937
    @shanmuhammad937 3 роки тому

    Thanks for this tutorial but I am not receiving notification when app is killed. Can you please guide me how to use data message for this?

    • @SPTutorials
      @SPTutorials  3 роки тому

      For data message you have to send a specific payload, you can see firebase docs for more info.

  • @manjunathams8958
    @manjunathams8958 4 роки тому

    Thanks bro, Coded without any error. Sending Messages from firebase not displaying in mobile phone (android pie) any reason?

    • @SPTutorials
      @SPTutorials  4 роки тому

      Follow all steps properly.

    • @maava
      @maava 3 роки тому

      Could be the Firebase.Messasing Nuget Package that is something wrong with, check log if it shows any errors or simply increase your framework from android pie(9) to (Q. 10) or (11.R)

  • @manjunathams8958
    @manjunathams8958 4 роки тому

    Bro, I had one doubt, In the video you told that we can save generated token(device ID) into db, without any login information how can we save? or How can we get that device Id after login into the app? How can we access that device id wherever we want in application?
    thanks in advance !

    • @SPTutorials
      @SPTutorials  4 роки тому

      Dear its a simple logic.Follow these step
      1.After getting device token save it to a session preference variable(Xamarin Essestials Preference).so that it will be saved as a cache.
      2.Next,After user login fetch that preference cache value(device token whichone you saved).And send it to the server.Bcz after login you got your username and the token whichone you saved.
      3.Every time save the token to the preference,when it generate
      Second logic:
      You can save this token by your android device unique id.
      now its your choice which logic you should use.
      I think you can understood this now. :)

    • @manjunathams8958
      @manjunathams8958 4 роки тому

      @@SPTutorials Bro, I tired the 1st one, but that token not coming, its return always false because no token, 2nd Logic i won't get.

    • @SPTutorials
      @SPTutorials  4 роки тому

      @@manjunathams8958 Do it correctly.

    • @manjunathams8958
      @manjunathams8958 4 роки тому

      @@SPTutorials Ya i did it what you say, no error but token is always empty :(

    • @manjunathams8958
      @manjunathams8958 4 роки тому

      @@SPTutorials Bro, I find out the how to store token, but that token itself not generating because "OnTokenRefresh()" Method itself not calling at all in the class "MyFirebaeIIDService". any idea?

  • @chintukalyan7437
    @chintukalyan7437 3 роки тому

    Hi, can you do video on fcm push notifications with image in Android and iOS, it will help us.

  • @Jorge-st2tm
    @Jorge-st2tm 3 роки тому

    Perfect !! Thank you !!

  • @learnwithambalika3302
    @learnwithambalika3302 5 років тому

    where do i get the user token for specific user?

    • @SPTutorials
      @SPTutorials  5 років тому

      The override method OnTokenRefresh from MyFirrbaseIIdService class.You will get the token from refreshedToken variable.And this token is user specific.

    • @learnwithambalika3302
      @learnwithambalika3302 5 років тому

      @@SPTutorials thankyou!!

    • @SPTutorials
      @SPTutorials  2 роки тому

      Log it in console inside the OnTokenRefresh method

  • @abbasmunshi7610
    @abbasmunshi7610 5 років тому +1

    Will you given a tutorial for AdSense?

  • @gastonhernandez9080
    @gastonhernandez9080 4 роки тому

    Nice tutorial !! Works good. What about if I want to send a notification to specific user when I click some button in my app? for example, I click a button in my app that says "Alert to John" and then John receives a notification that says "Hey John, David Alerted You!"

    • @SPTutorials
      @SPTutorials  4 роки тому

      Its preety easy,using token you can send notification anyone.First you need to save all users token to your database.When you click on button then fetch the user token from your database and send notification using firebase rest API.

    • @gastonhernandez9080
      @gastonhernandez9080 4 роки тому

      @@SPTutorials Thanks for the reply and your time. Yes, it is what I imagined and had in mind but I have no idea how to implement it since it is my first app in xamarin and I can't find anything that explains this with any example in C#

  • @tonyriddle7646
    @tonyriddle7646 4 роки тому

    can anyone share Playlist for full implementation???

  • @DreamArt29
    @DreamArt29 4 роки тому

    how can we send image and icon from firebase ?

    • @ousspero
      @ousspero 4 роки тому

      like any message, just convert it to base 64

  • @acc6540
    @acc6540 3 роки тому

    Hello, thank you for the tutorial ...
    Please send us the NotificationHelper file ..

    • @acc6540
      @acc6540 3 роки тому

      Oh, I did not pay attention, you put the GIThub link .. Thank you

  • @dexdexdex1293
    @dexdexdex1293 3 роки тому

    i have 7 errors in NotificationHelper.cs
    i copy your code in github.
    thanks

    • @SPTutorials
      @SPTutorials  3 роки тому

      add the namespace,and also install the required libraries.

  • @faridshawky6992
    @faridshawky6992 5 років тому +1

    Good,What about IOS?

  • @AmerAlfaqeeh
    @AmerAlfaqeeh 4 роки тому

    thank you very gooooooood , Please for IOS if you can

  • @hanitwister3708
    @hanitwister3708 4 роки тому

    Bro i need your help i there any way to contact you?

  • @abbasmunshi7610
    @abbasmunshi7610 5 років тому

    Really appreciate.

  • @adarshbhat7436
    @adarshbhat7436 4 роки тому +1

    Pleae give Firebase push notification for iOS tutorial

  • @alexandresanlim
    @alexandresanlim 3 роки тому

    Can you create a new tuto to push notification in xamarin?

    • @SPTutorials
      @SPTutorials  3 роки тому

      I already have this,check on my playlist

  • @isax55
    @isax55 5 років тому

    What happened with iOS

  • @QueXopaPTY
    @QueXopaPTY 4 роки тому

    Thanks a lot!

  • @RicardoJosue
    @RicardoJosue 5 років тому

    Some tutorial about background services in xamarin forms

    • @SPTutorials
      @SPTutorials  5 років тому +1

      Dear,Already have that,find it from the playlist.

    • @RicardoJosue
      @RicardoJosue 5 років тому

      @@SPTutorials thanks, this video is great, will you have more videos about notifications?

    • @SPTutorials
      @SPTutorials  5 років тому

      Will upload it after few days.

    • @RicardoJosue
      @RicardoJosue 5 років тому +1

      @@SPTutorials great, greetings from Mexico

  • @gulamfahadahmed9365
    @gulamfahadahmed9365 5 років тому

    mam/ sir please make video on login and sign up page with firebase, please

  • @tariqalzubi5137
    @tariqalzubi5137 4 роки тому

    thanks