We have implemented an application that uses google API to get the calendar details.
We have retrieved the Access token from the authentication process and need to verify it and use it to retrieve the calendar events.
When we trying to execute the below request it throws an error. Can anyone help me to fix it?
This code is working fine on Android devices. The error happens with IOS devices.
public checkTokenValidity(token) {
var validTkn = false ;
var request = gapi.client.request({
'path': 'https://www.googleapis.com/oauth2/v1/tokeninfo',
'params' : {"access_token": token},
'method': 'GET',
'callback': function (jsonR, rawR) {
var error = jsonR['error'];
if (error == "invalid_token") {
validTkn = false;
} else {
validTkn = true;
}
}
});
}
XCode console
2021-01-07 16:00:12.571141+0530 LOIS[2225:418373] [] nw_socket_handle_socket_event [C19.1:2] Socket SO_ERROR [61: Connection refused]
2021-01-07 16:00:12.588281+0530 LOIS[2225:418373] [] nw_socket_handle_socket_event [C19.2:2] Socket SO_ERROR [61: Connection refused]
2021-01-07 16:00:12.592103+0530 LOIS[2225:418373] TIC TCP Conn Failed [19:0x28224d8c0]: 1:61 Err(61)
2021-01-07 16:00:12.595987+0530 LOIS[2225:418373] Task <8263FF9C-A666-4B73-B40B-D06BD5CD8B03>.<0> HTTP load failed (error code: -1004 [1:61])
2021-01-07 16:00:12.596327+0530 LOIS[2225:419003] NSURLConnection finished with error - code -1004
2021-01-07 16:00:12.638142+0530 LOIS[2225:418021] webView:didFailLoadWithError - -1004: Could not connect to the server.
1 post - 1 participant