Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ios): avoid memory leak from ssid APIs by adding explicit config (#…
…560) * Fix #420 - Location Permissions Required `CNCopyCurrentNetworkInfo` will leak without location permissions being enabled. Added comments for depreciations & implementation notes that need future work. * 420 - Pass config to native iOS & gate on new prop Added new exported method for passing configuration to native iOS. Storing it there on the instance as a property and gating based on that config. It will not fetch SSIDs if config is nil. Also cleaned up a bit of typing. * 420 - Fix mock * 420 Updated README Co-authored-by: Mike Hardy <github@mikehardy.net>
- Loading branch information
Showing
9 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
export default { | ||
import * as Types from './types'; | ||
|
||
const DEFAULT_CONFIGURATION: Types.NetInfoConfiguration = { | ||
reachabilityUrl: 'https://clients3.google.com/generate_204', | ||
reachabilityTest: (response: Response): Promise<boolean> => | ||
Promise.resolve(response.status === 204), | ||
reachabilityShortTimeout: 5 * 1000, // 5s | ||
reachabilityLongTimeout: 60 * 1000, // 60s | ||
reachabilityRequestTimeout: 15 * 1000, // 15s | ||
reachabilityShouldRun: (): boolean => true, | ||
shouldFetchWiFiSSID: false | ||
}; | ||
|
||
export default DEFAULT_CONFIGURATION; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
export default { | ||
import * as Types from './types'; | ||
|
||
const DEFAULT_CONFIGURATION: Types.NetInfoConfiguration = { | ||
reachabilityUrl: '/', | ||
reachabilityTest: (response: Response): Promise<boolean> => | ||
Promise.resolve(response.status === 200), | ||
reachabilityShortTimeout: 5 * 1000, // 5s | ||
reachabilityLongTimeout: 60 * 1000, // 60s | ||
reachabilityRequestTimeout: 15 * 1000, // 15s | ||
reachabilityShouldRun: (): boolean => true, | ||
shouldFetchWiFiSSID: true | ||
}; | ||
|
||
export default DEFAULT_CONFIGURATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters