react-native-location-enabler icon indicating copy to clipboard operation
react-native-location-enabler copied to clipboard

Issue on IOS

Open mak12 opened this issue 3 years ago • 10 comments
trafficstars

Hi, not able to run app in iOS after installing this library , issue is Invariant Violation: new NativeEventEmitter() requires a non-null argument. This issue is already reported and closed but its not fixed.

mak12 avatar Jun 16 '22 14:06 mak12

Hi did you fix it? I face with same problem

kadirmenz avatar Jun 22 '22 08:06 kadirmenz

No, I ended up changing the library.

mak12 avatar Jun 25 '22 10:06 mak12

Can you give me advice for this future?

kadirmenz avatar Jun 25 '22 10:06 kadirmenz

I used this one https://github.com/Richou/react-native-android-location-enabler#readme

mak12 avatar Jun 25 '22 10:06 mak12

You can use the platform-specific code of react-native. import the package when the phone is only android. first create two files by the name locationEnabler.android.js and locationEnabler.ios.js import the package in locationEnabler.android.js and use it as usual.

aataa-fa avatar Jul 03 '22 11:07 aataa-fa

the link for platform-specific code of react-native https://reactnative.dev/docs/platform-specific-code.html#platform-specific-extensions

aataa-fa avatar Jul 03 '22 11:07 aataa-fa

is there any way to edit the alert content?

sameerasad avatar Aug 08 '22 15:08 sameerasad

is there any way to edit the alert content?

there is not any way to change the alert content, cause it comes from native android settings api

aataa-fa avatar Aug 09 '22 05:08 aataa-fa

`import {Platform} from 'react-native';

import AddingDevicesScreenAndroid from './AddingDevicesScreen.android'; import AddingDevicesScreenIos from './AddingDevicesScreen.ios';

export default Platform.select({ ios: AddingDevicesScreenIos, android: AddingDevicesScreenAndroid, });`

You guys can try this. This work for me. I made 2 versions for each specific platform.

KienHaVan avatar Feb 27 '23 09:02 KienHaVan

the best solution for me: https://reactnative.dev/docs/platform-specific-code#platform-specific-extensions

amir-ibrahim avatar Feb 27 '24 09:02 amir-ibrahim