From the course: Learning Apple tvOS App Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Advertise and browse for devices nearby

Advertise and browse for devices nearby

From the course: Learning Apple tvOS App Development

Start my 1-month free trial

Advertise and browse for devices nearby

- [Instructor] Now to really start working with our peer network class, let's have a look at the initializer right here that we're overriding, and what we have to do is still configuring our service advertiser and the service browser. So first of all, we have our service advertiser, which we are going to initialize with MC nearby service advertiser, and this is going to receive our current peer ID. We do not need a discovery info, but it is going to receive our service type, and also let's use the service browser, also MC nearby service browser, and initialize this with our peer ID and our service type, very simple, and then we can just initialize, or call super init off our class, and then we can continue with configuring our advertiser and our browser. So let's start with the advertiser. Again, set the delegate to self, and then we can use our browser service advertiser, and then use start advertising peer. And as soon as we did that, we are now showing ourselves with our peer ID…

Contents