About Quiet Time

Quiet time is the ability to stop delivery of Push Notification alerts and sounds (badges are still delivered) during a specified time window.

Quiet Time is app-specific. If you want to set a mute notifications on a device globally, you can use iOS and Android's Do Not Disturb feature. On Android this is accessed by navigating to Settings > Sound & Notification > Do Not Disturb. On iOS this is accessed by navigating to Settings > Do Not Disturb.

Quiet time on iOS

On iOS this requires the client application to post the desired Quiet time window back to Urban Airship. Below is the sample Quiet Time app code for iOS:

// Set the quiet time from 7:30pm - 7:30am
[[UAirship push] setQuietTimeStartHour:19 startMinute:30 endHour:7 endMinute:30];

// Enable quiet time
[UAirship push].quietTimeEnabled = YES;

// Update registration
[[UAirship push] updateRegistration];

Quiet time on Android

Only quiets push notification related sounds and prevents the phone from vibrating during the set time frame. The push notification will still go through during Quiet time. Below is the sample Quiet Time app code for Android:

// Set the quiet time from 7:30pm - 7:30am
SimpleDateFormat formatter = new SimpleDateFormat("hh:mm", Locale.US);
Date startDate = formatter.parse("19:30");
Date endDate = formatter.parse("07:30");

UAirship.shared().getPushManager().setQuietTimeInterval(startDate,endDate);

// Enable quiet time
UAirship.shared().getPushManager().setQuietTimeEnabled(true);

 

Related Content: