GithubHelp home page GithubHelp logo

vivienchevallier / demo-azurenotificationhub.webjobhealthnotifier Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 63 KB

Source code for the presentation http://www.vivien-chevallier.com/Articles/take-control-of-multi-platform-push-notifications-with-azure-notification-hubs

License: MIT License

PowerShell 6.80% C# 93.08% ASP 0.12%
azure azure-webjob azure-webjobs-sdk azure-notificationhub azure-webapp asp-net-web-api firebase-cloud-messaging google-cloud-messaging android xamarin-android

demo-azurenotificationhub.webjobhealthnotifier's Introduction

Demo-AzureNotificationHub.WebJobHealthNotifier

Source code for the presentation http://www.vivien-chevallier.com/Articles/take-control-of-multi-platform-push-notifications-with-azure-notification-hubs

Installation steps

Set up Firebase Cloud Messaging

You must acquire the necessary credentials to use Google's FCM servers. See: Firebase Console New Project

Once the project in Firebase created you will be able to retrieve:

  • A google-services.json file
  • A Firebase Server Key

Deploy resources to Azure via ARM template

In the solution, you will find an Azure Resource Group deployment project: WebJobHealthNotifier.AzureResourceGroup

Update the parameter named notificationHubGcmApiKey with your Firebase Server Key and deploy.

Once the deployment successful your resource group will contain the following resources:

  • App Service plan
  • App Service
  • Notification Hub Namespace
  • Notification Hub
  • Storage account

Publish the API

In the solution, you will find the API project named: WebJobHealthNotifier.Api

From Visual Studio, publish it to the App Service previously created. It will also publish the WebJob WebJobHealthNotifier.WebJob at the same time.

Once published successfuly you'll see a message like the following in the Output:
Web App was published successfully http://wjhnwaapii2hlstulricu2.azurewebsites.net/

Android Application

1. Set API Uri

In ApplicationService.cs set ApiUri property using the Url of the Web App previously published.

2. Update google-services.json file

Update the google-services.json file using the one retrieved from your Firebase Console New Project.

3. Deploy

Deploy to an Emulator or a device.

Storage account

In the storage, create an Azure Queue named queue.

How to test

1. Android Application

Launch the application and select Log Token to register the device in Notification Hub.

Then select Feeds Subscription and subscribe to JobsFailing and or JobsSuccessful feeds.

2. Add messages to the storage queue

Via the Cloud Explorer in Visual Studio or your favorite explorer add messages to the queue:

  • Message with text: will simulate a successful job and send a notifcation to Notification Hub
  • Message with no text: will simulate a failing job and send a notifcation to Notification Hub

Useful Links

Azure Notification Hubs

Azure WebJobs SDK Extensions

Xamarin Android

demo-azurenotificationhub.webjobhealthnotifier's People

Contributors

vivienchevallier avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

sudarsan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.