Azure / azure-notificationhubs-samples

Microsoft Azure Notification Hubs Samples
Apache License 2.0
161 stars 240 forks source link

Which samples would you like to see? #56

Open mpodwysocki opened 5 years ago

mpodwysocki commented 5 years ago

As you have noticed, we have a number of samples in a number of languages. Going forward, as we modernize these samples, which languages would you like to see? Note that this is a poll and not any guarantee whether we will implement any of all of them.

Clients:

Servers:

jimseiwert commented 5 years ago

Client: JavaScript via Cordova, Ionic Server: NodeJS and .Net Core

imtiyaz-c commented 5 years ago

Client: JavaScript via Cordova, Ionic Server: NodeJS and .Net Core

jwargo commented 5 years ago

I updated the docs with an SDK page listing the different SDKs we know of (ours and third-parties. Will be published soon. On the Cordova side, I created a sample project using this SDKL: https://github.com/derek82511/cordova-azure-notification-hubs. with a sample app here: https://github.com/jwargo/cordova-azure-notification-hubs.

folego commented 5 years ago

Ionic 4 please! I tried to use AppCenter, but I can't receive the notification event. My last try it's to use directly the Cordova Plugin.

jwargo commented 5 years ago

@folego I've been trying to get the third-party Cordova plugin working in Ionic 4 and Capacitor has an issue with it. I reached out to the Ionic team, but never heard back. I will submit an issue on the Capacitor GitHub repo and see if I can get their help there.

dbwelch commented 4 years ago

Xamarin Forms, a little surprised it's not already there.

jwargo commented 4 years ago

@folego I've been trying to get the third-party Cordova plugin working in Ionic 4 and Capacitor has an issue with it. I reached out to the Ionic team, but never heard back. I will submit an issue on the Capacitor GitHub repo and see if I can get their help there.

Here's content from a blog post I'm publishing on Ionic 3/4:

Ionic 4 delivered big changes for Ionic. 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.

We created a sample application 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.

mcovertt commented 4 years ago

It would be great to see an example of Azure Notification Hub used with Web Push for PWA.

Client: JavaScript Server: .NET Core

jwargo commented 4 years ago

@mcovertt Unfortunately, we don't support browser notifications today although this is a capability we want to add to the service.

seregagorl commented 4 years ago

@mcovertt Unfortunately, we don't support browser notifications today although this is a capability we want to add to the service.

Just to confirm: Azure Notification Hub can't be used for Push Notifications to PWA across browsers? or there is no sample for it at the moment? This sample looks relevant https://github.com/Azure/azure-notificationhubs-samples/tree/master/PushToSafari

jwargo commented 4 years ago

@seregagorl correct, it cannot. That sample is browser specific and there used to be one for Chrome as well, but Google removed the functionality we used to push to those browsers. We are very interested in adding browser push support to Azure, but we have nothing at this time.

seregagorl commented 4 years ago

Appreciate your quick response 👍

On Thu, Jan 30, 2020, 10:12 AM John M. Wargo notifications@github.com wrote:

@seregagorl https://github.com/seregagorl correct, it cannot. That sample is browser specific and there used to be one for Chrome as well, but Google removed the functionality we used to push to those browsers. We are very interested in adding browser push support to Azure, but we have nothing at this time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-notificationhubs-samples/issues/56?email_source=notifications&email_token=ABD2235C6XKZJNKM2IAM6U3RALU6HA5CNFSM4GASEFX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKLKXNY#issuecomment-580299703, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD2236KOPGKOHRQLSJHSPTRALU6HANCNFSM4GASEFXQ .

ShaneOsborne commented 4 years ago

The EnterprisePushBackendSystem and 2 othe rsolutions have been removed but the original documentation https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-enterprise-push-notification-architecture still refers to this repo

brucelane commented 2 years ago

Hi, ionic 5 or upcoming ionic 6 with React would be nice! I might create a PR if I succeed on my own

drmanhatin commented 2 years ago

@seregagorl correct, it cannot. That sample is browser specific and there used to be one for Chrome as well, but Google removed the functionality we used to push to those browsers. We are very interested in adding browser push support to Azure, but we have nothing at this time.

@jwargo This is a bit of a grave dig, but maybe its relevant. I have used this code to send push notifications to a PWA installed on android.

https://github.com/drmanhatin/pwa_azure_notification_services_push_notification

  1. obtain device code through pwa
  2. register device using registerdevice.js
  3. send message using sendmessage.js