notify when receiving voip before first unlock

// FREEBIE
This commit is contained in:
Michael Kirk 2018-06-04 12:00:45 -06:00
parent c1afbcca46
commit cd298c72c3
2 changed files with 18 additions and 0 deletions

View File

@ -231,6 +231,21 @@ static NSTimeInterval launchStartedAt;
if (![OWSPrimaryStorage isDatabasePasswordAccessible]) {
DDLogInfo(
@"%@ exiting because we are in the background and the database password is not accessible.", self.logTag);
UILocalNotification *notification = [UILocalNotification new];
NSString *messageFormat = NSLocalizedString(@"NOTIFICATION_BODY_PHONE_LOCKED_FORMAT",
@"Lock screen notification text presented after user powers on their device without unlocking. Embeds "
@"{{device model}} (either 'iPad' or 'iPhone')");
notification.alertBody = [NSString stringWithFormat:messageFormat, UIDevice.currentDevice.localizedModel];
// Make sure we clear any existing notifications so that they don't start stacking up
// if the user receives multiple pushes.
[UIApplication.sharedApplication cancelAllLocalNotifications];
[UIApplication.sharedApplication setApplicationIconBadgeNumber:0];
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
[UIApplication.sharedApplication setApplicationIconBadgeNumber:1];
[DDLog flushLog];
exit(0);
}

View File

@ -1345,6 +1345,9 @@
/* Label for a button that lets users search for contacts by phone number */
"NO_CONTACTS_SEARCH_BY_PHONE_NUMBER" = "Find Contacts by Phone Number";
/* Lock screen notification text presented after user powers on their device without unlocking. Embeds {{device model}} (either 'iPad' or 'iPhone') */
"NOTIFICATION_BODY_PHONE_LOCKED_FORMAT" = "You must unlock your %@ once after restarting to receive Signal messages.";
/* No comment provided by engineer. */
"NOTIFICATION_SEND_FAILED" = "Your message failed to send to %@.";