Azure / azure-notificationhubs-android

Android SDK and Samples for Azure Notification Hubs
Apache License 2.0
33 stars 63 forks source link

Use NotificationHub.start() to register one app with multiple Azure hubs #251

Open beatsys opened 2 years ago

beatsys commented 2 years ago

Is it possible to register a single app with multiple Azure hubs ? I'm using Kotlin. If not any alternative way already in the SDK ?

The NotificationHub.start() method doesn't appear to work if called a second time with the second hub's parameters.

Example code: val name2 = "SHMNChannel2" val descriptionText2 = "Notification Channel2" val importance2 = NotificationManager.IMPORTANCE_DEFAULT val channel2 = NotificationChannel("NC2", name, importance).apply { description = descriptionText2 }

        val notificationManager2: NotificationManager =
            getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager

        notificationManager2.createNotificationChannel(channel2)
        NotificationHub.start(this.application, "<HUB-NAME>", "<CONNECTION-STRING>")