Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native-network-info dep not needed in android app #273

Open
emanuelb opened this issue Aug 4, 2020 · 0 comments
Open

react-native-network-info dep not needed in android app #273

emanuelb opened this issue Aug 4, 2020 · 0 comments

Comments

@emanuelb
Copy link

emanuelb commented Aug 4, 2020

The package react-native-network-info is used only in IOS app as can be seen in below code: (for android the package react-native-wifi-reborn is used instead)
but it's included in the android app as part of the build process.

ios path:

import { NetworkInfo } from 'react-native-network-info';

if (IS_IOS) {
bssids = await NetworkInfo.getBSSID();

android path:

import WifiManager from 'react-native-wifi-reborn';

} else {
WifiManager.loadWifiList(async (wifiObjects) => {

fix:
use platform specific imports so that not needed packages won't be included in the resulted APK/IPA. (and won't be installed in the build process as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant