Google authentication and get information about the user with Plugin.Google
When we have a Xamarin.Forms Portable application we have to click on
References -> Manage NuGet Packages.
Type in: Plugin.Google and Install.
After the Install it creates 4 folders: Models, View, ViewModel és Services. If it is possible, leaves the ViewModel folder intact.
Models folder: It contains the response Object Model(User’s information)
It is necessary to define the query URL, which ask for details from Google down. Here we have to change the Client ID and Client Secret and if we don’t have own website we don’t have to change the Redirect URL.
View: GoogleProfileCsPage.cs is a Page, which displays the data.
https://console.developers.google.com here we have to make an appllication as Web application. But first we have to make a new Project.
Within that go to the Credentials. Then go to OAuth consent screen. There fill the Product name shown field with our application name. Thengo to Credentials and press the Create Credentials button. Choose that, we will create an OAuth Client ID. Then create a web application. Fill the Authorized redirect URIs with this URL, if we don’t have own website: (https://www.youtube.com/channel/UCzGUzVfMWhrvkjuvcLBNPww).
Finally, click on the Library tab and Enable the Google+ Api. After 5 minutes we can use our application.