Xamarin: Join the Xamarin Evolve 2016 Live Stream

If you can’t join us in Orlando this year, you can still join in on the fun from Xamarin Evolve 2016 on our live stream of the main stage, starting with the Keynote on Wednesday, April 27 through the closing session on Thursday, April 28. The schedule is as follows, in EDT: Wednesday, April 27 […]

The post Join the Xamarin Evolve 2016 Live Stream appeared first on Xamarin Blog.


Gone Mobile: Gone Mobile 32: Bitrise with Barnabas Birmacher and Daniel Balla

In this episode we’re joined by Barnabas Birmacher and Daniel Balla to talk about their continunous integration solution for mobile apps. Looking to get started adding CI for your apps? Listen in to find out how!

Hosts: Greg Shackles, Jon Dick

Guest: Barnabas Birmacher, Daniel Balla


Thanks to our Sponsors!


Raygun.io – Exceptional Error Tracking
Raygun.io is the fastest and easiest way to track your application’s errors and get the level of detail you need to fix crashes quickly. Notifications are delivered right to your inbox and presented on a beautiful dashboard.


Marcos Cobeña Morián: Inject Wave Engine into Xamarin.iOS Apps

My good friend and workmate Sergio Escalada and I wrote a few months ago a quick guide, along with a sample (find the link below), on how you can render Wave Engine on a Xamarin.iOS app: not a full-screen game it-self, but adding specific views which are handled from Wave Engine. Today, we’ve updated the… Continue reading Inject Wave Engine into Xamarin.iOS Apps

Xamarin: Getting Started with the Media Plugin for Xamarin

Ever since their invention, cameras have played a huge role in society. With the advent of mobile phones, more people than ever before now have photo and video capabilities at their disposal with the tap of a button. As developers, users expect us to take full advantage of the device capabilities, including the camera, to […]

The post Getting Started with the Media Plugin for Xamarin appeared first on Xamarin Blog.


Gerald Versluis: Push notifications with Xamarin – Windows Phone

To conclude my ‘push notifications’ series I will now tell you how to implement push notifications on Windows Phone.
Be sure to read my previous two posts on the notifications for iOS and setting up Azure and also implementing on Android. If you did read and/or follow them, this will be a piece of cake (hmm cake.). I find Windows Phone by far the easiest platform to implement notifications on. So lets get crackin’!

Prepare Azure

As you might expect, following my last few posts, I will first prepare Azure for sending notifications to our Windows Phone clients. So first step; go to the Azure management portal, to your Notification hub and find the Configure tab once more. Also, we need to go to the Windows developer portal. If you haven’t already done so; create a app entry for your app and go into the details.

In the left menu find ‘Services’ and then ‘Push notifications’ as shown below.

Windows Developer Dashboard
Windows Developer Dashboard

In the next screen watch closely to find a link to the ‘Live Services site’ and click it. This will most likely prompt you to login again.
At the page you reach then you will see the needed information for our Azure back-end. Find the values under ‘Package SID’ and ‘Client secret’ and paste them in the corresponding fields in your Azure configuration. Don’t forget to hit the ‘Save’ button at the bottom!

If all is well the values are accepted and you are done configuring Azure!

Updating our app

Other then iOS and Android on Windows you don’t get a unique token for your device, but you get a URL which acts as a notification channel.
Luckily the rest of the workflow is the same as the other platforms so we can follow along the same path.

Because Windows Phone is just supported out-of-the-box by Visual Studio we can leverage a available NuGet package to implement the push notifications. The only issue they have created now is that there are two flavours of Windows Phone apps; Silverlight and Universal Windows apps.
Because te later is going to be the future and is now the default template when you create a Xamarin.Forms solution I will only handle this one.

Go ahead and add the WindowsAzure.Messaging.Managed NuGet package to the WinPhone project. Then in the App.xaml.cs find the OnLaunched event.
This event is fired, as you would expect, when the app is launched. Right after the opening tag you place this code;

protected async override void OnLaunched(LaunchActivatedEventArgs e)
    var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

    // TODO add connection string here
    var hub = new NotificationHub("XamarinNotifications", "<connection string with listen access>");
    var result = await hub.RegisterNativeAsync(channel.Uri);

    // Displays the registration ID so you know it was successful
    if (result.RegistrationId != null)
        Settings.DeviceToken = result.RegistrationId;

    // The rest of the default code is here

Don’t forget to add the async keyword in the method signature.

When you take a close look at the code you will see that we try to create a channel over which we will receive the notifications. On the other platforms we only have a token which identifies the device, on Windows you also get a channel in the form of a URL with which we can reach the device. We only save the registration ID for now.

Again, I am using the Settings plugin to save this token for later use.

Also, you see that there is still a TODO in there, you have to insert a connection string. In the other project this is inferred from the access code you insert there. Here you need to provide the full connection string. You can find it by going to your Azure management portal, open the Service Bus screen and navigate to your Notification Hub. At the bottom you will find the ‘Connection Information’ button. When you click it you will see the DefaultListenSharedAccessSignature key. You need the value that is after this key.

The last thing you need to do is declare that the app wants to use Toast capabilities. To do this go into your WinPhone project and find the ‘Package.appxmanifest’ file. Double-click it and set the Toast capable field to Yes. If you wondered; yes, toast is Microsofts way of saying push messages. Check out the different kind of messages you can send here.

Enable Toast capabilities
Enable Toast capabilities

Now run the app in the emulator and get back to your Azure management portal to test this out, right now!

In the Debug tab of your notification hub set the platform to Windows, and the notification type to.. Surprise, surprise; toast!

Send test notification Windows
Send test notification Windows

Now the only thing left is to push the Send button at the bottom of the screen and switch back over to your emulator and behold your new, epic, shiny push notification on Windows Phone!

Test notification Windows Phone
Test notification Windows Phone

As usual, find the sample code on my updated GitHub. For the last part, next time stay tuned to create a console tool which sends out push notifications to all of your apps at once!


Michael Ridland: FreshEssentials for Xamarin.Forms – The must-have nuget for Forms

Ah this is one I’ve been wanting to do for a long time and I’m pretty excited about it. We use it everyday, as it’s really useful. FreshEssentials for Xamarin.Forms has ONLY the most common elements you need for Xamarin.Forms. It’s contains the elements you need in almost every project and nothing more, things like BindablePicker, SegementedButtons, […]

The post FreshEssentials for Xamarin.Forms – The must-have nuget for Forms appeared first on Michael Ridland.