Skip to content

Instantly share code, notes, and snippets.

@PureKrome
Created October 6, 2015 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PureKrome/0f25119aaad50012f925 to your computer and use it in GitHub Desktop.
Save PureKrome/0f25119aaad50012f925 to your computer and use it in GitHub Desktop.
Xamarin forms is dying
AppDelegate.cs
namespace Foo.iOS
{
[Register ("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init ();
// Code for starting up the Xamarin Test Cloud Agent
#if ENABLE_TEST_CLOUD
Xamarin.Calabash.Start();
#endif
LoadApplication (new App ());
return base.FinishedLaunching (app, options);
}
}
}
App.cs
namespace Foo.Core
{
public class App : Application
{
protected override async void OnStart()
{
Page page;
await LoadAppDataAsync();
if (AppData.Account != null)
{
// Lets show the dashboard.
page = new DashboardPage();
}
else
{
// We need to login to figure out who we are.
page = new AuthenticationPage();
}
MainPage = page;
}
private async Task LoadAppDataAsync()
{
var localStorageService = new LocalStorageService();
AppData.Account = await localStorageService.LoadAccountAsync();
AppData.ConfigurationSettings = new ConfigurationSettings
{
FacebookSettings = new OAuthSettings
{
PublicToken = "snipped",
Scopes = "email",
AuthorizeUrl = "https://m.facebook.com/dialog/oauth/",
RedirectUrl = "http://www.facebook.com/connect/login_success.html"
}
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment