Listeners appear to be removed but when they are added again after removal, they are called multiple times
Copy env file and set values. Listen flag should be a flag in the LD project related to the MOBILE_KEY that you will toggle to trigger listener in the RN project
# copy env file
cp .env.sample .env
# eg.
MOBILE_KEY=mob-******-****-****-****-********
LISTEN_FLAG=myTestFlag
Install dependencies and start the React Native application
yarn pod
yarn ios
# If you are using M1 silicon, run with Rosetta:
# arch -x86_64 yarn pod
# arch -x86_64 yarn ios
- Click "add listener"
- Click "remove listener"
- Click "add listener" again
- Toggle the value of the LISTEN_FLAG in LD project
Callback should be called once.
Callback is called twice.
- The contents of
client.flagListeners
appears correct (there is only one listener in the array for the given flag) - Adding and removing the listener n time results in n callbacks