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

@capacitor/browser: browser.addeventlistener throw error #2027

Closed
JEricaM opened this issue Feb 7, 2024 · 4 comments
Closed

@capacitor/browser: browser.addeventlistener throw error #2027

JEricaM opened this issue Feb 7, 2024 · 4 comments

Comments

@JEricaM
Copy link

JEricaM commented Feb 7, 2024

Bug Report

Plugin(s)

@capacitor/browser

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 5.6.0
  @capacitor/core: 5.6.0
  @capacitor/android: 5.6.0
  @capacitor/ios: 5.6.0

Installed Dependencies:

  @capacitor/android: 5.0.5
  @capacitor/cli: 5.6.0
  @capacitor/core: 5.0.5
  @capacitor/ios: 5.0.5

 "@capacitor/browser": "^5.2.0",

Platform(s)

Not platform related

Current Behavior

I've installed the plugin and called the .open function and the site opens well.
I want to add a listener on browserFinished so I wrote this code

    async openPaymentGateway() {
        await Browser.open({ url: 'mysite.it' });
        Browser.addListener('browserFinished', (event) => {
            console.log('Browser has been closed');
        });
    }

but the entire Brower.addlistener code block gives me an error "no overload match this call".
So I cant use this code.
I've already checked the documentation and some videos and I don't see the problem.

Expected Behavior

I expect that the code works as the doc says

Code Reproduction

Install @capacitor/browser
Write this function and you will see the error

    async openPaymentGateway() {
        await Browser.open({ url: 'mysite.it' });
        Browser.addListener('browserFinished', (event) => {
            console.log('Browser has been closed');
        });
    }

@ionitron-bot ionitron-bot bot added the triage label Feb 7, 2024
@JEricaM
Copy link
Author

JEricaM commented Feb 19, 2024

Still stuck here :(

@IT-MikeS
Copy link
Contributor

You may have the same issue outlined here: #2036

@Ionitron
Copy link
Collaborator

It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.

Have a great day!
Ionitron 💙

Copy link

ionitron-bot bot commented Mar 25, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 25, 2024
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

3 participants