I would like to configure Push notifications for a Xamarin Forms Windows 8.1 Silverlight project. Originally I was using MPNS but am attempting to switch over to WNS. Switching over I am now running into an error when I am attempting to call the method to register my device to Azures notification hub.

The line im calling that throws the error is:

await App.MobileService.GetPush().RegisterAsync(channel.Uri);

and the error thrown is:

The type name 'MobileService' does not exist in the type 'App'

I have the NuGet package Microsoft.WindowsAzure.MobileServices installed but apparently this doesn't contain the definition.

I am following the following guide to setup my push notifications (Under the section "Add push notifications to your app"):

https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-windows-store-dotnet-get-started-push/

I've also looked up how to do this on other sites and I don't see much difference to the instructions, nor do I see what I might be missing...

Anyhow if anyone has any ideas what package or reference I might be missing (or what else might be wrong with that call) I'd appreciate the help! Thanks!

1

There are 1 answers

0
Orlando On BEST ANSWER

In case anyone runs into this issue I solved this problem adding:

public static MobileServiceClient MobileService = new MobileServiceClient(Utilities.Constants.ApplicationURL, Utilities.Constants.ApplicationKey);

and updating my call like so:

await MobileService.GetPush().RegisterNativeAsync(channelUri);

Hope this helps!