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

Repeated notifications problem #8

Open
mschristo opened this issue Jan 17, 2019 · 8 comments
Open

Repeated notifications problem #8

mschristo opened this issue Jan 17, 2019 · 8 comments

Comments

@mschristo
Copy link

Repeated notifications are not working as expected

Your Environment

  • Plugin version: 0.9.2
  • Platform: Android
  • OS version: 8
  • Device manufacturer / model: Pixel XL3
  • Cordova version (cordova -v): 8.0.0
  • Cordova platform version (cordova platform ls): 7.1.2
  • Plugin config: Installed by cli as described on README
  • Ionic Version (if using Ionic) 3

Expected Behavior

Schedule a notification to trigger every time the date time match

Actual Behavior

The notification is triggered in the right time but it shows up multiple times at the same minutes and the app crashes

Steps to Reproduce

I set this:

cordova.plugins.notification.local.schedule({
            title: 'Happy Birthday!!!',
            trigger: { every: { month: 1, day: 17, hour: 12, minute: 20 } }
        });

Context

What were you trying to do?

Debug logs

  • Android: $ adb logcat
01-17 12:20:01.099 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.100 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.150 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.150 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.193 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.193 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.233 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.233 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.268 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.268 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.297 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.297 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.326 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.326 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.354 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.354 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.381 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.381 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.416 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.416 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.442 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.442 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.475 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.475 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.513 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.513 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.560 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.561 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.594 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.595 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.626 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.626 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.653 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.653 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.680 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.681 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.717 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.717 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.727   690   690 E VibratorService: Setting amplitude  to: 3596
01-17 12:20:01.749 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.749 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.775 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.775 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.804 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.804 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.834 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.834 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.860 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.861 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.894 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.894 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.923 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.923 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
01-17 12:20:01.952 29262 29262 W Notification: Use of stream types is deprecated for operations other than volume control
01-17 12:20:01.952 29262 29262 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
@coleweusthem
Copy link

I'm having the same issue, if you find a solution or workaround could you please share?

@robertfriston
Copy link

I also have similar issue, just want a repeating notification 'every day' (at whatever time) - works on IOS but not on Android

@Steffaan
Copy link
Owner

@mschristo @coleweusthem
I'm trying to reproduce this but I can't manage to reproduce it with the given example in this issue.

I used the exact same code as mentioned, only changed the day to the current date and see the following in the adb logs:
image

Notification gets triggered only once (which is correct) and the logs show that the next trigger will be in 2020, which is also correct.

Uninstall your app completely and try a fresh install. This will wipe any notification channels created earlier (from the original plugin). Since this fork supports mulitple channels you can create your own channels, so try to define a channel in your notification too while your at it.

@robertfriston
Could you provide your JS code so I can test it as well? Perhaps I can reproduce the error with your code.

@mschristo
Copy link
Author

Hello @Steffaan,

thank you for your answer but i still having troubles making this works. Can you please share your project that this functions works (i assume it's an example code project). Also i cannot see the "next trigger..." log in my logcat

@Steffaan
Copy link
Owner

@mschristo

Sure, it's an empty cordova project where I added the plugin and your code snippet

https://ufile.io/binhc

(don't forget to change the time of the notification)

@mschristo
Copy link
Author

In your cordova project it's running as expected. But in my ionic project it did not. Here is my project in case you want to take a look:

https://ufile.io/m9zmk

When the notification triggers, it runs multiple times until the app crash. Here is a screenshot of this :
notifications

@gotters
Copy link

gotters commented Feb 10, 2019

In case this helps I have never been able to get "Every" working, not in this fork or the original branch.
I manually create my schedule (ie each scheduled task) and then refresh that schedule as time goes by.
Still even in Android 8 after the first 1 or 2 notifications (across 1 or 2 days) it stops. I am trying it now in this fork to see if works.

@JoueBien
Copy link

Here's the bug report for the same issue from the original source:
https://github.com/Steffaan/cordova-plugin-local-notifications

Before people start going on about setting count - I'll say it again adding count does not work (it doesn't get used when every is present) when you have repeats so stop putting it forward as a solution - IT DOES NOT WORK FOR THAT USE CASE.

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

No branches or pull requests

6 participants