Xamarin Forms OAuth2错误Invoke的目标为空

时间:2018-07-24 14:00:32

标签: xamarin xamarin.forms xamarin.auth xamarin-live-player

解决this问题后,我遇到了另一个问题。

我更改了NuGet软件包,并按照here所述实施了所有操作。

我还在AppDelegate.cs中添加了初始化代码。但是,如果我按该按钮登录,则会收到以下错误消息:Uncaught Exception: Target of Invoke is null (NullReferenceException)

我到目前为止所做的事情:

  • 使用适当的值创建OAuth2Authenticator
  • 添加事件处理程序身份验证器。已完成+ = OnAuthCompleted;`
  • 具有global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init();global::Xamarin.Auth.Presenters.XamarinAndroid.AuthenticationConfiguration.Init(this, bundle);的特定于平台的登录UI
    • 使用以下方式触发登录: var presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter(); presenter.Login(authenticator);`

我正在使用Xamarin Live Player在iPhone上部署它。

一些解决方法?

更新: 我能够使用Android模拟器测试该应用程序,并且一切正常。所以我的推测是因为Xamarin Live Player。

0 个答案:

没有答案