-
-
Save PureKrome/0f25119aaad50012f925 to your computer and use it in GitHub Desktop.
Xamarin forms is dying
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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