Download presentation
Presentation is loading. Please wait.
Published byMae Harvey Modified over 9 years ago
2
Datacenter LOB web service LOB app Partner Mobile Device
3
Datacenter LOB web service LOB app Partner Mobile Device SB SB ACS
4
Datacenter LOB web service LOB app Partner Mobile Device SB SB ACS
5
Datacenter Partner Mobile Device LOB web service LOB app SB SB ACS
6
Partner Mobile Device Datacenter LOB web service LOB app SB SB ACS
7
Service Bus Sender Receiver sb://stringreversalinc.servicebus.windows.net/proce sstring Backend Naming Routing Fabric Frontend Nodes Ctrl 1 1 2 2 3 3 4 4 Socket-Socket Forwarder outbound socket connect outbound socket rendezvous Ctrl TCP/SSL 818 Oneway Rendezvous Ctrl Msg Oneway Rendezvous Ctrl Msg NLB
11
Windows News app uses Notification Hubs
13
Platform Notification Service App back-end Client app
15
APNsWNS Notification Hub App back-end iOS app Windows Store app
18
var hub = new NotificationHub(“ ", " "); var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); await hub.RegisterNativeAsync(channel.Uri);
19
var hubClient = NotificationHubClient.CreateClientFromConnectionString(" ", “ "); var toast = @“ "; hubClient.SendWindowsNativeNotificationAsync(toast);
20
(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *) deviceToken { … SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString: @" " notificationHubPath:@"mynh"]; [hub registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError* error) { if (error != nil) { NSLog(@"Error registering for notifications: %@", error); } }]; }
21
In your main activity: Notification Hub hub = new NotificationHub(" ", " ", context); GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context); String regid = gcm.register(SENDER_ID); NativeRegistration r = hub.register(regid);
22
var hubClient = NotificationHubClient.CreateClientFromConnectionString(" ", “ "); var toastForIos = @“ "; hubClient.SendAppleNativeNotificationAsync(toastForIos); var toastForAndroid = @“ "; hubClient.SendGcmNativeNotificationAsync(toastForAndroid);
23
var azure = require('azure'); var notificationHubService = azure.createNotificationHubService('hubname', 'connectionString'); notificationHubService.wns.sendToastText01(null, { text1: 'Hello from Node and Mobile Services!' }, function (error) { if (!error) { // message sent successfully } } );
26
Notification Hub App back-end Tag:”Beatles”Tag:”Wailers” Tag:”Beatles”
29
Notification Hub App back-end
30
// POST api/register public async void Post(bool instId, bool channelUri, bool userId) { // We assume a windows store app (if coding a multiplatform app, a ‘platform‘ parameter should be passed) … if (!authorizedToRegisterTag(userId)) { throw new Exception("User not authorized to register"); } var regsForInstId = await hubClient.GetRegistrationsByTag(instId, 100); bool updated = false; bool firstRegistration = true; foreach (var registrationDescription in regsForInstId) { if (firstRegistration) { var winReg = registrationDescription as WindowsRegistrationDescription; winReg.ChannelUri = new Uri(channelUri); winReg.Tags.Clear(); winReg.Tags.UnionWith(new string[] {instId, userId}); hubClient.UpdateRegistration(winReg); updated = true; firstRegistration = false; } else { // if templates are not used, delete all extra registrations with this installation id. hubClient.DeleteRegistration(registrationDescription); } // if not updated, a new registration has to be created for the device if (!updated) { hubClient.CreateWindowsNativeRegistration(channelUri, new string[] {instId, userId}); }
33
Service Bus Notification Hub App back-end $(message) { aps: { alert: “$(message)” } { message: “Hello!” } Hello!
34
Service Bus Notification Hub App back-end $(tempF) { aps: { alert: “$(tempC)” } { tempC: “23”, tempF: “73” } 73 23
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.