NEHotSpotHelper Doubts

Hello,


I am working with Network Extension framework, I am using the NEHotspotHelper to connect to some of our routers. My problem is that I need to diferenciate between two kind of routers. At this moment I am able to register them as supported networks and fix a name for them like this:


[options setObject:@"MyWiFi" forKey:kNEHotspotHelperOptionDisplayName];


My questions are these:


1) Is It possible one app with multiple NEHotspotHelpers?


2) If I use this function in order to register the handler of the helper:

queue = dispatch_queue_create("MyApp", 0); 
    BOOL returnType = [NEHotspotHelper registerWithOptions:options queue:queue handler:^(NEHotspotHelperCommand *cmd) {

Is there any way to change the registration options once the helper is queued?


3) I am adding a TodayExtension for my app, I have added the network extension for it too, but XCode is not signing it. I supose that the entitlement can not be used with extensions, can you confirm this point please?


Thank you very much.

M.W.

Replies

1) Is It possible one app with multiple NEHotspotHelpers?

No.

+registerWithOptions:queue:handler:
is a class method, so you can only register once.

2) … Is there any way to change the registration options once the helper is queued?

No.

3) I am adding a TodayExtension for my app, I have added the network extension for it too, but XCode is not signing it. I supose that the entitlement can not be used with extensions, can you confirm this point please?

I’m not entirely sure what you mean by this, but if your plan is to use the NEHotspotHelper API in a today extension then, no, that’s not going to work. NEHotspotHelper was specifically designed to be used by your main app only.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you very much eskimo,


after your explanation I need to know just two more question, is it possible to stop the NEHotspotHelper programmatically without finishing the app?


BOOL returnType = [NEHotspotHelper registerWithOptions:options queue:queue handler:^(NEHotspotHelperCommand *cmd)


and the other question is, is it possible for the Today extension know some how if the NEHotspotHelper is activated?


Thank you very much again.

… is it possible to stop the NEHotspotHelper programmatically without finishing the app?

No, but you can prevent the hotspot helper from doing anything by simply not expressing any confidence in the networks passed to you in the

.filterScanList
command.

is it possible for the Today extension know some how if the NEHotspotHelper is activated?

No via the hotspot helper subsystem, but you could probably achieve this via other means (for example, by taking advantage of the ‘state’ support in the Darwin notification system.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"