1
即時通訊使Facebook登錄到我的窗口電話8.1。點擊登錄按鈕時,它打破了應用程序的年齡我這個Facebook登錄NotImplementedException錯誤
型「System.NotImplementedException」的異常出現在 mypriject.exe但在用戶代碼中沒有處理
附加信息:未實現
如果有這種異常的處理程序,程序可能會安全地繼續執行 。
然後把我帶到這個 app.gics頁面並突出顯示該行
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException += (sender, e) =>
{
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
};
**這是我的代碼請幫助我**
public sealed partial class BlankPage1 : Page
{
FacebookClient fb = new FacebookClient();
string AccessToken = null;
public BlankPage1()
{
this.InitializeComponent();
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached.
/// This parameter is typically used to configure the page.</param>
private async void Button_Click(object sender, RoutedEventArgs e)
{
string redirect_url="https://www.facebook.com/connect/login_seccess.html";
var loginURL = fb.GetLoginUrl(new{
client_id ="**myapp id here**",
redirect_uri = redirect_url,
response_type ="token",
scope ="email,publish_stream,user_groups"
});
var res= await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None,loginURL,new Uri(redirect_url) );
if(res.ResponseStatus==WebAuthenticationStatus.Success)
{
var callback = new Uri(res.ResponseData.ToString());
var token = fb.ParseOAuthCallbackUrl(callback);
AccessToken = token.AccessToken;
await new MessageDialog("AccessToken").ShowAsync();
}
}
}
謝謝你@AS汗 – 2014-12-11 08:04:52