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

window.plugins.toast.showWithOptions is not working #137

Open
iamAbdulAhad3481 opened this issue Feb 26, 2021 · 0 comments
Open

window.plugins.toast.showWithOptions is not working #137

iamAbdulAhad3481 opened this issue Feb 26, 2021 · 0 comments

Comments

@iamAbdulAhad3481
Copy link

I have build a cordova (9.0.0) app with react with two platforms
android 8.1.0
ios 5.1.1
I am using this app to show toast notification in app and I have installed it through npm and cordova cli.
Now toast is working with window.plugins.toast.showLongCenter() and related methods but
Not working with window.plugins.toast.showWithOptions

Here is my code

`  useEffect(() => {
    console.log('Called')
    // window.plugins.toast.showLongCenter('Hello there!', (success) => {
    //   console.log('toast success: ' + success)
    // }, (error) => {
    //   console('toast error: ' + error)
    // })
    
    showToast();
  }, [location.pathname]);

  const showToast = () => {
    window.plugins.toast.showWithOptions(
      {
        message: 'Hey, there',
        duration: "long",
        positon: 'bottom',
        addPixelsY: -40
      },
      (args) => console.log('Success', args),
      (error) => {
        console.debug(error);
        console.log('Error', error)
      },
    )
  }`

Please have a look maybe anything

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

1 participant