partial void SubmitButton_TouchUpInside(UIButton sender) { SL.RefreshProfile(); if (!SL.IsNetworkConnected("Instagram")) { UIStoryboard board = UIStoryboard.FromName("Web", null); WebViewController ctrl = (WebViewController)board.InstantiateViewController("WebViewController"); const string ClientID = "cf88ac6682e24ffe83441b6950e3134a"; const string RedirectUrl = "http://socialladderapp.com"; ctrl.Url = "https://api.instagram.com/oauth/authorize/?client_id=" + ClientID + "&redirect_uri=" + RedirectUrl + "&response_type=token"; ctrl.InstagramDelegate = this; this.PresentViewController(ctrl, false, null); } if (SL.IsNetworkConnected("Instagram")) { NSUrl instagramURL = new NSUrl("instagram://"); if (UIApplication.SharedApplication.CanOpenUrl(instagramURL)) { TakePicture(); } else { Platform.ShowAlert("Unable to find the Instagram App on your device. This challenge requires Instagram.", string.Empty); /* * var overlay = Platform.AddOverlay(); * if (overlay != null) * { * var background = Platform.AddOverlayBackground(overlay, UIColor.White); * } */ } } }
partial void DoneButton_TouchUpInside(UIButton sender) { if (SL.IsNetworkConnected("Facebook") || SL.IsNetworkConnected("Twitter") || SL.IsNetworkConnected("Instagram")) { if (SL.HasAreas) { SL.Profile.SetDefaultAreaIfNeeded(); //IntroContainerViewController.LoadMain(); List <string> areaImageUrlList = SL.AreaList.Select(a => a.areaDefaultImageURL).ToList(); Services.FileCachingService.PreloadImagesToDiskFromUrl(areaImageUrlList); var storyboard = UIStoryboard.FromName("Main", null); UIViewController viewController = storyboard.InstantiateViewController("MainNav1") as UIViewController; PresentViewController(viewController, true, null); } else { UIStoryboard board = UIStoryboard.FromName("Areas", null); UIViewController viewController = (UIViewController)board.InstantiateViewController("Areas"); var areasView = (viewController as AreasViewController); Platform.AddVideo(areasView.View); Platform.AddCover(areasView.View); areasView.UnHideViews(); PresentViewController(viewController, false, null); //Platform.ShowAlert(null, "You must join an area to complete setup!"); } } }
public static async Task Logout() { if (SL.IsNetworkConnected("Facebook")) { Mvx.Resolve <IFacebookShareService>().SetAccessToken(string.Empty, string.Empty, true); } SL.Logout(); var _locatioService = Mvx.Resolve <ILocationService>(); var location = _locatioService.CurrentLocation == null ? await _locatioService.GetCurrentLocation() : _locatioService.CurrentLocation; await SL.Manager.GetCityListWithLatitude(location.Lat, location.Long); }
void UpdateView() { var profile = SL.Profile; if (profile != null) { CheckNetworks(); ScoreImage.Image = UIImage.FromBundle("ob-score-bg"); } else { ScoreFill.Image = null; ScoreImage.Image = UIImage.FromBundle("SLCircleLogo"); } if (SL.IsNetworkConnected("Facebook")) { FacebookConnectedImage.Image = UIImage.FromBundle("check-icon_green"); FacebookLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_fb-connected"), UIControlState.Normal); } else { FacebookConnectedImage.Image = null; FacebookLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_fb-unconnected"), UIControlState.Normal); } if (SL.IsNetworkConnected("Twitter")) { TwitterConnectedImage.Image = UIImage.FromBundle("check-icon_green"); TwitterLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_twitter-connected"), UIControlState.Normal); } else { TwitterConnectedImage.Image = null; TwitterLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_twitter-unconnected"), UIControlState.Normal); } if (SL.IsNetworkConnected("Instagram")) { InstagramConnectedImage.Image = UIImage.FromBundle("check-icon_green"); InstagramLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_insta-connected"), UIControlState.Normal); } else { InstagramConnectedImage.Image = null; InstagramLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_insta-unconnected"), UIControlState.Normal); } NextButton.Enabled = SL.HasNetworks; LogoutButton.Hidden = SL.NetworkList == null || SL.NetworkList.Count == 0; }
public override void ViewDidLoad() { base.ViewDidLoad(); //Refresh(Challenge); Reset(); HeaderTextLbl.Text = Challenge.Name; TimeLastLbl.Text = Challenge.NextEventCountDown; NSString viewportScriptString = (NSString)"var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=500'); meta.setAttribute('initial-scale', '1.0'); meta.setAttribute('maximum-scale', '1.0'); meta.setAttribute('minimum-scale', '1.0'); meta.setAttribute('user-scalable', 'no'); document.getElementsByTagName('head')[0].appendChild(meta);"; WebView.Configuration.UserContentController.AddUserScript(new WKUserScript(source: viewportScriptString, injectionTime: WKUserScriptInjectionTime.AtDocumentEnd, isForMainFrameOnly: true)); WebView.ScrollView.ScrollEnabled = false; WebView.ScrollView.Bounces = false; WebView.AllowsBackForwardNavigationGestures = false; Platform.ClearBrowserCache(); if (!SL.IsNetworkConnected("Facebook")) { SubmitButton.Hidden = true; } }