Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • We've created a KB article that describes how to integrate push notifications into your XAF mobile application. To help implement our solution, we used both the phonegap-plugin-push and Azure Notification Hub tool. We've opted for the latter because it is an easy-to-use, multi-platform, scaled-out push engine that allows you to make a single cross-platform API call to send targeted and personalized push notifications to any mobile platform (Android/iOS/Windows) from any cloud or on-premises backend. Of course, you can use the native APIs offered by Google/Apple/Microsoft or any other third-party notification services instead.


                                    Your feedback is needed!
                                    This is not an official feature of our Mobile UI (CTP) and our API may change in future release cycles. We are publishing this article prior to the 17.2 release to collect early user feedback and improve overall functionality. We would appreciate your thoughts on this feature once you've had the opportunity to review it. Please report any issues, missing capabilities or suggestions in separate tickets in our Support Center. Thanks for your help in advance!


                                    How it works
                                    The task of implementing push notifications in XAF mobile applications can be divided into smaller parts:
                                    -  integrating one of the suitable Apache Cordova (PhoneGap) plugins and using it for handling/receiving push notifications;
                                    -  configuring connection to one of the services for sending notifications (Azure Notification Hub in this example);
                                    -  sending notifications through the service in an appropriate format.
                                    Exact implementations may vary depending on your business requirements and other preferences
                                    Note that with the described solution, notifications can be seen only on mobile devices, since the simulator cannot attach PhoneGap plugins to a compiled application.



                                    Steps to implement

                                    1. Preparing your environment and accounts.
                                    1.1. Install this hot fix or any v17.1.5+ DevExpress version.

                                    1.2.
                                     Make sure that .NET Framework v4.5 is selected in ALL projects of your test application, because this example uses the Microsoft.Azure.NotificationHubs NuGet package for sending notifications.

                                    1.3.
                                     In order to send and receive Push Notifications, you need a Firebase (Google) developer's account for Android, Apple developer account for iOS, Microsoft developer's account for Windows Phone devices. Register your application on the corresponding Push Notification service.
                                        Android: Follow the "Create a project that supports Firebase Cloud Messaging" section of the Sending push notifications to Android with Azure Notification Hubs topic to learn how to register an application in the Firebase Cloud Messaging (FCM) service. At the end, take note of the SenderID and ServerKey strings, as you will need them to handle push notifications later.
                                        iOS: Follow the "Register your app for push notifications" section of the Sending push notifications to iOS with Azure Notification Hubs topic for registering in Apple Push Notification service (APNs).
                                        Windows Phone 8: Follow the Microsoft Push Notification Service (MPNS)  topic.

                                    2. Receiving broadcast Push Notifications.
                                    2.1.
                                     Add the phonegap-plugin-push plugin to the PhoneGap config file and execute the plugin's initialization script using the MobileApplication.CustomizePhoneGapConfig event and  the MobileApplication.RegisterClientScriptOnApplicationStart method respectively. For this, in the YourSolutionName.Module.Mobile project, add a code file with the following content:
                                    [C#]
                                    using DevExpress.ExpressApp; using DevExpress.ExpressApp.Mobile; using System.Configuration; using System.Xml.Linq; namespace PushNotifications.Module.Mobile.Controllers { public class InitializePhonegapPushPluginController : WindowController { protected string androidSenderID; protected virtual string GetClientStartupScript() { return string.Format(@" if(typeof PushNotification !== 'undefined') {{ var push = PushNotification.init({{ android: {{ senderID: ""{0}"" }}, ios: {{ alert: ""true"", badge: ""true"", sound: ""false"" }}, windows: {{ }} }}); push.on(""notification"", function (data) {{ DevExpress.ui.notify(data.message, ""info"", 10000); }}); }} ", androidSenderID); } private void mobileApplication_CustomizePhoneGapConfig(object sender, CustomizePhoneGapConfigEventArgs e) { XNamespace phoneGapNamespace = "http://phonegap.com/ns/1.0"; e.PhoneGapConfig.Root.Add(new XElement(phoneGapNamespace + "plugin", new XAttribute("name", "phonegap-plugin-push"), new XAttribute("source", "npm"), new XAttribute("spec", "1.8.0"), new XElement("variable", new XAttribute("name", "sender_id"), new XAttribute("value", androidSenderID)))); } protected override void OnActivated() { base.OnActivated(); androidSenderID = ConfigurationManager.AppSettings["AndroidSenderID"]; MobileApplication mobileApplication = Application as MobileApplication; mobileApplication.RegisterClientScriptOnApplicationStart("PushInitializationScript", GetClientStartupScript()); mobileApplication.CustomizePhoneGapConfig += mobileApplication_CustomizePhoneGapConfig; } public InitializePhonegapPushPluginController() { TargetWindowType = WindowType.Main; } } }
                                    [VB.NET]
                                    Imports Microsoft.VisualBasic Imports DevExpress.ExpressApp Imports DevExpress.ExpressApp.Mobile Imports System.Configuration Imports System.Xml.Linq Namespace PushNotifications.Module.Mobile.Controllers Public Class InitializePhonegapPushPluginController Inherits WindowController Protected androidSenderID As String Protected Overridable Function GetClientStartupScript() As String Return String.Format("if(typeof PushNotification !== 'undefined') {{" & ControlChars.CrLf & " var push = PushNotification.init({{" & ControlChars.CrLf & " android: {{" & ControlChars.CrLf & " senderID: ""{0}""" & ControlChars.CrLf & " }}," & ControlChars.CrLf & " ios: {{" & ControlChars.CrLf & " alert: ""true""," & ControlChars.CrLf & " badge: ""true""," & ControlChars.CrLf & " sound: ""false""" & ControlChars.CrLf & " }}," & ControlChars.CrLf & " windows: {{ }}" & ControlChars.CrLf & " }});" & ControlChars.CrLf & " push.on(""notification"", function (data) {{" & ControlChars.CrLf & " DevExpress.ui.notify(data.message, ""info"", 10000);" & ControlChars.CrLf & " }});" & ControlChars.CrLf & " }}", androidSenderID) End Function Private Sub mobileApplication_CustomizePhoneGapConfig(ByVal sender As Object, ByVal e As CustomizePhoneGapConfigEventArgs) Dim phoneGapNamespace As XNamespace = "http://phonegap.com/ns/1.0" e.PhoneGapConfig.Root.Add( New XElement(phoneGapNamespace + "plugin", New XAttribute("name", "phonegap-plugin-push"), New XAttribute("source", "npm"), New XAttribute("spec", "1.8.0"), New XElement("variable", New XAttribute("name", "sender_id"), New XAttribute("value", androidSenderID)))) End Sub Protected Overrides Sub OnActivated() MyBase.OnActivated() androidSenderID = ConfigurationManager.AppSettings("AndroidSenderID") Dim mobileApplication As MobileApplication = TryCast(Application, MobileApplication) mobileApplication.RegisterClientScriptOnApplicationStart("PushInitializationScript", GetClientStartupScript()) AddHandler mobileApplication.CustomizePhoneGapConfig, AddressOf mobileApplication_CustomizePhoneGapConfig End Sub Public Sub New() TargetWindowType = WindowType.Main End Sub End Class End Namespace
                                    Note that this code requires adding assembly references to the System.Configuration and System.Xml.Linq assemblies.

                                    Only for Android
                                    2.2. Modify the YourSolutionName.Mobile/web.config file to store an SenderID received from FCM at step #1.3:
                                    [XML]
                                    <appSettings> ... <add key="AndroidSenderID" value="SenderID from your FCM account"/> </appSettings>
                                    Now your mobile application is ready for receiving broadcast push notifications.

                                    3. Connecting your application to Azure Notification Hub.
                                    3.1. Configure Azure Notification Hub for each notification service according to tutorials from Notification Hubs Documentation. This step is required for both the client mobile application that will receive notifications and for the administrative WinForms, Web or Mobile application that will send notifications.
                                        Android: Follow the "Configure a new notification hub" section of the Sending push notifications to Android with Azure Notification Hubs topic;
                                        iOS: Follow the "Configure your Notification Hub for iOS push notifications" section of the Sending push notifications to iOS with Azure Notification Hubs topic;
                                        Windows Phone 8: Follow the "Create your notification hub" section of the Sending push notifications with Azure Notification Hubs on Windows Phone topic.

                                    3.2. Add the DefaultFullSharedAccessSignature and Azure Namespace parameters of your Notification Hub to the <appSettings> section of the application's *.config file:
                                    [XML]
                                    <appSettings> ... <add key="NotificationHubConnectionString" value="DefaultFullSharedAccessSignature from your Notification Hub Access Policies" /> <add key="NotificationHubNamespace" value ="NAMESPACE from your Notification Hub Properties" </appSettings>
                                    To be able to read these settings from the configuration file, add a reference to the System.Configuration assembly to the YourSolutionName.Mobile and the project that will send notifications.

                                    3.3. From the Visual Studio main menu, select Tools | NuGet Package Manager | Package Manager Console and execute the command below for the YourSolutionName.Mobile project and for the project that will send notifications (in this example, this is YourSolutionName.Module):

                                        Install-Package Microsoft.Azure.NotificationHubs -ProjectName YourProjectName

                                    The installed package provides access to the Azure Notification Hub API and requires the Newtonsoft.Json library with version 9.0.1 or higher. If your mobile application uses an earlier version (currently, it is 8.0.3 by default), update it using the following command:

                                        Install-Package Newtonsoft.Json -Version 9.0.1 -ProjectName YourProjectName

                                    4. Registering devices in Azure Notification Hub.
                                    4.1. To receive notifications from Azure Notification Hub, devices to which your mobile application is installed should be registered on this service. The first step is to pass the device's registrationId from client to server. The following example demonstrates how to extend the previously implemented InitializePhonegapPushPluginController to send this information in the request header:
                                    [C#]
                                    using DevExpress.ExpressApp.Mobile; namespace PushNotifications.Module.Mobile.Controllers { public class InitializePhonegapPushPluginControllerEx : InitializePhonegapPushPluginController { protected override string GetClientStartupScript() { return string.Format(@" $global.registrationId = ''; if(typeof PushNotification !== 'undefined') {{ var push = PushNotification.init({{ android: {{ senderID: ""{0}"" }}, ios: {{ alert: ""true"", badge: ""true"", sound: ""false"" }}, windows: {{ }} }}); push.on(""registration"", function (data) {{ $global.registrationId = data.registrationId; $global.updateModel({{ model: null }}); }}); push.on(""notification"", function (data) {{ DevExpress.ui.notify(data.message, ""info"", 10000); }}); }} ", androidSenderID); } private string GetScriptBeforeSendRequest() { return @"request.headers['registrationId'] = $global.registrationId; request.headers['devicePlatform'] = window.cordova ? window.cordova.platformId : '';"; } protected override void OnActivated() { base.OnActivated(); MobileApplication mobileApplication = Application as MobileApplication; mobileApplication.RegisterClientScriptBeforeSendRequest("Send RegistrationId", GetScriptBeforeSendRequest()); } } }
                                    [VB.NET]
                                    Imports Microsoft.VisualBasic Imports System Imports DevExpress.ExpressApp.Mobile Namespace PushNotifications.Module.Mobile.Controllers Public Class InitializePhonegapPushPluginControllerEx Inherits InitializePhonegapPushPluginController Protected Overrides Function GetClientStartupScript() As String Return String.Format("$global.registrationId = '';" & ControlChars.CrLf & " if(typeof PushNotification !== 'undefined') {{" & ControlChars.CrLf & " var push = PushNotification.init({{" & ControlChars.CrLf & " android: {{" & ControlChars.CrLf & " senderID: ""{0}""" & ControlChars.CrLf & " }}," & ControlChars.CrLf & " ios: {{" & ControlChars.CrLf & " alert: ""true""," & ControlChars.CrLf & " badge: ""true""," & ControlChars.CrLf & " sound: ""false""" & ControlChars.CrLf & " }}," & ControlChars.CrLf & " windows: {{ }}" & ControlChars.CrLf & " }});" & ControlChars.CrLf & " push.on(""registration"", function (data) {{" & ControlChars.CrLf & " $global.registrationId = data.registrationId;" & ControlChars.CrLf & " $global.updateModel({{ model: null }});" & ControlChars.CrLf & " }});" & ControlChars.CrLf & " push.on(""notification"", function (data) {{" & ControlChars.CrLf & " DevExpress.ui.notify(data.message, ""info"", 10000);" & ControlChars.CrLf & " }});" & ControlChars.CrLf & " }}", androidSenderID) End Function Private Function GetScriptBeforeSendRequest() As String Return "request.headers['registrationId'] = $global.registrationId;" & ControlChars.CrLf & " request.headers['devicePlatform'] = window.cordova ? window.cordova.platformId : '';" End Function Protected Overrides Sub OnActivated() MyBase.OnActivated() Dim mobileApplication As MobileApplication = TryCast(Application, MobileApplication) mobileApplication.RegisterClientScriptBeforeSendRequest("Send RegistrationId", GetScriptBeforeSendRequest()) End Sub End Class End Namespace

                                    4.2. In the YourSolutionName.Mobile/MobileApplication.xx file, override the MobileApplication's OnLoggedOn and OnLogonFailed methods to update the registration information as follows:
                                    [C#]
                                    using System; using System.Configuration; using DevExpress.ExpressApp; using DevExpress.Persistent.Base; using DevExpress.ExpressApp.Mobile; using System.Collections.Generic; using DevExpress.ExpressApp.Xpo; using DevExpress.ExpressApp.Security; using DevExpress.ExpressApp.Security.ClientServer; using Microsoft.Azure.NotificationHubs; using System.Linq; namespace PushNotifications.Mobile { public partial class PushNotificationsMobileApplication : MobileApplication { //... private NotificationHubClient hubClient; //... public PushNotificationsMobileApplication() { //... string connectionString = ConfigurationManager.AppSettings["NotificationHubConnectionString"]; string notificationHubNamespace = ConfigurationManager.AppSettings["NotificationHubNamespace"]; if(!string.IsNullOrEmpty(connectionString) && !string.IsNullOrEmpty(notificationHubNamespace)) { hubClient = NotificationHubClient.CreateClientFromConnectionString(connectionString, notificationHubNamespace); } } //... protected override void OnLoggedOn(LogonEventArgs args) { base.OnLoggedOn(args); UpdateCurrentUserRegistration(); } protected override bool OnLogonFailed(object logonParameters, Exception e) { UpdateCurrentUserRegistration(); return base.OnLogonFailed(logonParameters, e); } private async void UpdateCurrentUserRegistration() { string pushChannel = System.Web.HttpContext.Current.Request.Headers["registrationId"]; string platform = System.Web.HttpContext.Current.Request.Headers["devicePlatform"]; if (!string.IsNullOrEmpty(pushChannel)) { var registrations = hubClient.GetRegistrationsByChannelAsync(pushChannel, Int32.MaxValue).Result; RegistrationDescription registration = null; bool needUpdateRegistration = false; if (registrations == null || registrations.Count() == 0) { needUpdateRegistration = true; switch (platform.ToLower()) { case "android": registration = new GcmRegistrationDescription(pushChannel); break; case "ios": registration = new AppleRegistrationDescription(pushChannel); break; case "windowsphone": registration = new MpnsRegistrationDescription(pushChannel); break; } registration.RegistrationId = hubClient.CreateRegistrationIdAsync().Result; } else { registration = registrations.First(); } if (registration.Tags == null) { registration.Tags = new HashSet<string>(); } if (string.IsNullOrEmpty(SecuritySystem.CurrentUserName)) { needUpdateRegistration = true; if (registration.Tags != null) { registration.Tags.Clear(); } } else if (!registration.Tags.Contains(SecuritySystem.CurrentUserName)) { needUpdateRegistration = true; registration.Tags.Add(SecuritySystem.CurrentUserName); } if (needUpdateRegistration) { await hubClient.CreateOrUpdateRegistrationAsync(registration); } } } } }
                                    [VB.NET]
                                    Imports Microsoft.VisualBasic Imports System Imports System.Configuration Imports DevExpress.ExpressApp Imports DevExpress.Persistent.Base Imports System.ComponentModel Imports DevExpress.ExpressApp.Mobile Imports System.Collections.Generic Imports DevExpress.ExpressApp.Xpo Imports DevExpress.ExpressApp.Security Imports DevExpress.ExpressApp.Security.ClientServer Imports Microsoft.Azure.NotificationHubs Imports System.Linq Namespace PushNotifications.Mobile Partial Public Class PushNotificationsMobileApplication Inherits MobileApplication '... Private hubClient As NotificationHubClient '... Public Sub New() '... Dim notificationHubConnectionString As String = ConfigurationManager.AppSettings("NotificationHubConnectionString") Dim notificationHubNamespace As String = ConfigurationManager.AppSettings("NotificationHubNamespace") If (Not String.IsNullOrEmpty(notificationHubConnectionString)) AndAlso (Not String.IsNullOrEmpty(notificationHubNamespace)) Then hubClient = NotificationHubClient.CreateClientFromConnectionString(notificationHubConnectionString, notificationHubNamespace) End If End Sub '... Protected Overrides Sub OnLoggedOn(ByVal args As LogonEventArgs) MyBase.OnLoggedOn(args) UpdateCurrentUserRegistration() End Sub Protected Overrides Function OnLogonFailed(ByVal logonParameters As Object, ByVal e As Exception) As Boolean UpdateCurrentUserRegistration() Return MyBase.OnLogonFailed(logonParameters, e) End Function Private async Sub UpdateCurrentUserRegistration() Dim pushChannel As String = System.Web.HttpContext.Current.Request.Headers("registrationId") Dim platform As String = System.Web.HttpContext.Current.Request.Headers("devicePlatform") If (Not String.IsNullOrEmpty(pushChannel)) Then Dim registrations = hubClient.GetRegistrationsByChannelAsync(pushChannel, Int32.MaxValue).Result Dim registration As RegistrationDescription = Nothing Dim needUpdateRegistration As Boolean = False If registrations Is Nothing OrElse registrations.Count() = 0 Then needUpdateRegistration = True Select Case platform.ToLower() Case "android" registration = New GcmRegistrationDescription(pushChannel) Case "ios" registration = New AppleRegistrationDescription(pushChannel) Case "windowsphone" registration = New MpnsRegistrationDescription(pushChannel) End Select registration.RegistrationId = hubClient.CreateRegistrationIdAsync().Result Else registration = registrations.First() End If If registration.Tags Is Nothing Then registration.Tags = New HashSet(Of String)() End If If String.IsNullOrEmpty(SecuritySystem.CurrentUserName) Then needUpdateRegistration = True If registration.Tags IsNot Nothing Then registration.Tags.Clear() End If ElseIf (Not registration.Tags.Contains(SecuritySystem.CurrentUserName)) Then needUpdateRegistration = True registration.Tags.Add(SecuritySystem.CurrentUserName) End If If needUpdateRegistration Then await hubClient.CreateOrUpdateRegistrationAsync(registration) End If End If End Sub End Class End Namespace


                                    In this code, the device is associated with the logged in user through the tag mechanism. If a notification's tag is empty, this notification will be sent to all registered devices.

                                    5. Sending push notifications.
                                    To test push notifications, add the following controller to an XAF application configured in step #3:
                                    [C#]
                                    using DevExpress.Data.Filtering; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Actions; using DevExpress.Persistent.Base; using DevExpress.Persistent.BaseImpl.PermissionPolicy; using Microsoft.Azure.NotificationHubs; using System; using System.Configuration; namespace PushNotifications.Module.Controllers { public class SendPushNotificationController : ViewController { private SimpleAction notifyAllAction; private SimpleAction notifyAdminUser; private NotificationHubClient hubClient; private void NotifyUserAction_Execute(object sender, SimpleActionExecuteEventArgs e) { using(IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(PermissionPolicyUser))) { PermissionPolicyUser user = objectSpace.FindObject<PermissionPolicyUser>(new BinaryOperator("UserName", "User")); if(user != null) { SendPushNotification(text: "Notification for User.", tag: user.UserName); } } } private void NotifyAllAction_Execute(object sender, SimpleActionExecuteEventArgs e) { SendPushNotification(text: "Notification for all users.", tag: null); } private async void SendPushNotification(string text, string tag) { if (hubClient != null) { await hubClient.SendGcmNativeNotificationAsync(string.Format(@"{{""data"":{{""message"": ""{0}"" }} }}", text), tag); await hubClient.SendAppleNativeNotificationAsync(string.Format(@"{{""aps"":{{""alert"":""{0}""}} }}", text), tag); //ArgumentException occurs if a Windows Phone application has not been registered in the Notification Hub or //the "Enable unauthenticated push" option has not been set in the Notification Services section in the Azure Portal try { await hubClient.SendMpnsNativeNotificationAsync(string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?> <wp:Notification xmlns:wp=""WPNotification""> <wp:Toast> <wp:Text1>{0}</wp:Text1> </wp:Toast> </wp:Notification>", text), tag); } catch(Exception ex) { Tracing.Tracer.LogError(ex); } } } public SendPushNotificationController() { notifyAllAction = new SimpleAction(this, "NotifyAll", DevExpress.Persistent.Base.PredefinedCategory.Edit); notifyAllAction.Caption = "Notify All"; notifyAllAction.Execute += NotifyAllAction_Execute; notifyAdminUser = new SimpleAction(this, "NotifyUser", DevExpress.Persistent.Base.PredefinedCategory.Edit); notifyAdminUser.Caption = "Notify User"; notifyAdminUser.Execute += NotifyUserAction_Execute; string connectionString = ConfigurationManager.AppSettings["NotificationHubConnectionString"]; string notificationHubNamespace = ConfigurationManager.AppSettings["NotificationHubNamespace"]; if (!string.IsNullOrEmpty(connectionString) && !string.IsNullOrEmpty(notificationHubNamespace)) { hubClient = NotificationHubClient.CreateClientFromConnectionString(connectionString, notificationHubNamespace); } } } }
                                    [VB.NET]
                                    Imports DevExpress.Data.Filtering Imports DevExpress.ExpressApp Imports DevExpress.ExpressApp.Actions Imports DevExpress.Persistent.Base Imports DevExpress.Persistent.BaseImpl.PermissionPolicy Imports Microsoft.Azure.NotificationHubs Imports System.Configuration Namespace PushNotifications.Module.Controllers Public Class SendPushNotificationController Inherits ViewController Private notifyAllAction As SimpleAction Private notifyAdminUser As SimpleAction Private hubClient As NotificationHubClient Private Sub SendPushNotification(text As String, tag As String) If hubClient IsNot Nothing Then Await hubClient.SendGcmNativeNotificationAsync(String.Format("{{""data"":{{""message"": ""{0}"" }} }}", text), tag) Await hubClient.SendAppleNativeNotificationAsync(String.Format("{{""aps"":{{""alert"":""{0}""}} }}", text), tag) 'ArgumentException occurs if a Windows Phone application has not been registered in the Notification Hub or 'the "Enable unauthenticated push" option has not been set in the Notification Services section in the Azure Portal Try Await hubClient.SendMpnsNativeNotificationAsync(String.Format("<?xml version=""1.0"" encoding=""utf-8""?>" + "<wp:Notification xmlns:wp=""WPNotification"">" + "<wp:Toast>" + "<wp:Text1>{0}</wp:Text1>" + "</wp:Toast>" + "</wp:Notification>", text), tag) Catch ex As Exception Tracing.Tracer.LogError(ex) End Try End If End Sub Public Sub New() notifyAllAction = New SimpleAction(Me, "NotifyAll", DevExpress.Persistent.Base.PredefinedCategory.Edit) notifyAllAction.Caption = "Notify All" AddHandler notifyAllAction.Execute, AddressOf NotifyAllAction_Execute notifyAdminUser = New SimpleAction(Me, "NotifyUser", DevExpress.Persistent.Base.PredefinedCategory.Edit) notifyAdminUser.Caption = "Notify User" AddHandler notifyAdminUser.Execute, AddressOf NotifyUserAction_Execute Dim connectionString As String = ConfigurationManager.AppSettings("NotificationHubConnectionString") Dim notificationHubNamespace As String = ConfigurationManager.AppSettings("NotificationHubNamespace") If (Not String.IsNullOrEmpty(connectionString)) AndAlso (Not String.IsNullOrEmpty(notificationHubNamespace)) Then hubClient = NotificationHubClient.CreateClientFromConnectionString(connectionString, notificationHubNamespace) End If End Sub Private Sub NotifyUserAction_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Using objectSpace As IObjectSpace = Application.CreateObjectSpace(GetType(PermissionPolicyUser)) Dim user As PermissionPolicyUser = objectSpace.FindObject(Of PermissionPolicyUser)(New BinaryOperator("UserName", "User")) If user IsNot Nothing Then SendPushNotification(text := "Notification for User.", tag := user.UserName) End If End Using End Sub Private Sub NotifyAllAction_Execute(ByVal sender As Object, ByVal e As SimpleActionExecuteEventArgs) SendPushNotification(text:= "Notification for all users.", tag:= Nothing) End Sub End Class End Namespace

                                    6. Building and deploying.
                                    Follow the Install the Application to a Smartphone help topic to deploy your XAF Mobile application service to a public server. Then, create and download the application configuration ZIP file and build the native mobile application using PhoneGap. Install the resulting package to your mobile device.
                                    After deploying your mobile application via IIS you can receive notifications that have been sent via Win/Web/Mobile application:




                                    You will find a complete C# example in the attachment (PushNotifications.zip).


                                    See Also:
                                    eXpressApp Framework > Getting Started > XAF Mobile (CTP) Tutorial 
                                    XAF Mobile - Overview Video
                                    FAQ: New XAF HTML5/JavaScript mobile UI (CTP)
                                    Get Notified with DevExtreme Mobile (a webinar describing how to use the phonegap-plugin-push in a  regular non-XAF DevExtreme application)
                                    How to use a Barcode Scanner in XAF Mobile
                                    How to use a Background Geolocation in XAF Mobile
                                • José Enrique 08.07.2017
                                  Is it able to embed a link to internal app views?
                                  The sample works with azure notification hub but, could it be integrated with PushSharp?
                                • @Jose: Thanks for your interest. I've created a separate ticket on your behalf (T543125: Mobile push notifications with PushSharp). It has been placed in our processing queue and will be answered shortly.

                                0 Solutions

                                Creation Date Rating Importance Sort by

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners