Registering an Android device for push notifications on Xamarin Forms using Azure Notification Hub
<p>I have successfully created a Xamarin Forms project and have got the full lifecycle of registration of GCM push notifications, forwarding of the GCM registration token to Azure Notification hubs (ANH) and reception of notifications sent/published via Azure Notification Hub.</p>

<p>I've achieved this using the Quickstart Mobile App Service within the Azure console and adapting the downloaded skeletal mobile client app to register with GCM and forward the registration with ANH as per this tutorial.</p>

<p><a href="https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-xamarin-forms-get-started-push/" rel="nofollow">Push notifications for Xamarin forms using Azure Notification Hub and Mobile services</a></p>

<p>I now want to remove the dependency from Azure's mobile app service and instead handoff the registration to the Notification hub directly. 
There is a good tutorial on how to do this on an Android native SDK project here :</p>

<p><a href="https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-android-push-notification-google-gcm-get-started/" rel="nofollow">Android mobile client - push notifications using Azure Notification Hub</a></p>

<p>In the supplied Java code the notification hub registration is done using API calls using the API/library made available with this Java import statement</p>

<pre><code>import com.microsoft.windowsazure.messaging.NotificationHub;
</code></pre>

<p>I am trying to take the exact same approach in a Xamarin forms project by adding a NuGet package reference and a using directive but I cannot seem to be able to add the NuGet the package Microsoft.Azure.NotificationHubs to the Droid project. From what I can see this assembly is geared towards backend. </p>

<p>My question is two-fold -:</p>

<ol>
<li><p>Does my approach make sense ? Am I making life hard for myself by trying to eliminate the integration of my mobile app with Azure mobile services. 
I don't need bells and whistles like offline sync right now and I wanted to (for now) integrate my push notification code into existing Xamarin forms project/solution. </p></li>
<li><p>Is there another approach to providing me in Xamarins forms C# wrapped code for Android to register my device for push notifications with Azure without being mediated through the mobile services backend ?</p></li>
</ol>

<p>(Update: I noticed that for Windows 8 Phone and Windows Store Apps there is a nuget component called WindowsAzure.Messaging.Managed which provides access for registration of apps to the Azure notification hub but once again this isn't available for the Droid subproject within the Xamarin forms solution)</p>