Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我如何使用谷歌&x27;Xamarin.iOS中的人API?_Xamarin_Xamarin.ios Binding - Fatal编程技术网

我如何使用谷歌&x27;Xamarin.iOS中的人API?

我如何使用谷歌&x27;Xamarin.iOS中的人API?,xamarin,xamarin.ios-binding,Xamarin,Xamarin.ios Binding,我必须在我们的Xamarin中访问Google联系人。ios应用程序所以,我们在中生成了Google的people API密钥和客户端id 但我不知道如何在Xamarin.ios应用程序中使用API。我们需要使用API获取谷歌的联系方式。 我们在Google文档中获得了一些.net的代码,但不幸的是,它在Xamarin.ios平台上不起作用。xamarin平台不支持DLL。 请帮我解决这个问题。我已经使用Xamarin.Auth库解决了这个问题 Auth = new OAuth2Authenti

我必须在我们的Xamarin中访问Google联系人。ios应用程序所以,我们在中生成了Google的people API密钥和客户端id 但我不知道如何在Xamarin.ios应用程序中使用API。我们需要使用API获取谷歌的联系方式。 我们在Google文档中获得了一些.net的代码,但不幸的是,它在Xamarin.ios平台上不起作用。xamarin平台不支持DLL。
请帮我解决这个问题。

我已经使用Xamarin.Auth库解决了这个问题

Auth = new OAuth2Authenticator(
             Configuration.ClientId,
             string.Empty,
             "https://www.googleapis.com/auth/contacts",
             new Uri("https://accounts.google.com/o/oauth2/v2/auth"),
             new Uri(Configuration.RedirectUrl),
             new Uri("https://www.googleapis.com/oauth2/v4/token"),
             isUsingNativeUI: true);

            var viewController = Auth.GetUI();
            PresentViewController(viewController, true, null);

            Auth.Completed += Auth_Completed;
            Auth.Error += Auth_Error;



 private void Auth_Error(object sender, AuthenticatorErrorEventArgs e)
        {

        }



 private  void  Auth_Completed(object sender, AuthenticatorCompletedEventArgs e)
        {

            // SFSafariViewController doesn't dismiss itself
            DismissViewController(true, null);

            if (e.IsAuthenticated)
            {
            }
     }
必须在Appdelegate.cs Cals中实现OpentUrl(),最高可达iOS 12和iOS 13。在SceneDelegate.cs中实现OpenUrlContexts()方法