Several days ago I released a new version of the core Google APIs client library for .NET (version 1.8.2)
This release includes several bug fixes, such as fixing MaxUrlLengthInterceptor to not delete the last character of a URL and improving FileDataStore to support an absolute path folder.
The full issues list is available in the library's latest blogpost.
In addition, from this release we support token revocation. UserCredential now contains a new RevokeTokenAsync method which revokes the current token.
Later on, you can reauthorize the user again by calling GoogleWebAuthorizationBroker's ReauthorizeAsync. By doing so, the user will have to reauthorize your application to use his or her private resources.
Take a look in the following snippet:
Note the following:
- You should already be familiar with lines 1-20. Those lines contain the creation of user credentials and a book service, and a sample request to this service.
- In line 23 there is a call to the new RovokeTokenAsync method. From this point the access token is invalid and it is removed form the data store.
- Then, any request using the current credentials will fail, because the access token was revoked (lines 25-33).
- In this point, the user can reauthorize the application again to access his or her private resources, by calling to ReauthorizeAsync (line 37).
While working on this release I encountered the following error over and over again while trying to compile a Windows Phone sample using the new 1.8.2 library:
Error 3 Cannot resolve reference assemblies. Please check the reference assemblies. Cannot resolve dependency to assembly 'Google.Apis, Version=184.108.40.206687, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
Thanks Mr. Gill :)
All I had to do is to change the following line in the Windows Phone project file:
And set the validate XAML tag to false.
The countdown continues... In 10 days I'm going to arrive in Brazil and in 12 days I'm going to watch my first world cup game ever. And... what an amazing game to start with: Spain-Holland.
Bom dia amigos!