zo0r / react-native-push-notification

React Native Local and Remote Notifications
MIT License
6.75k stars 2.05k forks source link

PushNotification.localNotification Ignoring paramaters #2311

Closed K9Developer closed 11 months ago

K9Developer commented 2 years ago

Question

Hi there!

I'm trying to create a push notification that will vibrate according to a specific pattern and if not possible, then for longer. but when I put the options:

vibrate: true,

vibration: 1000

it only vibrates for a little bit... even if I put vibrate: false it still vibrates.

I'm also trying to create a sound but that doesnt work too (neither the default one).

That's the code:

// Create a channel
PushNotification.createChannel(
        {
          channelId: "done-notif",
          channelName: "Done Notification",
          channelDescription: "Channel that categorizes done notifications",
          importance: Importance.HIGH,
        },
        (created) => console.log(`createChannel returned '${created}'`) // (optional) callback returns whether the channel was created, false means it already existed.
      );

// Show notification
PushNotification.localNotification({
        channelId: "done-notif",
        bigText: "Your operation is done! we successfully inflated/deflated your tire to " + wantedPsi,
        subText: "Done with operation",
        bigLargeIcon: "ic_launcher",
        color: "#4bab52",
        playSound: true,
        soundName: "long_beep.mp3",
        vibrate: true,
        vibration: 5000,
        visibility: "public",
        ignoreInForeground: false,
        title: "DONE OnAir",
        message: "We have inflated/deflated your tire",
      });

What am I doing wrong?

ashishmangukiya commented 2 years ago

I am facing the same issue, please let me know if you get the solution.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.