蔚蓝的通知中心和蔚蓝的移动服务之间的区别 [英] Difference between azure notification hub and azure mobile services

查看:182
本文介绍了蔚蓝的通知中心和蔚蓝的移动服务之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是蔚蓝的通知中心和移动服务之间的主要区别

What are the main differences between azure notification hub and mobile services

哪一个是最好的时候使用。

Which is best to use when.

感谢

推荐答案

这些服务有一个完全不同的目的。

Those services have a totally different purpose.

移动服务允许您提供一个后台运行你的应用程序(移动)设备。试想一下,通过一个基于REST API提供的数据库。您可以在CRUD操作通过编写JavaScript code反应(Azure的使用的node.js 此purspose),并限制对数据库的访问。这使您可以快速地开发新的应用程序(或至少证明)。通过JavaScript可以通过通信Windows通知服务(WNS),苹果推送通知服务(APNS)等,或通过访问Azure的通知中心发送推送通知,但是这不是由移动服务提供的原生功能,它只是交谈外部服务。

Mobile Services allow you to provide a backend to (mobile) devices running your apps. Imagine a database that is exposed via a REST based API. You can react on CRUD operations by writing JavaScript code (Azure uses node.js for this purspose) and restrict the access to the database. This allows you to rapidly develop new apps (or at least proofs). Via JavaScript you can send push notifications by communicating the Windows Notification Service (WNS), the Apple Push Notification Service (APNS), etc. or by accessing an Azure Notification Hub, but that's not a native capability provided by the Mobile Services, it's just talking to external services.

的Azure通知中心,您可以管理多个平台(iOS版,Android版,WP8,Windows应用商店)与一个单一组分强制订阅。您不再需要跟踪在自己的表订阅(如您需要,只需基于移动服务的解决方案做),并不需要关心缩放。想象一下,在这个枢纽注册不同的设备,你必须发送一个推送消息到这些设备,而不需要知道,你在说什么样的设备的能力。这只是推动信息的抽象。

Azure Notification Hub allows you to manage push subscriptions on multiple platforms (iOS, Android, WP8, Windows Store) with one single component. You no longer need to track the subscriptions in your own tables (like you would need to do with a solution just based on Mobile Services) and don't need to care about scaling. Imagine different devices registering at this hub and you have the ability to send a push message to those devices without the need to know, what kind of device you're talking to. It's just an abstraction of pushing messages.

要clearify:

伪code具有手动订阅处理与通知中心。与直接通讯手工方式WNS / APNS /...:

Pseudo code with manual subscription handling vs. Notification Hub. Manual way with direct communication with WNS/APNS/...:

// query your data tables to determine the devices to notify
// note, that you need to manage (insert, delete) all of those entries as well
var subscriptions = ...; 

for (var subscription in subscriptions ) 
{
  if (subscription.Type == 0) // WP8
  {
    // communicate with the Windows Phone push service to push
  }
  else if (subscription.Type == 1) // iOS
  {
    // communicate with the Apple Push Notification Service push
  }
  else if // etc.
}

使用通知集线器:

// determine subscriptions to notify by tag, it's just that simple
var tag = 'player:12345'; 

var hub = azure.createNotificationHubService(/* credentials */);

// you don't need to care about WNS/APNS/..., the hub will do that for you
hub.send(tag, yourMessage, /* callback */);

我希望你得到的图片。

I hope you get the picture.

这篇关于蔚蓝的通知中心和蔚蓝的移动服务之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆