I am developing one voIP application in which I have to register to the server every 60 minutes. Register consists of two parts,
-
HTTP request to web server.
-
Some other tasks in another server.
During initial login, I am getting access token and refresh token. Access token has a validity of 48 hours. Every one hour I get push notifications from server for which I have to do registration. Also I request for access token using refresh token on the push notifications I get on 45th, 46th and 47th hours so that my access token remain valid. Everything works fine. Access token, login, register to server. After 48 hours getting Access token using Refresh token also works good most of the time. But sometimes for getting access token using refresh token I am getting the following error,
Error Domain=org.openid.appauth.general Code=-5 "Connection error making token request to ‘’: The Internet connection appears to be offline.." UserInfo={NSLocalizedDescription=Connection error making token request to ‘**/mga/sps/oauth/oauth20/token': The Internet connection appears to be offline.., NSUnderlyingError=0x28991fc90 {Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x28991fa50 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: pdp_ip0[lte], ipv4, ipv6, dns, expensive, _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<9>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask .<9>" ), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=/mga/sps/oauth/oauth20/token, NSErrorFailingURLKey=****/mga/sps/oauth/oauth20/token, _kCFStreamErrorDomainKey=1}}})
I am not sure why I am getting this error. I am sure internet was available on my device at that time. Because I am getting success response for other registration tasks at that time (FYI, I request for access token using refresh token for the last 3 pushes I get i.e, 45th, 46th and 47th hours).
Did someone run into this issue before. Please suggest me why I am getting this error and how to get rid of it.
I am using iOS 13+ devices.