|
|
|
@ -449,6 +449,11 @@
|
|
|
|
|
notification.alertBody = notification.alertBody.filterStringForDisplay;
|
|
|
|
|
|
|
|
|
|
DispatchMainThreadSafe(^{
|
|
|
|
|
if (UIApplication.sharedApplication.applicationState == UIApplicationStateActive) {
|
|
|
|
|
DDLogWarn(@"%@ skipping notification; app is in foreground and active.", self.logTag);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Replace any existing notification
|
|
|
|
|
// e.g. when an "Incoming Call" notification gets replaced with a "Missed Call" notification.
|
|
|
|
|
if (self.currentNotifications[identifier]) {
|
|
|
|
@ -477,6 +482,22 @@
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
|
|
|
|
+ (void)presentDebugNotification
|
|
|
|
|
{
|
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
|
|
|
|
|
|
UILocalNotification *notification = [UILocalNotification new];
|
|
|
|
|
notification.category = Signal_Full_New_Message_Category;
|
|
|
|
|
notification.soundName = [OWSSounds filenameForSound:OWSSound_DefaultiOSIncomingRingtone];
|
|
|
|
|
notification.alertBody = @"test";
|
|
|
|
|
|
|
|
|
|
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
- (void)clearAllNotifications
|
|
|
|
|
{
|
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
|