如何使用 Azure SDK 在通知上添加声音

How to add a sound on a notification using Azure sdk

有谁知道如何在 java 上使用 Azure 的通知中心添加声音。

我所做的是:

添加了依赖:

<dependency>
    <groupId>com.windowsazure</groupId>
    <artifactId>NotificationHubs</artifactId>
    <version>0.0.5</version>
</dependency>

并按照文档说明发送通知:

            INotificationHub hub = new NotificationHub("connectionString", "hubPath"); 
            Notification n = Notification.createGcmNotification(message);
            Set<String> tags = new HashSet<>();
            tags.add(tag);
            hub.sendNotification(n, tags);

我一直在寻找如何添加声音,但我找到了。

我打算向 iOS 和 Android 客户发送通知。

提前谢谢你。

Does anyone know how to add a sound with the notification hub of Azure on java.

不幸的是,目前 Azure 通知中心不支持它。我也找到类似的 MSDN thread.

您可以向 azure team 提供反馈。

如果你还想这样做。我的解决方法是你可以参考APNS or GCM。另请注意播放量限制大小。

参考: