React native: Disabling quietTime also disables userNotifications

Hi,

I'm experiencing problem when using setUserNotificationsEnabled() and setQuietTimeEnabled(). Both these functions seems to be connected in some way; isUserNotificationsEnabled() and isQuietTimeEnabled() always returns the same value...
For example, when I run setQuietTimeEnabled(false), the userNotifications also gets disabled (and also the other way around).

Is this expected?

Release 1.2.0 together with RN 0.47.

Didn't find what you were looking for?

New post

Comments

8 comments

  • Hi Daniel,

    I'd like to test this on our end, as the two functions shouldn't be connected in that way. Are you seeing this behavior for iOS or Android or both? Could you also confirm which version of the React Native cli you're running?

    Comment actions Permalink
    0
  • Hi Jennifer,

    Yes it is the same problem on both Android and iOS. I have tried it in a new project as well. RN cli 2.0.1.

    Thanks for your quick response!

    Comment actions Permalink
    0
  • Hi Daniel,

    Thanks for providing that information. I'll let you know if I'm able to reproduce this issue soon and what we'll do from there. 

    Comment actions Permalink
    0
  • Hi Jennifer,

    Thanks for your effort! Have you been able to reproduce the problem yet?

    Comment actions Permalink
    0
  • Hi Daniel,

    Could you include the blocks of codes where you're setting these functions for both iOS and Android? I'd just like to seem them in context with the rest of your code.

    Comment actions Permalink
    0
  • Hi,

    Here is a very simple example:

    https://jsfiddle.net/rxb0h5h1/

    Comment actions Permalink
    0
  • Hi Daniel,

    It appears the issue lies in the plugin. The state of setQuietTimeEnabled is based off of whether or not User Notifications are enabled, like so:

    /**
      * Enables or disables quiet time.
      *
      * @param {boolean} enabled true to enable quiet time, false to disable.
      */
      static setQuietTimeEnabled(enabled: boolean) {
      UrbanAirshipModule.setUserNotificationsEnabled(enabled);
     

    }

    This should not be the case, so I am going to escalate this issue to our engineering team. I will let you know when a patch is out for this behavior. Thank you for your patience while I looked into this!

    Comment actions Permalink
    0
  • Hi Daniel,

    I just wanted to let you know that we have fixed the way quiet time works in the React Native Module. You should now be able to enable or disable quiet time without impacting the value of user notifications. You can get the updated plugin at https://github.com/urbanairship/react-native-module.

    Please let me know if you have any questions or concerns.

    Comment actions Permalink
    0

Please sign in to leave a comment.