Tag: push notification

Azure Notification Hubs templateName的用法

我已经创建了一个带有Cordova的示例应用程序和一个与Azure通知中心通信的Mvc5应用程序。 注册由后端处理,因为标签必须是安全的。 我们使用了从后端注册的三种不同的模板,用于iOS,WP8和Android平台; 后端可以使用sendtemplatenotificationasync发送带有$message有效负载的推送通知。 它工作但我们没有使用templateName 。 从您的app后端文档中读取注册 ,我发现了这个: “您可以使用注册的TemplateName属性来识别模板”。 一旦我使用templateName成功创建了注册,我该怎么办? 我希望找到一个API发送方法,除了标签或标签表达式之外,还能指定一个特定的templateName ; 我还没有找到这样的东西。 templateName的含义和一般用例是什么?

Azure通知中心社交网络方案中的最佳实践

我想知道哪个是Azure通知中心的最佳实践,可以向几个特定用户发送推送通知(例如关于后续活动)。 想象一下,用户可以关注其他用户,并且应该通知这些关注者有关新活动(facebook,twitter原则)。 如何详细发送这些通知,我正在考虑两个选项,但哪一个是最好的? 1)通过代码循环遍历所有需要的用户并为每个用户调用SendTemplateNotificationAsync ? foreach(user in allSubscribedUsers) { tags.Add(“userid:” + userId); await hub.SendTemplateNotificationAsync(notification, tags); } 2)具有用户可以注册的特殊标签 registration.Tags = new HashSet(deviceUpdate.Tags); // the current user follows other users with the ids 1,2 and 3 registration.Tags.Add(“followerUserid:1”); registration.Tags.Add(“followerUserid:2”); registration.Tags.Add(“followerUserid:3”); … // an acivity by user with id 2 is happen // send a push notification to all […]

Android C2DM Invalidregistration

我创建了一个Android应用程序,注册谷歌c2dm服务。 它成功地从c2dm服务获得了registration_id令牌。 我已经签署了Android Cloud to Device Messaging表单,我收到了来自c2dm服务的确认电子邮件。 客户端一切似乎都没问题,它在模拟器环境中得到了registration_id。 所以,没关系。 但是,在服务器端,它正在validation谷歌服务,它正在接收validation码然后它调用c2dm发送url与下面的代码。 public void SendMessage(string registrationId, string data) { ServicePointManager.ServerCertificateValidationCallback += delegate( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; string collapseKey = Guid.NewGuid().ToString(“n”); string url = “https://android.apis.google.com/c2dm/send”; HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = “POST”; request.Headers.Add(“Authorization”, “GoogleLogin auth=DQAAAKYAAACE_0NqG8Sj5lBf4YSPXs_ltQbTzPsAL5u1Q1KGF…”); string px = “registration_id=” + […]

应用未运行时的Toast通知

我在Windows Phone 8上用推送通知服务(只有吐司)编写应用程序,我还有MSSQL Job发送到我的移动应用程序。 发送数据具有以下格式( typeId是int,它告诉应用程序应该对数据做什么): title subtitle typeId;data 当我运行应用程序时推入收入,我可以通过方法服务我的应用程序(这种情况下工作正常) httpChannel.ShellToastNotificationReceived += new EventHandler(httpChannel_ShellToastNotificationReceived); httpChannel.BindToShellToast(); 当app未运行时,我的问题是无法提供toast推送通知。 用XML中的文本推动收入,但当我点击通知时,我会进入我的应用程序的主页面。 如何附加我的代码来决定typeId和XML中的数据做什么

PushSharp不会发送通知

我有一个简单的代码: PushBroker pushBroker = new PushBroker(); string path = HttpContext.Current.Server.MapPath(“~/” + AppSettings.CertificatePath); var appleCert = File.ReadAllBytes(path); pushBroker.RegisterAppleService( new ApplePushChannelSettings(AppSettings.IsProductionPushNotificationServer, appleCert, AppSettings.CertificatePassword)); var notification = new AppleNotification().ForDeviceToken(deviceToken.TrimStart(”)) .WithBadge(unviewedInvitationCount); pushBroker.QueueNotification(notification); 我尝试分别使用Sandbox和Production服务器的开发和生产sertificates。 但什么都没发生。 客户端能够获得推送通知。 怎么了? 提前致谢。 更新: 我订阅了这些活动。 OnNotificationFailed告诉我有关此错误的信息: {APNS NotificationFailureException -> 5 : Invalid token size -> {“aps”:{“badge”:1}}} 如果我将设备令牌包装到中,我会收到另一个错误: {APNS NotificationFailureException -> 8 : Invalid token -> […]

设备未接收C#Windows推送通知,因为通道URL不兼容

经过几个小时的试用,我仍然无法向我的应用发送推送通知。 这是我到目前为止所做的: 通过https://appdev.microsoft.com激活该服务 得到了SID,我们称之为ms-app://s-1-23-4-12345678901-…-12345678901 收到客户端的秘密,我们称之为12Lwq7526OqNY8iN-aLkwds23451345 在我的应用程序中,我在某些时候(简化)实现了以下内容: PushNotificationChannel channel = null; channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); System.Diagnostics.Debug.WriteLine(channel.Uri); 这会打印出这种类型的url: https://db3.notify.windows.com/?token=AgY7AABrfRCVgRV%2ba4DwoDjC2omrnOVwCkdhCrrzlJi6UpIwHzcig6%2fG5xZfnDqU0%2fXoE848ddiqyTaTlSSltp2Dn9Z3qaPsMAyh7kS%2bmlis1%2bwoh%2b%2b4DsAK1yeV1d9G1rUIuFs%3s 我在Package.appxmanifest文件中添加了正确的包名称,发布者显示名称和发布者ID 所以我认为我已经准备好测试推送通知了。 使用我自己的push sharp,fiddler输出实现如下: 要求 : POST https://db3.notify.windows.com/?token=AgY7AABrfRCVgRV%2ba4DwoDjC2omrnOVwCkdhCrrzlJi6UpIwHzcig6%2fG5xZfnDqU0%2fXoE848ddiqyTaTlSSltp2Dn9Z3qaPsMAyh7kS%2bmlis1%2bwoh%2b%2b4DsAK1yeV1d9G1rUIuFs%3s HTTP/1.1 X-WNS-Type: wns/toast Authorization: Bearer EgAC4AA1hAZAQMAklDAAEgAAAUe8/AGsK8a/yk78/WEDQf+KUld/nYIvJ51OIoCPgAfwqbl0oo1sPDLhd9ChiO/iLFVzwlTPE3trp9oTkJxNXi0yUrf+FKjRciq7Utek9B/4dxH9lFNy0R5iwdMS0xNS0yLTIyNDgyMDE1NzEtMjczODcxMjkyMy0yMzM3MbsS59ZuQmXCIAFoOiAAAAAAAgzMOTB7OuFIezrhS60gEAAoANS45LjYuMTBiPoPMh3Nj5MAEOp0RhrcMUx6D50AtDuzWE1AAAAAABeAG1zLWiwcDovL3MtTk2Nzk3LTEzOTYwNDkxODYtMjEyODYwMTQ3MS04MDg1MDg2ODUtMzY3NjQyNTk3OQA= Content-Type: text/xml Host: db3.notify.windows.com Content-Length: 138 This is a test 回答 HTTP/1.1 403 Forbidden Content-Length: 0 X-WNS-ERROR-DESCRIPTION: Channel URL incompatible with caller app X-WNS-MSG-ID: […]

为什么Azure Notification Hub标记不能保存?

我正在尝试向通知中心发送消息,但我的标签未保存。 我使用服务中心资源管理器检查了服务中心,标签是空的: 设备注册: var hs = new HashSet(); hs.Add(tag); hs.Add(sys.ToString()); switch (sys) { case SystemVendorEnum.Android: await Hub.CreateGcmNativeRegistrationAsync(pnsHandle, hs); break; case SystemVendorEnum.Ios: await Hub.CreateAppleNativeRegistrationAsync(pnsHandle, hs); break; } 向集线器发送消息的测试方法调用: // param1: json payload, param2: tag await Hub.SendGcmNativeNotificationAsync(“{ \”data\”: { \”methodId\”:\”1\” }}”, “ae65d2d5-103e-4023-a784-c5c8e2684db0”); 有什么我想念的吗? 我在通知中心没有标签: 是这样的吗?

Windows Phone 8通知和后台任务

我搜索了官方论坛和文档以及所有其他地方,但未能找到具体的答案。 问:在Windows Phone 8中,应用程序是否可以响应推送通知,并在后台执行任务? 据我所知,对于Toast和Tile Notifications ,当应用程序不在前台时,根本没有钩子,因为它能够响应传入的消息。 我认为“原始通知”是正确的选择,因为我不需要更新应用程序磁贴,甚至不显示Toast Notification。 但是,如果我能做到这一点,我无法找到一个例子,或者在文件中。 我找到了几个链接,讨论为Windows商店应用程序执行此操作,但我想知道是否可以为Windows Phone 8完成此操作。 我检查了这个其他post, 带有通知的Windows Phone 8后台任务 其中一个答案表明Whatsapp实际上有一个黑客,在收到推送通知后下载消息。 那么,是我的问题的答案,不是吗?

iphone推送通知urbanairship

我想通过urbanairship api从我的服务器端(c#)发送通知 在c#中有什么例子怎么做? 谢谢

Windows Phone 8推送通知推送通道始终创建新的通道uri

我想检查我的推送通知实现是否正确。 每次我打开我的应用程序(实际上我只在特定页面上注册推送通道,所以每次我从该页面来回移动)都会创建一个新的推送通道URI,我将其存储在我的移动服务数据库中以发送推送通知。 这对我来说似乎不正确,因为每次打开app / page时都会生成一个新的推送通道URI,因此通道URI列表会随着使用我的应用程序的每个设备而增长和增长。 我假设您创建了一个推送通道,存储通道URI并根据需要推送到它。 我会在这里注意到我正在使用原始推送通知。 我知道推送频道会经常过期,但对我来说,每次我退出应用程序/页面时都会发生这种情况,因此当调用onNavigateTo时,我会找到确实存在的推送频道,并始终创建新的频道URI。 它是否正确? 我的代码如下: protected override void OnNavigatedTo(NavigationEventArgs e){registerPushChannel(); } private void registerPushChannel() { // The name of our push channel. string channelName = “RawSampleChannel”; // Try to find the push channel. pushChannel = HttpNotificationChannel.Find(channelName); // If the channel was not found, then create a new connection to the […]