06-06-2019 10:21
06-06-2019 10:21
I am working on an IONIC 3 application.
In this app the user will be able to get photos from his google photos account and do some design manipulations on the image he selected.
So for that I want to use the google photos API
I did not find any example on how to accomplish this in IONIC.
I tried to do it like this:
Login to google with: cordova-plugin-googleplus
And request the https://www.googleapis.com/auth/photoslibrary scope
Here is the code:
//Here we do a login. this.gplus.login({ 'webClientId': '***********', 'offline': true, 'scopes': 'profile email https://www.googleapis.com/auth/photoslibrary' }).then((res) => { //after login we try to get the google photos albums this.http.get('https://photoslibrary.googleapis.com/v1/albums', { responseType: ResponseContentType.Json, params:{ accessToken: res.accessToken, pageSize: 50, } }).subscribe(res=>{ console.log('<--- google images res: ', res); },err=>{ console.log('<--- google images err: ', err); }); });
Now I get an error 'Expected OAuth 2 access token'
Here is the full error description:
Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
So now the question is how do is get an OAuth 2 access token in ionic 3 ?
06-11-2019 01:52
06-11-2019 01:52
I think you're on the wrong forum. This is for the Fitbit SDK.