First, make sure that the login is working via browser. To do so, go to the following link in your browser:
https://<ServiceName>.azure-mobile.net/login/facebook
Once, you have made sure that it is working, you know that the problem is on the SDK side. To debug that problem, simply try to print the exception in else
block or observe it by setting breakpoints.
This should give you an idea. Comment back and tell us how it goes.
Edit: Looks like you are passing an instance of Application
to your SDK while creating mClient
instance. You're doing the following:
mClient = new MobileServiceClient(
"myServiceUrl",
"myAppKey", getApplicationContext());
Instead, change it to this:
mClient = new MobileServiceClient(
"myServiceUrl",
"myAppKey", this);
This way, you are actually passing an instance of Activity
. Mobile services would otherwise work well with the ApplicationContext
. However, when authentication is added, the SDK needs to create a UI overlay for login. Creating UI without host activity isn't possible. That's why, the SDK requires Activity
instance to create the login screen when authentication is added.