jeudi 28 janvier 2016

Azure mobile app offline sync causing a MobileServicePushFailedException -> CancelledByAuthenticationError

As part of a UWP app we're developing at work, we have an Azure mobile app (C#, .NET backend) connected to the client which is supposed to sync up with offline SQLite storage and place CRUD operation requests into a queue so they can be processed by a worker role.

Trouble is, for some reason when we attempt to call PushAsync/PullAsync on the sync context and messages table respectively, it throws a MobileServicePushFailedException. When monitoring this in locals, the PushResult status is "CancelledByAuthenticationError" but this happens even after successfully logging in via one of the providers, and we haven't yet set the table to require authentication anyway so this shouldn't be causing any problems.

Interestingly enough, when this was a mobile SERVICE as opposed to a mobile app running in a Windows 8.1 project instead of a UWP, it worked fine, because the MobileServiceClient constructor in that version of the Nuget package takes the application key as one of its arguments. Unfortunately, we're developing a UWP, so it needed to be migrated and thus we can't use the same constructor any more.

Has anyone come across this before, or does anyone have any idea where we might be able to find further information on this? We haven't been able to find any other concrete references online besides another SO post that was asking about a similar but different issue, and a few other posts that either have no answers or are working with different languages/backends.

Aucun commentaire:

Enregistrer un commentaire