title: How to add a notification title when the iPhone is locked Like WhatsApp?
body: <p>I am implementing push notifications, which I turn into local notifications in my iOS application.</p>
  <p>When the iPhone is <strong>locked</strong> (Face ID / Touch ID) I see <strong>only</strong> the notification body which is &quot;Notification&quot; by default.</p>
  <p>When the iPhone is <strong>unlocked</strong> (Face ID / Touch ID) I see the whole notification content.</p>
  <p>I have tried to change the alert title to a hardcoded text.
  Also tried to change the other properties, but I did not manage to solve it out.</p>
  <p>This is how I create the local notification:</p>
  <pre class="lang-c prettyprint-override"><code>    UILocalNotification *notification = [[UILocalNotification alloc] init];
      notification.userInfo = dictionary;
      [notification setAlertTitle:@&quot;alertTitle&quot;];
      [notification setAlertBody:@&quot;alertBody&quot;];
      
      [notification setFireDate:[NSDate date]];
      [notification setTimeZone:[NSTimeZone  defaultTimeZone]];
     
      [[UIApplication sharedApplication] presentLocalNotificationNow:notification];
  </code></pre>
  <p>What I want is - to show the title of the notification despite the locked state of the device, just like WhatsApp does.</p>
  <h3>Unlocked state</h3>
  <p><a href="https://i.stack.imgur.com/8xn8q.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8xn8q.jpg" alt="Unlocked" /></a></p>
  <h3>Locked state</h3>
  <p><a href="https://i.imgur.com/4WbNOMe.jpg" rel="nofollow noreferrer"><img src="https://i.imgur.com/4WbNOMe.jpg" alt="Locked" /></a></p>
  <p>As you can see, with the same settings - WhatsApp does show the title even though the iPhone is locked.</p>