Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

IONIC 5 with Capacitor facing to launch another app and get callback using startActivityForResult #134

Open
veeravetrivel opened this issue Oct 20, 2021 · 5 comments

Comments

@veeravetrivel
Copy link

veeravetrivel commented Oct 20, 2021

I am using Ionic Angular with capacitor, we need to launch an external application which is our dependent application (Nativescript). With the ID of the app I need to launch and get callback once get image data. How to achieve this using Intent?
Getting error block log in console
` const options = {
action: this.webIntent.ACTION_GET_CONTENT,
package: 'de.myapp.eco' /*App package id in store installed in device */
}

this.webIntent.startActivityForResult(options).then((onSuccess) => {
  console.log('onSuccess',onSuccess)
}).catch((error: any) => console.log('error',error));`

Can you please guide me out to achieve the result?

@darryncampbell @mcelotti @mattdsteele

@darryncampbell
Copy link
Owner

To invoke another application directly you can specify the component, please see https://github.com/darryncampbell/plugin-intent-api-exerciser/blob/master/www/js/index.js#L233 for an example

@veeravetrivel
Copy link
Author

Thank you @darryncampbell , It works.

It opens the external application, But it closes of the source application. Any Idea how to make it without closing source application?

@darryncampbell
Copy link
Owner

it should just be invoking start activity, are you saying the calling app is being finish()'d?

@veeravetrivel
Copy link
Author

Yes @darryncampbell for example 'A' app calls 'B' app, In this cased 'B' is opened but 'A' is closed. What I want is that 'A' app should be opened after B is closed. Hope you got it? How to achieve this using startActivityForResult?

@darryncampbell
Copy link
Owner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants