本文整理汇总了C#中System.App.NavigateToProfile方法的典型用法代码示例。如果您正苦于以下问题:C# App.NavigateToProfile方法的具体用法?C# App.NavigateToProfile怎么用?C# App.NavigateToProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.App
的用法示例。
在下文中一共展示了App.NavigateToProfile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FacebookPageRenderer
public FacebookPageRenderer()
{
var activity = this.Context as Activity;
var auth = new OAuth2Authenticator(
clientId: "476292725915235",
scope: "",
authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),
redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html"));
auth.Completed += async (sender, eventArgs) => {
if (eventArgs.IsAuthenticated)
{
var accessToken = eventArgs.Account.Properties["access_token"].ToString();
var expiresIn = Convert.ToDouble(eventArgs.Account.Properties["expires_in"]);
var expiryDate = DateTime.Now + TimeSpan.FromSeconds(expiresIn);
var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me"), null, eventArgs.Account);
var response = await request.GetResponseAsync();
var obj = JObject.Parse(response.GetResponseText());
var id = obj["id"].ToString().Replace("\"", "");
var name = obj["name"].ToString().Replace("\"", "");
App app = new App();
await app.NavigateToProfile(string.Format("Olá {0}", name));
}
else
{
await App.Current.MainPage.DisplayAlert("Alerta", "lOGIN CANCELADO", " OK");
}
};
activity.StartActivity(auth.GetUI(activity));
}