Wednesday, November 16, 2011

Check whether the Network is available in Windows Phone 7

If you want to check whether network is available, just use this
using System.Net.NetworkInformation;

bool netAvail = NetworkInterface.GetIsNetworkAvailable();
Note: It always return "true" in emulator, but return actual value in device.

Tuesday, November 8, 2011

Facebook Auth Logout for Windows Phone 7

In some situations, you may want to allow user to change their account, it is easy to do that.
The Doc of  facebook refers to

Logout
You can log a user out of their Facebook session by directing them to the following URL:
https://www.facebook.com/logout.php?next=YOUR_URL&access_token=ACCESS_TOKEN
Note: YOUR_URL must be a URL in your site domain, as defined in the Developer App.

According to this, you can make your request Url be following form:
https://www.facebook.com/logout.php?next=YOUR_URL&access_token=ACCESS_TOKEN

But the major question is what YOUR_URL should be?