How to add a notification title when the iPhone is locked Like WhatsApp?How can I develop for iPhone using a Windows development machine?How can I make a UITextField move up when the keyboard is present - on starting to edit?How to “add existing frameworks” in Xcode 4?How do you trigger a block after a delay, like -performSelector:withObject:afterDelay:?Is there any built-in protection from creating identical Local Notifications?UILocalNotification not firing properly on iPhone when app not foregroundedLocal notification won't stop sending until I opened the appXcode “Device Locked” When iPhone is unlockedHow to configure local notification for the Apple WatchiOS8 interactive UILocaNotification- how to hide alertAction from alert options
Does squid ink pasta bleed?
Is this one of the engines from the 9/11 aircraft?
Going to get married soon, should I do it on Dec 31 or Jan 1?
Has there been any indication at all that further negotiation between the UK and EU is possible?
Why do some professors with PhDs leave their professorships to teach high school?
Can ADFS connect to other SSO services?
Employer wants to use my work email account after I quit
Can the negators "jamais, rien, personne, plus, ni, aucun" be used in a single sentence?
First-year PhD giving a talk among well-established researchers in the field
Should I hide continue button until tasks are completed?
Do flight schools typically have dress codes or expectations?
Hand soldering SMD 1206 components
What happens when your group is victim of a surprise attack but you can't be surprised?
How to reply to small talk/random facts in a non-offensive way?
STM Microcontroller burns every time
How to / is it possible to straighten a bent seatstay/chainstay on a steel frame? At home or inexpensively by a professional
Brick or set ID for part?
Was there ever a name for the weapons of the Others?
Is it damaging to turn off a small fridge for two days every week?
Are there any efficient algorithms to solve the longest path problem in networks with cycles?
Require advice on power conservation for backpacking trip
Are Finite Automata Turing Complete?
What is the legal status of travelling with (unprescribed) methadone in your carry-on?
How to split an equation over two lines?
How to add a notification title when the iPhone is locked Like WhatsApp?
How can I develop for iPhone using a Windows development machine?How can I make a UITextField move up when the keyboard is present - on starting to edit?How to “add existing frameworks” in Xcode 4?How do you trigger a block after a delay, like -performSelector:withObject:afterDelay:?Is there any built-in protection from creating identical Local Notifications?UILocalNotification not firing properly on iPhone when app not foregroundedLocal notification won't stop sending until I opened the appXcode “Device Locked” When iPhone is unlockedHow to configure local notification for the Apple WatchiOS8 interactive UILocaNotification- how to hide alertAction from alert options
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am implementing push notifications, which I turn into local notifications in my iOS application.
When the iPhone is locked (Face ID / Touch ID) I see only the notification body which is "Notification" by default.
When the iPhone is unlocked (Face ID / Touch ID) I see the whole notification content.
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.
This is how I create the local notification:
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.userInfo = dictionary;
[notification setAlertTitle:@"alertTitle"];
[notification setAlertBody:@"alertBody"];
[notification setFireDate:[NSDate date]];
[notification setTimeZone:[NSTimeZone defaultTimeZone]];
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
What I want is - to show the title of the notification despite the locked state of the device, just like WhatsApp does.
Unlocked state

Locked state

As you can see, with the same settings - WhatsApp does show the title even though the iPhone is locked.
ios objective-c iphone xcode uilocalnotification
add a comment |
I am implementing push notifications, which I turn into local notifications in my iOS application.
When the iPhone is locked (Face ID / Touch ID) I see only the notification body which is "Notification" by default.
When the iPhone is unlocked (Face ID / Touch ID) I see the whole notification content.
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.
This is how I create the local notification:
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.userInfo = dictionary;
[notification setAlertTitle:@"alertTitle"];
[notification setAlertBody:@"alertBody"];
[notification setFireDate:[NSDate date]];
[notification setTimeZone:[NSTimeZone defaultTimeZone]];
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
What I want is - to show the title of the notification despite the locked state of the device, just like WhatsApp does.
Unlocked state

Locked state

As you can see, with the same settings - WhatsApp does show the title even though the iPhone is locked.
ios objective-c iphone xcode uilocalnotification
add a comment |
I am implementing push notifications, which I turn into local notifications in my iOS application.
When the iPhone is locked (Face ID / Touch ID) I see only the notification body which is "Notification" by default.
When the iPhone is unlocked (Face ID / Touch ID) I see the whole notification content.
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.
This is how I create the local notification:
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.userInfo = dictionary;
[notification setAlertTitle:@"alertTitle"];
[notification setAlertBody:@"alertBody"];
[notification setFireDate:[NSDate date]];
[notification setTimeZone:[NSTimeZone defaultTimeZone]];
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
What I want is - to show the title of the notification despite the locked state of the device, just like WhatsApp does.
Unlocked state

Locked state

As you can see, with the same settings - WhatsApp does show the title even though the iPhone is locked.
ios objective-c iphone xcode uilocalnotification
I am implementing push notifications, which I turn into local notifications in my iOS application.
When the iPhone is locked (Face ID / Touch ID) I see only the notification body which is "Notification" by default.
When the iPhone is unlocked (Face ID / Touch ID) I see the whole notification content.
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.
This is how I create the local notification:
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.userInfo = dictionary;
[notification setAlertTitle:@"alertTitle"];
[notification setAlertBody:@"alertBody"];
[notification setFireDate:[NSDate date]];
[notification setTimeZone:[NSTimeZone defaultTimeZone]];
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
What I want is - to show the title of the notification despite the locked state of the device, just like WhatsApp does.
Unlocked state

Locked state

As you can see, with the same settings - WhatsApp does show the title even though the iPhone is locked.
ios objective-c iphone xcode uilocalnotification
ios objective-c iphone xcode uilocalnotification
edited Apr 1 at 15:47
Joseph Razon IL
asked Mar 25 at 9:39
Joseph Razon ILJoseph Razon IL
469 bronze badges
469 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I believe you let the user set this for each app. Go to system settings > Your app > Notifications > Show Previews > Always.
Note that you also have a default setting you can change that affects all apps you haven't explicitly configured. Go to system settings > Notifications > Show Previews to change that.

Thank you but this is not the wanted outcome. I don't want to show the whole message, just to add a title to the notifications when the iPhone is locked.
– Joseph Razon IL
Mar 25 at 13:03
add a comment |
UILocalNotification is deprecated. You should use the UserNotifications framework instead.
The notification content is managed by the UNNotificationContent user which has a subtitle property in addition to the title and body properties. I'm pretty sure the subtitle property is the one that shows when the phone is locked.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55334903%2fhow-to-add-a-notification-title-when-the-iphone-is-locked-like-whatsapp%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I believe you let the user set this for each app. Go to system settings > Your app > Notifications > Show Previews > Always.
Note that you also have a default setting you can change that affects all apps you haven't explicitly configured. Go to system settings > Notifications > Show Previews to change that.

Thank you but this is not the wanted outcome. I don't want to show the whole message, just to add a title to the notifications when the iPhone is locked.
– Joseph Razon IL
Mar 25 at 13:03
add a comment |
I believe you let the user set this for each app. Go to system settings > Your app > Notifications > Show Previews > Always.
Note that you also have a default setting you can change that affects all apps you haven't explicitly configured. Go to system settings > Notifications > Show Previews to change that.

Thank you but this is not the wanted outcome. I don't want to show the whole message, just to add a title to the notifications when the iPhone is locked.
– Joseph Razon IL
Mar 25 at 13:03
add a comment |
I believe you let the user set this for each app. Go to system settings > Your app > Notifications > Show Previews > Always.
Note that you also have a default setting you can change that affects all apps you haven't explicitly configured. Go to system settings > Notifications > Show Previews to change that.

I believe you let the user set this for each app. Go to system settings > Your app > Notifications > Show Previews > Always.
Note that you also have a default setting you can change that affects all apps you haven't explicitly configured. Go to system settings > Notifications > Show Previews to change that.

answered Mar 25 at 12:23
LGPLGP
2,7591 gold badge10 silver badges23 bronze badges
2,7591 gold badge10 silver badges23 bronze badges
Thank you but this is not the wanted outcome. I don't want to show the whole message, just to add a title to the notifications when the iPhone is locked.
– Joseph Razon IL
Mar 25 at 13:03
add a comment |
Thank you but this is not the wanted outcome. I don't want to show the whole message, just to add a title to the notifications when the iPhone is locked.
– Joseph Razon IL
Mar 25 at 13:03
Thank you but this is not the wanted outcome. I don't want to show the whole message, just to add a title to the notifications when the iPhone is locked.
– Joseph Razon IL
Mar 25 at 13:03
Thank you but this is not the wanted outcome. I don't want to show the whole message, just to add a title to the notifications when the iPhone is locked.
– Joseph Razon IL
Mar 25 at 13:03
add a comment |
UILocalNotification is deprecated. You should use the UserNotifications framework instead.
The notification content is managed by the UNNotificationContent user which has a subtitle property in addition to the title and body properties. I'm pretty sure the subtitle property is the one that shows when the phone is locked.
add a comment |
UILocalNotification is deprecated. You should use the UserNotifications framework instead.
The notification content is managed by the UNNotificationContent user which has a subtitle property in addition to the title and body properties. I'm pretty sure the subtitle property is the one that shows when the phone is locked.
add a comment |
UILocalNotification is deprecated. You should use the UserNotifications framework instead.
The notification content is managed by the UNNotificationContent user which has a subtitle property in addition to the title and body properties. I'm pretty sure the subtitle property is the one that shows when the phone is locked.
UILocalNotification is deprecated. You should use the UserNotifications framework instead.
The notification content is managed by the UNNotificationContent user which has a subtitle property in addition to the title and body properties. I'm pretty sure the subtitle property is the one that shows when the phone is locked.
answered Apr 1 at 16:11
EmilioPelaezEmilioPelaez
9,7783 gold badges25 silver badges36 bronze badges
9,7783 gold badges25 silver badges36 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55334903%2fhow-to-add-a-notification-title-when-the-iphone-is-locked-like-whatsapp%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown