Open christinachimi opened 2 months ago
@christinachimi were you able to fix this?
@3KINGZ providing the argument as a string works, so it's "fixed" in that sense, but I still think either the docs or the actual functionality is wrong.
I am seeing this issue, but I am also seeing an issue where on Android, my launch args are empty altogether. LaunchArguments.value()
just returns an empty object.
@christinachimi thanks that works
I am seeing this issue, but I am also seeing an issue where on Android, my launch args are empty altogether.
LaunchArguments.value()
just returns an empty object.
@kanzelm3 are you getting even after passing the arguments as a string type?
I tested on Android with a the following:
appId: ${APP_ID}
---
- launchApp:
arguments:
isE2E: true
coolThing: 'Launch app with E2E flag'
And using the following in my app:
import { LaunchArguments } from 'react-native-launch-arguments';
console.log('Launch Args:', LaunchArguments.value());
on Android I see this
Just a heads up, if you are using Typescript you can do something like
type MyLaunchArgs ={
myArg:boolean
}
LaunchArguments.value<MyLaunchArgs>().myArg
Typescript will do the cast for you
Is there an existing issue for this?
Steps to reproduce
Create a test file with a boolean launch argument:
In my app code, I use
react-native-launch-arguments
to get the value, something like:Actual results
The argument seems to be undefined in my app code.
Expected results
I expect the argument to be true.
About app
React Native Expo app, testing on iOS Simulator. React native version 0.74.3, react-native-launch-arguments version 4.0.2, expo 51.0.22.
About environment
Logs
Logs
``` ```Maestro version
1.37.9
How did you install Maestro?
Homebrew
Anything else?
This may just be a documentation bug. I am able to get this working by providing the argument as a string. When I do that it is available to my app as a boolean which is great. But the docs indicate that it can be set as a boolean in the yaml file which doesn't seem to be the case, at least not for React Native.