Xamrin Android Push Notification using Firebase Cloud Messaging


  1. Create a New Project. Select  Single-View App (Android) under Installed > Visual > C# >Android


  2. Open AndroidManifest.xml file under your Android project's Properties


  3. Copy value of package attribute in manifest tag


  4. Open your browser and goto https://console.firebase.google.com . Sign-in with your Google acoount create a new one


  5. Click on Add Project. Choose a project name. Here, the name is PushNotificationGCM


  6. Click on Add Firebase to your Android App


  7. Paste the package name copied in Step 3 and click Register App


  8. Click on Download google-services.json and click continue

  9. Copy google-services.json file into Android project


  10. Include google-services.json file into Project's Solution by clicking View All Files in Solution Explorer tab, Right-click google-services.json file and click Include In Project


  11. Right-click Android project and click Manage Nuget Packages


  12. Click on Browse tab, search for Xamarin.GooglePlayServices.Base and install the package


  13. Search for another Nuget package Xamarin.Firebase.Messaging and install the package


  14. Right-click project to Build Solution. Now Close and re-open Visual studio

  15. Right-click on google-services.json file and click Properties


  16. Select Build Action to be GoogleServiceJson


  17. Open AndroidManifest.xml under Android project's Properties


  18. Right-click Android project and click Properties. Goto Android Manifest tag and check INTERNET checkbox under Required permissions


  19. Add a new C# Code File. Name it according to your project. Here it's name is DemoFirebaseIdServices.cs . Include the following code


  20. Build the Solution and Run the project in debug mode on Android device.Make sure that the  device is connected to Internet and Google Play Services are installed on device


  21. Once the project is running watch the Output Window in Visual Studio where refresh token will appear. Copy the token.


  22. Open your Firebase project in browser that you created in Step 5. Click onNotification menu in Navigation bar on the right and click on Send Your First Message


  23. On the Compose message page, add message text, add message label, select Single device under Target section and add registration token copied in Step 22 and click Send Message


  24. The notification will then be sent to Single device and the next page shows status of sent Notification Message


  25. Completed status of notification message shows that the notification has successfully reached the target device

Comments

  1. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about cloud messaging. oracle fusion scm

    ReplyDelete
  2. This app looks promising, and I really enjoyed reading your article because the information was presented in a clear and useful way. I always prefer articles that discuss an application from a practical user perspective instead of simply listing features. Your explanation helped me understand why people may be interested in Xuper TV Descargar. I particularly appreciate apps with simple navigation because I do not want to spend too much time figuring out where everything is located. Xuper TV APK seems to offer an interesting entertainment experience, and I would like to explore it more. Thanks for writing an informative article that made the topic easier to understand.

    ReplyDelete
  3. App articles that actually explain the user experience are always worth reading, and I think your post did a good job of doing that. I found the information about Freecine APK particularly interesting because I had seen the name before but did not know much about the application. The possibility of browsing different entertainment content from one place sounds convenient for casual users. I also like applications that keep their menus simple because complicated layouts can make the viewing experience frustrating. Your article gave me a useful introduction and helped me understand some of the features more clearly. Thanks for putting together such an informative post about Freecine APK.

    ReplyDelete
  4. App information can sometimes be difficult to understand when articles only focus on technical details, so I really appreciated the simple explanation in your post. Your article was helpful and gave me a clearer idea about what Xuper Hydra APK is designed to offer. From my experience, I prefer applications that are easy to navigate and do not require a lot of effort just to find basic features. This app caught my attention because it seems focused on providing a convenient entertainment experience. I am still exploring its different options, but so far I have found the overall interface reasonably straightforward. Thanks for sharing such useful information.

    ReplyDelete

Post a Comment

Popular posts from this blog

Implementing Basic and JWT Token authentication with C# .NET

.NET Core 3 officially comes to Windows IoT Core

Microsoft Azure DevOps : A Complete CI & CD solution in the cloud

Setting up CI and CD pipeline in Azure DevOps for ASP.NET Core and Azure Web Apps

Securing Powershell Scripts with Code-Signing Certificate

Understanding Powershell ExecutionPolicy and securing Powershell CmdLets/Scripts with Code-Signing Certificate

Setting up Free Custom Domain on Microsoft Azure Web App Service

Microsoft Azure Blob Storage - Managing Blobs and storage containers from C#

Fundamental of Powershell Scripting