1

Ich versuche Videos auf YouTube hochzuladen, aber irgendwie funktioniert es nicht in Xamarin.Forms (Portable) Projekt. Gibt es eine Möglichkeit, die Videos in YouTube durch Xamarin.Forms (Portable)So laden Sie Videos auf YouTube hoch [Xamarin.Forms (Portable)]

var initializer = new GoogleAuthorizationCodeFlow.Initializer 
{ 
    ClientSecrets = new ClientSecrets 
    { 
     ClientId = Constants.API.Google.ClientID, 
     ClientSecret = Constants.API.Google.ClientSecret 
    }, 
    Scopes = new[] { YouTubeService.Scope.Youtube } 
}; 
var flow = new AuthorizationCodeFlow(initializer); 
TokenResponse token = flow.LoadTokenAsync("user", CancellationToken.None).Result; 

aber jedes Mal, wenn ich bin immer null in TokenResponse token hochladen, bin ich nicht sicher, was soll ich anstelle von user in flow.LoadTokenAsync("user", CancellationToken.None) passieren

danken Ihnen.

+0

Ich schlage vor, dass Sie dies als ein Problem in der Client-Bibliothek veröffentlichen. https://github.com/google/google-api-dotnet-client/issues – DaImTo

Antwort

1

Wie ich befürchtet hatte, unterstützt die Google .Net-Clientbibliothek derzeit nicht Xamarin. Bitte siehe Ausgabe: Unable to Google.Apis.Auth.PlatformServices in Xamarin.Forms

Es ist, weil GoogleWebAuthorizationBroker mehrere Klassen von Google.Apis.Auth.PlatformServices erfordert, und Google.Apis.Auth.PlatformServices ist nicht kompatibel mit Xamarin.

+0

Also, gibt es eine andere Möglichkeit, es zu tun? –

+0

Nicht die offizielle Client-Bibliothek verwenden. Sie müssen dies selbst programmieren. Die Empfehlung von Chris wird nicht funktionieren, da die YouTube-API keine Dienstkonten unterstützt. – DaImTo

+0

Also, du meinst zu sagen, ich muss den HttpClient benutzen, oder? –

Verwandte Themen