@@ -63,8 +63,7 @@ + (BOOL)requiresMainQueueSetup
6363RCT_EXPORT_METHOD (connectToSSID:(NSString *)ssid
6464 resolver:(RCTPromiseResolveBlock)resolve
6565 rejecter:(RCTPromiseRejectBlock)reject) {
66- NSNumber *defaultTimeout = @(0 ); // Provide a default value for timeout, fix issue #379
67- [self connectToProtectedSSID: ssid withPassphrase: @" " isWEP: false isHidden: false timeout: defaultTimeout resolver: resolve rejecter: reject];
66+ [self connectToProtectedSSID: ssid withPassphrase: @" " isWEP: false isHidden: false resolver: resolve rejecter: reject];
6867}
6968
7069RCT_EXPORT_METHOD (connectToSSIDPrefix:(NSString *)ssid
@@ -132,7 +131,6 @@ + (BOOL)requiresMainQueueSetup
132131 withPassphrase:(NSString *)passphrase
133132 isWEP:(BOOL )isWEP
134133 isHidden:(BOOL )isHidden
135- timeout:(nonnull NSNumber *)timeout // Explicitly mark timeout as nonnull, fix issue #379
136134 resolver:(RCTPromiseResolveBlock)resolve
137135 rejecter:(RCTPromiseRejectBlock)reject) {
138136 [self connectToProtectedSSIDOnce: ssid withPassphrase: passphrase isWEP: isWEP joinOnce: false resolver: resolve rejecter: reject];
@@ -160,7 +158,7 @@ + (BOOL)requiresMainQueueSetup
160158 resolve (nil );
161159 return ;
162160 }
163-
161+
164162 if (@available (iOS 11.0 , *)) {
165163 NEHotspotConfiguration* configuration;
166164 // Check if open network
@@ -182,7 +180,7 @@ + (BOOL)requiresMainQueueSetup
182180 __block int tries = 0 ;
183181 __block int maxTries = 20 ;
184182 double intervalSeconds = 0.5 ;
185-
183+
186184 dispatch_queue_t queue = dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 );
187185 dispatch_source_t dispatchSource = dispatch_source_create (DISPATCH_SOURCE_TYPE_TIMER, 0 , 0 , queue);
188186 dispatch_time_t startTime = dispatch_time (DISPATCH_TIME_NOW, 0 );
@@ -192,7 +190,7 @@ + (BOOL)requiresMainQueueSetup
192190 [self getWifiSSID: ^(NSString * newSSID) {
193191 bool success = [ssid isEqualToString: newSSID];
194192 tries++;
195-
193+
196194 if (success){
197195 resolve (nil );
198196 dispatch_suspend (dispatchSource);
@@ -286,11 +284,11 @@ + (BOOL)requiresMainQueueSetup
286284
287285- (NSString *)parseError : (NSError *)error {
288286 if (@available (iOS 11 , *)) {
289-
287+
290288 if (!error) {
291289 return [ConnectError code: UnableToConnect];
292290 };
293-
291+
294292 /*
295293 NEHotspotConfigurationErrorInvalid = 0,
296294 NEHotspotConfigurationErrorInvalidSSID = 1,
0 commit comments