Azure mobile service oauth implementation does not work on android phone & emulator


#1

I am building a hybrid mobile application using Ionic, Angular, Azure mobile services (Java script Backend –Node.js). This application does various things
like inserting, updating,deleting and displaying data from azure mobile service, google maps and location tracking etc. including sign up using google or facebook account.

Everything works fine when run on browser ,emulator and android phone(Samsung galaxy S4) except the authentication process which stuck while redirecting back to my application running on android device and emulator after the successful authentication( as google confirms when I log in to my device) .It happens on emulator and android phone but works fine on browsers(IE and chrome).

I have tried debugging the device but no luck. It shows successful redirect call to azure mobile service with a token but never redirects to my application(on device and emulator) from azure mobile service.

Redirect URLS set in google and facebook dev consoles are as follow
https://XXXXservice.azure-mobile.net/login/google
https://XXXXXXservice.azure-mobile.net/

Plugin Added
cordova-plugin-device
cordova-plugin-inappbrowser

Here is controller code

var client= new WindowsAzure.MobileServiceClient(‘https://XXXXXXservice.azure-mobile.net/’,‘key’);

$scope.signInGoogle = function () {
client.login(“google”).then(function (profile) {
window.localStorage.setItem(“token”,profile.mobileServiceAuthenticationToken);
window.localStorage.setItem(“userid”,profile.userId);
window.localStorage.setItem(“accountType”,“google”);
ProfileLookup() // calls azure
mobile service to get already SIGNED UP user profile information})}

$scope.signInFacebook = function () {
client.login(“facebook”).then(function (profile) {
window.localStorage.setItem(“token”,profile.mobileServiceAuthenticationToken);
window.localStorage.setItem(“userid”, profile.userId);
window.localStorage.setItem(“accountType”,“facebook”);
ProfileLookup(); // calls azure mobile service to get already SIGNED UP user profile information
})}

is there anything else I should specify or configure to get this working for mobile applications?