简体   繁体   English

适用于Android的Windows Azure通知中心

[英]Windows Azure Notification Hub for android

There's a very few examples on the web showing how to work with Notification Hub and android. 网络上有很少的示例显示如何与Notification Hub和android一起使用。 Besides that, it seems that the samples are using a old version of android SDK. 除此之外,似乎示例正在使用旧版本的android SDK。 I'm trying to use the notification hub with tags (first with android), but I could not find a good resource to learn how to do that. 我正在尝试使用带有标签的通知中心(首先是android),但是我找不到很好的资源来学习如何做到这一点。 I'm wondering if anyone already did that, and could show me some code. 我想知道是否有人已经这样做了,可以给我看一些代码。

I'm following this article: http://www.windowsazure.com/en-us/manage/services/notification-hubs/get-started-notification-hubs-android/ 我正在关注这篇文章: http : //www.windowsazure.com/en-us/manage/services/notification-hubs/get-started-notification-hubs-android/

but as I said, I would like to notify users according to tags. 但正如我所说,我想根据标签通知用户。

I'll appreciate any help. 我将不胜感激。

PS: I'm not a android/java programmer, so a working project will be awesome. PS:我不是android / java程序员,所以可以工作的项目很棒。

Are you able to run the get started sample that you linked? 您是否可以运行您链接的入门示例? Even if they refer to API version 17, it should work the same (you can use Google API 18 without problems). 即使他们引用了API版本17,它也应该可以正常工作(您可以毫无问题地使用Google API 18)。

From the sample code, in order to use tags, simply add your tags in the call: 为了使用标签,从示例代码中,只需在调用中添加标签即可:

hub.register(regid, tags); hub.register(regid,标签); // with tags a list of strings such as ["Yankees", "RedSox"] //带标签的字符串列表,例如[“ Yankees”,“ RedSox”]

Then when you send a notification you have to specify the tag you want to target. 然后,当您发送通知时,您必须指定要定位的标签。

Unfortunately, we do not have the full Breaking news tutorial for Android yet (only Windows and iOS): http://www.windowsazure.com/en-us/manage/services/notification-hubs/breaking-news-dotnet/ 不幸的是,我们还没有完整的Android最新新闻教程(仅限Windows和iOS): http : //www.windowsazure.com/en-us/manage/services/notification-hubs/breaking-news-dotnet/

The breaking news tutorial does also provide a lot of insights into the things that have to be done for most of tag-based scenarios. 突发新闻教程的确为大多数基于标记的场景提供了很多洞察力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM