public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            if (AppleMusicManager.FetchDeveloperToken() == null)
            {
                var alertController = UIAlertController.Create("Error",
                                                               "No Developer Token was specified. See the README for more information.",
                                                               UIAlertControllerStyle.Alert);
                alertController.AddAction(UIAlertAction.Create("Dismiss", UIAlertActionStyle.Cancel, null));
                PresentViewController(alertController, true, null);
            }
            else if (AuthorizationManager.UserToken == string.Empty)
            {
                var alertController = UIAlertController.Create("Error",
                                                               "No User Token was specified. Request Authorization using the \"Authorization\" tab.",
                                                               UIAlertControllerStyle.Alert);
                alertController.AddAction(UIAlertAction.Create("Dismiss", UIAlertActionStyle.Cancel, null));
                PresentViewController(alertController, true, null);
            }
            else
            {
                Task.Factory.StartNew(async() => await RefreshData());
            }
        }
示例#2
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            if (appleMusicManager.FetchDeveloperToken() == null)
            {
                searchController.SearchBar.UserInteractionEnabled = false;

                var alertController = UIAlertController.Create("Error", "No developer token was specified. See the README for more information", UIAlertControllerStyle.Alert);
                alertController.AddAction(UIAlertAction.Create("Dismiss", UIAlertActionStyle.Cancel, null));
                PresentViewController(alertController, true, null);
            }
            else
            {
                searchController.SearchBar.UserInteractionEnabled = true;
            }
        }