{"id":16687239,"url":"https://github.com/redth/googlesigninmigration","last_synced_at":"2025-10-13T09:16:13.246Z","repository":{"id":36619077,"uuid":"40925281","full_name":"Redth/GoogleSignInMigration","owner":"Redth","description":"Sample Xamarin.iOS showing how to use the new Google SignIn API's with the old Plus API's","archived":false,"fork":false,"pushed_at":"2015-09-18T12:39:35.000Z","size":156,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-11T20:17:13.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Miserlou/Zappa","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Redth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-17T20:10:32.000Z","updated_at":"2016-07-23T21:43:44.000Z","dependencies_parsed_at":"2022-08-08T16:15:21.983Z","dependency_job_id":null,"html_url":"https://github.com/Redth/GoogleSignInMigration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Redth/GoogleSignInMigration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redth%2FGoogleSignInMigration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redth%2FGoogleSignInMigration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redth%2FGoogleSignInMigration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redth%2FGoogleSignInMigration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Redth","download_url":"https://codeload.github.com/Redth/GoogleSignInMigration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redth%2FGoogleSignInMigration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014487,"owners_count":26085535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T15:08:20.735Z","updated_at":"2025-10-13T09:16:13.211Z","avatar_url":"https://github.com/Redth.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Sign In Migration Sample\n\nSample Xamarin.iOS showing how to use the new Google SignIn API's with the old Plus API's.\n\n\nGoogle has  a newer/better Sign In SDK for iOS which is now available on [NuGet](https://www.nuget.org/packages/Xamarin.Google.iOS.SignIn/), however the existing [Plus](https://www.nuget.org/packages/Xamarin.Google.iOS.Plus/) and [Play Games](https://www.nuget.org/packages/Xamarin.Google.iOS.PlayGames/) SDKs still use the old Sign In API's (contained within the existing Plus SDK).  \n\nThis is mostly interesting because while the old Sign In API's still work, as a fallback method of authenticating (if no Google apps are installed to handle auth), the old Sign In SDK launches Safari to perform the authentication.\n\nThis is a problem as Apple has started to reject some apps that use Safari to perform authentication.  It's ok to use a webview inside of your own app for authentication, just not to use Safari.  The new Sign In SDK does this and aheres to Apple's new policy.\n\nThe problem is, it's not clear how to integrate the new Sign In SDK with the existing Plus and Play Games SDKs which still bundle the old Sign In SDK.  Until Google releases an update, this sample exists to show a simple work around.\n\nWhen you implement the new Sign In SDK, you will implement the `ISignInDelegate` with at least the `DidSignIn` method.  With the given parameters of that method it is possible to create an instance of `OAuth2Authentication`:\n\n```csharp\nclass MySignInDelegate : ISignInDelegate \n{\n\tvoid DidSignIn (SignIn signIn, GoogleUser user, NSError error) \n\t{\n\t\t// Convert the new SignIn info into old format\n\t\tvar myOAuth2AuthenticationInstance = new OAuth2Authentication {\n\t\t\tClientId = signIn.ClientID,\n\t\t\tAccessToken = user.Authentication.AccessToken,\n\t\t\tExpirationDate = user.Authentication.AccessTokenExpirationDate,\n\t\t\tRefreshToken = user.Authentication.RefreshToken,\n\t\t\tTokenURL = new NSUrl (\"https://accounts.google.com/o/oauth2/token\")\n\t\t}\n\t}\n}\n```\n\nOnce you have an instance of `OAuth2Authentication` which is what the Plus and Play Games APIs expect, you can assign it to your API calls:\n\n```csharp\nvar plusService = new Google.OpenSource.ServicePlus {\n\tRetryEnabled = true,\n\tAuthorizer = myOAuth2AuthenticationInstance\n};\n```\n\nThis should allow you to continue using the current versions of the Plus and Play Games SDKs with the new Sign In SDK.\n\nEnjoy!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredth%2Fgooglesigninmigration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredth%2Fgooglesigninmigration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredth%2Fgooglesigninmigration/lists"}