【发布时间】:2017-08-15 20:45:21
【问题描述】:
我正在 Xamarin.Forms 应用中实现身份验证。我在看这个样本“TodoAWSAuth - Configuring Google as an OAuth identity provider”。在我为 android 实现的 OAuthLoginPresenter 中,我有这个代码: 使用 Xamarin.Auth;
namespace InstagramApp.Droid
{
public class OAuthLoginPresenter
{
public void Login(Authenticator authenticator)
{
Xamarin.Forms.Forms.Context.StartActivity(authenticator.GetUI(Xamarin.Forms.Forms.Context));
}
}
}
我的:
Xamarin.Forms.Forms.Context.StartActivity(authenticator.GetUI(Xamarin.Forms.Forms.Context));
返回我:
参数 1:无法从 'object' 转换为 'System.Type'
与链接中的示例相同。可能是什么问题?
同样在 Xamarin 文档中,代码是相同的: Xamarin.Auth documentation
谢谢大家
【问题讨论】:
-
你有包含 android 项目中特定类型的程序集的引用吗?
标签: c# android authentication login xamarin.forms