The document discusses real-time business intelligence and mobile notifications. It provides code snippets for registering a notification channel and sending push notifications using Notification Hubs. It also shows code for sending SMS notifications using the Twilio API. The document promotes Microsoft Azure resources for startups, including BizSpark which provides $49,000 of resources over a year, and MSDN subscriber benefits of up to $4,175 per month of Azure resources for up to 3 years. It encourages attendees to sign up for the Microsoft Azure Nursery program for technical and business coaching support on cloud projects.
18. tech.days 2015#mstechdaysSESSION
private async void InitNotificationsAsync()
{
var channel = await
PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
string HUB_NAME = “AZERTYUIO";
string CONNECTION_STRING = "Endpoint=sb://fredgis-
ns.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;S
haredAccessKey=123456789,slz,slkz,=";
// Register with hub
var hub = new NotificationHub(HUB_NAME, CONNECTION_STRING);
var result = await hub.RegisterNativeAsync(channel.Uri);
// Displays the registration ID so you know it was successful
if (result.RegistrationId != null)
{
var dialog = new MessageDialog("Registration successful: " +
result.RegistrationId);
dialog.Commands.Add(new UICommand("OK"));
//await dialog.ShowAsync();
}
}
private static async void SendNotificationAsync()
{
NotificationHubClient hub = NotificationHubClient
.CreateClientFromConnectionString("Endpoint=sb://fredgis-
ns.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;Sha
redAccessKey=123456789012345678Q=", “AZERTYUIO");
var toast = @"<toast><visual><binding template=""ToastText01""><text
id=""1"">Taux d'absences supérieur à 15%</text></binding></visual></toast>";
await hub.SendWindowsNativeNotificationAsync(toast);
}
19. tech.days 2015#mstechdaysSESSION
using Twilio;
private static void SendSms()
{
// Envoie de SMS si absent
// chromium-browser --disable-web-security
string AccountSid = “AZERTYUIOP";
#region AuthToken
string AuthToken = “QSDFGHJKLM";
#endregion
var client = new TwilioRestClient(AccountSid, AuthToken);
// make an associative array of people we know, indexed by phone number
#region private number
var people = new Dictionary<string, string>() {
{"+336xxxxxxxx"}
};
#endregion
// iterate over all our friends
foreach (var person in people)
{
// Send a new outgoing MMS by POSTing to the Messages resource */
client.SendMessage(
#region FromPhoneNumber
"+xxxxxxxxxx", // From number, must be an SMS-enabled Twilio number
#endregion
person.Key, // To number, if using Sandbox see note above
// message content
"Bonjour Mr. " + person.Value + " Ceci est un test pour les
Techdays 2015 :) @Enjoy !"
// media url of the image
);
Console.Write(string.Format("Sent message to {0}", person.Value +
"n"));
}
}
21. tech.days 2015#mstechdaysSESSION tech.days 2015#mstechdays
Activez vos bénéfices Azure jusqu’à
115€ de ressources mensuelles
offertes
115€ /mois
x5 membres
x3 ans
= 4 175€ de ressources offertes
http://azure.com http://aka.ms/azurepourmsdn
150€ de ressources offertes
Sans engagement
Pour tous
Un mois d’essai offert
http://www.microsoft.com/bizspark/
Les Ressources Azure
Pour les startups
Bizspark
= 49 000€ de ressources offertes
pendant un an
Pour les abonnés
MSDN
22. tech.days 2015#mstechdaysSESSION tech.days 2015#mstechdays
L’accompagne
Inscrivez-vous : http://aka.ms/pepiniereazure
Coaching technique et business
Ressources
La Pépinière Microsoft Azure
Visibilité
Une équipe à Microsoft pour vous accompagner dans votre projet cloud et mettre à
votre disposition de l’aide personnalisée.