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

Web intent: passing extras #1959

Closed
danilopolani opened this issue Sep 12, 2017 · 2 comments
Closed

Web intent: passing extras #1959

danilopolani opened this issue Sep 12, 2017 · 2 comments

Comments

@danilopolani
Copy link

I'm submitting a ...
[x] bug report
[ ] feature request

Current behavior:
The Web Intent package doesn't allow extras.

Expected behavior:
Passing extra parameters to startActivity method.

Other information:

My goal is to create a "native share", like the example from the Android documentation:

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);

As we can see, there's an action, an extra (EXTRA_TEXT) and a type. This can be achieved from the cordova plugin with something like this (from the README of the repo):

window.plugins.intentShim.startActivity({
    action: 'android.intent.action.SEND',
    extras: {
        'android.intent.extra.TEXT': 'My text here'
    }
});

Now, looking at the declaration of the startActivity method from ionic native package we can see that the url is required (why?) and there's no way to define extras.

startActivity(options: {
        action: any;
        url: string;
        type?: string;
    })

The only method which has an extras field is sendBroadcast, but I think it's a little weird:

sendBroadcast(options: {
    action: string;
    extras?: {
       option: boolean;
    };
})

option: boolean? What? And all the "convenience constants" like ACTION_SEND and EXTRA_TEXT are declareted but not filled (but maybe they are somewhere else).

I know it's marked as "Beta", but I think it hasn't the basic functionalities. Should I use the cordova plugin "without" the ionic native part?

@ajeet0725
Copy link

Hi,
i want to pass options like bellow please help me

var pidOption = " <PidOptions ver="1.0"> <Opts fCount="1" fType="0" iCount="0" pCount="0" format="0" pidVer="2.0" timeout="10000" posh="UNKNOWN" env="P" /> <Param name="mantrakey" value="" /> ";
var options = {
action: 'in.gov.uidai.rdservice.fp.CAPTURE',//in.gov.uidai.rdservice.fp.CAPTURE"
EXTRA_TEXT:pidOption
};

@ajeet0725 ajeet0725 mentioned this issue Sep 25, 2020
@JuanFCVal
Copy link

5 years later and we got no answers... 😢

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

3 participants