Google カレンダー API バージョン 3 の承認で行き詰まっています
私が構築しようとしているのは、データベースのコンテンツを Google カレンダーにフィードするアプリケーションです
私はこのアプリケーションを Google Api バージョン 2 で完全に動作させました。ただし、バージョン 3 には使用したい新機能がいくつかあります。
残念ながら、バージョン 3 は下位互換性がありません
これはこれまでの私のコードです:
Imports DotNetOpenAuth.OAuth2
Imports Google.Apis.Authentication.OAuth2
Imports Google.Apis.Authentication.OAuth2.DotNetOpenAuth
Imports Google.Apis.Calendar.v3
Imports Google.Apis.Calendar.v3.Data
Imports Google.Apis.Util
Public Shared Sub Main(args As String())
Dim provider = New NativeApplicationClient(GoogleAuthenticationServer.Description)
provider.ClientIdentifier = "<client id>"
provider.ClientSecret = "<client secret>"
Dim auth = New OAuth2Authenticator(Of NativeApplicationClient)(provider, AddressOf GetAuthorization)
Dim service = New CalendarService(auth)
End Sub
Private Shared Function GetAuthorization(arg As NativeApplicationClient) As IAuthorizationState
Dim scopes As New System.Collections.Generic.List(Of String)
scopes.Add(CalendarService.Scopes.Calendar.GetStringValue())
Dim state As IAuthorizationState = New AuthorizationState(scopes)
state.Callback = New Uri(NativeApplicationClient.OutOfBandCallbackUrl)
Dim authUri As Uri = arg.RequestUserAuthorization(state)
Process.Start(authUri.ToString())
Return arg.ProcessUserAuthorization(state)
End Function
エラーが発生します。Error1'IAuthorizationState' は名前空間 'DotNetOpenAuth.OAuth2' にあいまいです。
何が間違っているのかわかりません(Google APIマニュアルのすべてのステップに従い、DLLも必要です)
うまくいけば、誰かが私を助けることができます。
よろしくお願いいたします。:)