I am using NEHotspotConfigurationManager to connect wifi programmatically.
Its an open Network without any password I am using below code:
if (@available(iOS 11.0, *))
{
NEHotspotConfiguration *config = [[NEHotspotConfiguration alloc]initWithSSID:SSIDName];
[NEHotspotConfigurationManager.sharedManager applyConfiguration:config completionHandler:^(NSError* error)
{
if (error
)
{
printf([error description]);
} else
{
printf(@"success");
} }];
I am connecting to the hostpot/access point of one device, but every time I am getting an error of unable to join but in response it goes to success as the error is nil. Is there any thing I need to add in configuration or add in setting or am I missing anything ?