St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices


Published on

Push notifications are critical to craft engaging app experience and increase usage and user interest. Windows Azure Notification Hubs support multi-platform push with Windows, iOS, and Android, publish/subscribe routing to particular groups of users or devices, and low latency broadcast to millions of devices. Join us to learn how to use Notification Hubs to target millions of devices at once and single targeted users with just a few lines of code.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Now, let us take a look at developers. Our whole strategy for developers is based on making them successful in the app economy. We need to invest today in our developer’s success to ensure a steady flow of apps, that will sell tomorrow’s devices. We recently announced a new initiative that helps developers succeed. It is called DVLUP.DVLUP brings together proven models of gamification and a rewards system (similar to frequent flyer programs in the airline industry) to encourage developers to engage with a development platform.In DVLUP, developers earn points while developing apps for targeted and curated app challenges.  This approach enables us to gain new developers, incentivize them to create apps that are relevant to the consumer and at the same time offer ways for developers to become successful, by supporting them in promoting and marketing their apps to a global audiance. We have launched DVLUP in 21 countries, And we are offering over $5 million worth of rewards to our developers.- Go to to find out more
  • St. Louis Day of .NET 2013 - Delivering Push Notifications to Millions of Mobile Devices

    1. 1.
    2. 2. Platinum Sponsors Gold Sponsors Silver Sponsors
    3. 3. Contact Me adam grocholski @codel8r
    4. 4. Windows News app uses Notification Hubs
    5. 5. Client app Platform Notification Service App back-end
    6. 6. iOS app Windows Store app App back-end APNs Notification Hub WNS
    7. 7. var hub = new NotificationHub(“<hub name>", "<connection string>"); var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); await hub.RegisterNativeAsync(channel.Uri);
    8. 8. var hubClient = NotificationHubClient.CreateClientFromConnectionString("<connection string>", “<hub name>"); var toast = @“<notification payload>"; hubClient.SendWindowsNativeNotificationAsync(toast);
    9. 9. (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *) deviceToken { … SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString: @"<connection string>" notificationHubPath:@"mynh"]; [hub registerNativeWithDeviceToken:deviceToken tags:nil completion:^(NSError* error) { if (error != nil) { NSLog(@"Error registering for notifications: %@", error); } }]; }
    10. 10. In your main activity: Notification Hub hub = new NotificationHub("<hub name>", "<connection string>", context); GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context); String regid = gcm.register(SENDER_ID); NativeRegistration r = hub.register(regid);
    11. 11. var hubClient = NotificationHubClient.CreateClientFromConnectionString("<connection string>", “<hub name>"); var toastForIos = @“<notification payload>"; hubClient.SendAppleNativeNotificationAsync(toastForIos); var toastForAndroid = @“<notification payload>"; hubClient.SendGcmNativeNotificationAsync(toastForAndroid);
    12. 12. 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 } } );
    13. 13. No need to store and maintain ChannelURIs. Device registrations expire.
    14. 14. App back-end Tag:”Beatles” Notification Hub Tag:”Wailers” Tag:”Beatles”
    15. 15. Notification Hub App back-end
    16. 16. // 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}); } }
    17. 17. <toast> <visual> <binding template="ToastText01"> <text id="1">$(message)</text> </binding> </visual> </toast> Hello! { message: “Hello!” } App back-end Service Bus Notification Hub Hello! { aps: { alert: “$(message)” } }
    18. 18. <toast> <visual> <binding template="ToastText01"> <text id="1">$(tempF)</text> </binding> </visual> </toast> 73 {tempC: “23”, tempF: “73”} App back-end Service Bus Notification Hub 23 { aps: { alert: “$(tempC)” } }
    19. 19. What Next? Try it out. For Free. Build what you want. Scale as you need. Full access with no strings attached. Hello startups! You have an ideas so brilliant it burns. BizSpark can help make it real. or CONTACT ME!
    20. 20. DVLUP – NOKIA’S REWARDS PROGRAM COMPLETE APP CHALLENGES – EARN POINTS – GET COOL STUFF Engage via Gamification & Rewards Targeted & Curated App Challenges Redeem earned points for Phones, Accessori es, Dev Tools and App Promotion Over $5 million worth of Rewards and Campaigns
    21. 21. Contact Me adam grocholski @codel8r