0

What is the better approach of performing a network request to get data in a Apple WatchKit app.

  1. Is it sending network request inside Watch Kit extension
  2. Or performing this activity on parentApplication

Will there be any problems performing inside WatchKit Extension. If you could provide a well organised example also that would be really great.

Tharindu Madushanka
  • 3,241
  • 7
  • 31
  • 33

2 Answers2

0

You should perform on parentApplication, then send the data to the watch. The WatchKit extension can't perform a network request yet. But with the new WatchConnectivity, you will be able to do it.

Look at this : http://www.raywenderlich.com/96589/watchkit-tutorial-swift-tables-network-requests

0

tl;dr: For a WK1 app you should be sending the network request from your WK1 extension running on the phone.

I'm assuming you are talking about a WatchKit 1 app. I recommend you watch the WatchKit Tips and Tricks session from WWDC 2015 as it describes Apple's recommended approach.

ccjensen
  • 4,578
  • 2
  • 23
  • 25