Google Assistant API with Xamarin.Auth

Has anyone tried to utilize the Google Assistant API on Xamarin? I know that the Google APIs Client Library for .NET in the form of several NuGet packages (such as Google.Apis.Auth) explicitly says it is not compatible with Xamarin, but that appears to be because they didn't want to handle the fact that their GoogleWebAuthorizationBroker helper doesn't work in UWP/Xamarin because it attempts to call Process.start() to open a web browser.

I can use Xamarin.Auth to get tokens to use with the Assistant API, but need to translate the token information into a grpc.auth ChannelCredential (or a Google.Apis.Auth UserCredential).

Has anyone had experience attempting to do this?

Best Answer

  • Tyler_SouthardTyler_Southard US
    Accepted Answer

    I ended up not using Xamarin.Auth or gRPC. There's an issue compiling for .NET Native (UWP store) with gRPC (gRPC issue 18188). I would post links, but I apparently haven't been around long enough.

    I ended up creating a web request to do the authentication (naturally cross platform) like in the OAuthUniversalApp on github.

    For the actual assistant request, they provide a mechanism to do RPC over http. There's a page on the Google APIs github.io site for How to Call Google APIs: RPC Edition.

Answers

  • WinterCloudWinterCloud ✭✭✭ GBMember ✭✭✭

    did u find a solution of this? I'm stuck on the same thing. :(

  • Tyler_SouthardTyler_Southard USMember
    Accepted Answer

    I ended up not using Xamarin.Auth or gRPC. There's an issue compiling for .NET Native (UWP store) with gRPC (gRPC issue 18188). I would post links, but I apparently haven't been around long enough.

    I ended up creating a web request to do the authentication (naturally cross platform) like in the OAuthUniversalApp on github.

    For the actual assistant request, they provide a mechanism to do RPC over http. There's a page on the Google APIs github.io site for How to Call Google APIs: RPC Edition.

Sign In or Register to comment.