NSURLErrorNotConnectedToInternet after updating to Watch OS 9.0

After updating to Watch OS 9 our app suddenly cannot connect to the internet with my app using a NSURLSession. It gets an error NSURLErrorNotConnectedToInternet every time. But this still works fine on Watch OS 8.

I'm definitely connected to the Internet over WIFI on my Watch and iPhone. It still works fine in the simulator but not on my Watch. Are there any new requirements in Watch OS 9 to get internet access, such as request permission from the user or adding anything to info.plist?

Thanks

Post not yet marked as solved Up vote post of coderkid Down vote post of coderkid
1k views
Add a Comment

Replies

What sort of task are you running in your session? Something that runs an HTTP[S] request, like a data task (NSURLSessionDataTask)? Or something more low-level, like a stream task (NSURLSessionStreamTask) or WebSocket task (NSURLSessionWebSocketTask)?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I do both, but for testing purposes I am just running this:

NSString* results = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"https://google.com"] encoding: NSStringEncodingConversionAllowLossy error: nil];

NSLog(@"Content: %@", results);

It works in the simulator and in OS 8, but not on my physical watch. Is there anything I need to add to my .plist file like I do for iOS?

Thanks

For those reading along at home, I’ll be helping coderkid in a different context.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"