How to scan and list WiFi devices xamarin ios

guru_vijayguru_vijay Member ✭✭

Hello,
how to scan and list wifi devices xamarin ios. please provide some code reference

Tagged:

Best Answer

Answers

  • guru_vijayguru_vijay Member ✭✭

    bool IsRegistered = NEHotspotHelper.Register(options, queue, (NEHotspotHelperCommand cmd) =>
    {
    if(cmd.CommandType == NEHotspotHelperCommandType.Evaluate || cmd.CommandType == NEHotspotHelperCommandType.FilterScanList)
    {
    foreach(NEHotspotNetwork network in cmd.NetworkList)
    {
    //xxxx
    }
    }
    });

    Is registered becomes false. please guide me what i am doing wrong.

  • ColeXColeX Member, Xamarin Team Xamurai

    Did you add UIBackgroundModes into info.plist ? And enable Wireless Accessory Configuration in entitlements.plist ?

  • guru_vijayguru_vijay Member ✭✭

    Yeah done. but still returning false. IsRegistered

  • guru_vijayguru_vijay Member ✭✭

    @ColeX said:
    It could be achieve by NetworkExtension framework , but we need to send an application to apple and approve it to gain access to the framework.

    Detailed refer :https://forums.xamarin.com/discussion/comment/376801/#Comment_376801


    I test the OC code and it works on native iOS . I convert the code to C# .

    void scanWifiInfos()
        {
            NEHotspotHelperOptions options = new NEHotspotHelperOptions();
            options.DisplayName = new NSString("EFNEHotspotHelperDemo");
    
            DispatchQueue queue = new DispatchQueue("EFNEHotspotHelperDemo");
    
    
            NEHotspotHelper.Register(options, queue, (NEHotspotHelperCommand cmd) =>
            {
                if(cmd.CommandType == NEHotspotHelperCommandType.Evaluate || cmd.CommandType == NEHotspotHelperCommandType.FilterScanList)
                {
                    foreach(NEHotspotNetwork network in cmd.NetworkList)
                    {
                        //xxxx
                    }
                }
            });
        }
    

    Yeah done. but still returning false. IsRegistered. Pls provide me a solution

Sign In or Register to comment.