question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Improvement] Need ability to Pass multiple string extras to intentOptions

See original GitHub issue

In #539 the feature of passing intent option while using expresso driver was added. While passing single option value combination works fine, when passing multiple options only first option is actually passed to the target activity.

Examples:

  1. Passing es params with appium in espresso mode
intentOptions:          { 'es'         => ["option1", 'value1', "option2", "value2"],
                                              'action'     => 'android.intent.action.MAIN',
                                              'categories' => 'android.intent.category.LAUNCHER',
                                              'component'  => 'com.bumble.app/.ui.launcher.DebugLauncherActivity',
                                              'flags'      => 'FLAG_ACTIVITY_NEW_TASK' },

POST request to the appium

[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:53467/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":null,"deviceName":"emulator-5554","appActivity":".ui.launcher.DebugLauncherActivity","appPackage":"com.bumble.app","appWaitActivity":"*","automationName":"espresso","skipServerInstallation":true,"noSign":true,"newCommandTimeout":0,"autoGrantPermissions":true,"skipUnlock":true,"fullReset":false,"tmpDir":"/var/folders/b9/sz7k63z90g93_sfmq86bg7yw0000gp/T/appium_temp/0","intentOptions":{"es":["option1","value1","option2","value2"],"action":"android.intent.action.MAIN","categories":"android.intent.category.LAUNCHER","component":"com.bumble.app/.ui.launcher.DebugLauncherActivity","flags":"FLAG_ACTIVITY_NEW_TASK"},...

Data recieved by target activity

D DebugLauncher: {"action":"android.intent.action.MAIN","categories":["android.intent.category.LAUNCHER"],"component":{"package":"com.bumble.app","class":"com.bumble.app.ui.launcher.DebugLauncherActivity"},"flags":335544320,"extras":{"option1":"value1"}}

If I start the activity with adb command

adb shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.bumble.app/.ui.launcher.DebugLauncherActivity --es option1 value1 --es option2 value2

Data received by the target activity

D DebugLauncher: {"action":"android.intent.action.MAIN","categories":["android.intent.category.LAUNCHER"],"component":{"package":"com.bumble.app","class":"com.bumble.app.ui.launcher.DebugLauncherActivity"},"flags":268435456,"extras":{"option1":"value1","option2":"value2"}}

cc @mykola-mokhnach

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Feb 7, 2020

makes sense. I’ll add the necessary changes

0reactions
mykola-mokhnachcommented, Feb 10, 2020

Cool, thanks for your assistance

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android, Can I use putExtra to pass multiple values
You could pass a 'bundle' of extras rather than individual extras if you like, for example:- Intent intent = new Intent(this, ...
Read more >
Using Intents and Extras to pass data between Activities
Whenever you need data from an activity to be in another activity, you can pass data between then while starting the activities.
Read more >
Android Intents with Chrome - Chrome Developers
This gives you a lot more flexibility in controlling how apps are launched, including the ability to pass extra information into the app...
Read more >
Web Intent - Ionic Native
Send a result back to the Intent that started this Activity. The data can be passed using 'extras'. Returns: Promise<any>. IntentOptions. Param ...
Read more >
Android 13 changelog: A deep dive by Mishaal Rahman
This is everything you need to know about new Android 13 features, its release date ... USB HAL 2.0 with support for limiting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found