1

I am new to work light. I want to create an application which shows me current available wifi network as a list and allow me to connect any of them and also it show the signal strength of the each network. I have studied the WL.Device.Wifi but it is not giving much help. Please provide your suggestions. I want to do this for iOS.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
TechChain
  • 8,404
  • 29
  • 103
  • 228

2 Answers2

2

Try this, It will give the currently connected network but not the list of available networks. Apple not supporting that.

NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
    NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
    id info = nil;
    for (NSString *ifnam in ifs)
    {
        info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
        NSLog(@"%s: %@ => %@", __func__, ifnam, info);
        if (info && [info count])
        {
            break;
        }
    }
Alex Andrews
  • 1,498
  • 2
  • 19
  • 33
0

There is limited support for what you're asking for, when using the WL.Device API in iOS.

You can see the following question&answer for more information about what is possible and any limitations: How to list the available Wifi access point in worklight

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • hello i was waiting for your reply to come. As you have worked a lot on this. So it means it is not possible in Work light. if not then is there any other way to do this ? – TechChain Nov 18 '14 at 08:41
  • 1
    Maybe it is possible using a Cordova plug-in that will execute native code. See the other answer you were given. – Idan Adar Nov 18 '14 at 08:52
  • I have looked for iOS but it does not allow such type of functionality using public API. Cordova plugin is not helping out. – TechChain Nov 18 '14 at 09:14
  • Then you cannot implement this. – Idan Adar Nov 18 '14 at 09:14
  • For what purpose we use WL.Device.wifi i have studied it but it is not providing the clarity. – TechChain Nov 18 '14 at 09:20
  • WL.Device.wifi is a collection of a different methods. You can read more about it in the Location Services training module: http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v620/10_04_Location_services_in_worklight_applications.pdf You can read more in the IBM Worklight Knowledge Center. – Idan Adar Nov 18 '14 at 09:26
  • can i have your email id or any source to contact you – TechChain Nov 18 '14 at 09:28
  • location services are of different use and not full filling my requirement. – TechChain Nov 18 '14 at 10:28