swipeToClose error

The code looks like this:
(swipeToClose is commented out in this example but I get the same error with or without it)

  appInfo.notification = app.notification.create({
      icon: '<img src="img/icon.png">',
      title: 'TestTube',
      titleRightText: 'now',
      subtitle: txtTitle,
      text: txtMsg,
      closeTimeout: nTimeout,
      closeOnClick: true,
      // swipeToClose: true,
      on: {
        close: function () {
            // app.dialog.alert('Notification closed');
            appInfo.notification.destroy();
          },
      },
    }).open();

The error looks like this:

TypeError: undefined is not an object (evaluating 'notification.params.swipeToClose') URL: file:///var/containers/Bundle/Application/FFFFF886-69BC-4849-9B58/TestTube.app/www/js/framework7.bundle.js Line: 36686 Column: 32 Error object: {"line":36686,"column":32,"sourceURL":"file:///var/containers/Bundle/Application/FFFFF886-69BC-4849/TestTube.app/www/js/framework7.bundle.js"}

The docs say the parameter is “swipeToClose” but there’s no example and, like I said, it produces the error with or without that parameter.

Change close to closed event and add minimal timeout:

appInfo.notification = app.notification.create({
  icon: '<img src="img/icon.png">',
  title: 'TestTube',
  titleRightText: 'now',
  subtitle: txtTitle,
  text: txtMsg,
  closeTimeout: nTimeout,
  closeOnClick: true,
  // swipeToClose: true,
  on: {
    closed: function () {
        setTimeout(() => {
          appInfo.notification.destroy();
        });
      },
  },
}).open();

Good catch! Worked in the browswer, I’ll do another build later today and test it in the app. Thanks!