And on starting app I'm trying to load session from local settings:
var accessTokenValue = MyPlatform.GetLocalSetting(accessTokenSettingsKeyName);
var expiryTicks = MyPlatform.GetLocalSetting(accessTokenExpirySettingsKeyName);
var stateValue = MyPlatform.GetLocalSetting(stateSettingsKeyName);
if (accessTokenValue.Equals(String.Empty) || expiryTicks.Equals(String.Empty))
{
session = null;
AccessToken = String.Empty;
isAuthenticated = false;
return;
}
// read expiry
DateTime expiryValue = DateTime.MinValue;
long expiryTicksValue = 0;
if (long.TryParse(expiryTicks, out expiryTicksValue))
{
expiryValue = new DateTime(expiryTicksValue);
}
// return true only if both values retrieved and token not stale
if (expiryValue > DateTime.UtcNow)
{
session = new FacebookSession()
{
AccessToken = accessTokenValue,
Expires = expiryValue,
State = stateValue
};
AccessToken = accessTokenValue;
isAuthenticated = true;
}
else
{
ResetState();
}
It works fine, but I have noticed that session expiration time is too short (about 3 hours), and I need relogin and show login dialog to user too frequently. Is there any way to increase facebook session expiration time? On iOS and Android I don't have such problem.
Hi, I have problem with session expiration time. After logging in with my windows app LoginAsync(...), I save session to local settings like this:
And on starting app I'm trying to load session from local settings:
It works fine, but I have noticed that session expiration time is too short (about 3 hours), and I need relogin and show login dialog to user too frequently. Is there any way to increase facebook session expiration time? On iOS and Android I don't have such problem.