[Solved] No internet available during IAP case

In the case where there is no internet connection available I am getting a bunch of messages in Xcode like this:
2017-02-19 21:50:17.446153 alphabet[4067:1278952] UnityIAP:Requesting product data…

2017-02-19 21:50:17.517665 alphabet[4067:1278952] UnityIAP:SKProductRequest::didFailWithError: 110, Error Domain=SSErrorDomain Code=110 “Cannot connect to iTunes Store” UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store, NSUnderlyingError=0x17045ee70 {Error Domain=NSURLErrorDomain Code=-1009 “Cannot connect to iTunes Store” UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store, NSErrorFailingURLStringKey=Connecting to the iTunes Store., NSErrorFailingURLKey=Connecting to the iTunes Store., _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSUnderlyingError=0x17045f320 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 “(null)” UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}}}}. Unity Purchasing will retry in 60 seconds

It continuously retries so that’s why I get a bunch of them.

My question is, is there a way to check for internet access and stop Unity IAP from attempting to connect to the internet?

Thanks

@gegagome

This is by design. As you can see by the last line, Purchasing will retry connecting after 60 seconds. If the system is able to connect to the internet, then the error messages will go away.

This connection attempt happens after you Initialize the purchasing system, so you should be able to check for internet connectivity before initialization. But you would be responsible for re-checking for internet in order for initialization to happen.