Reputation: 1368
When i create a Notification for mac OSX. I can set the (unique)name of the notication, but the Title doesn't change. It just shows the name of the application.
procedure TPWTrayIcon.MacNotification(pTitle, pMessage: string);
var
Note : TNOtification;
NoteCenter : TNotificationCenter;
begin
NoteCenter:=TNotificationCenter.Create(nil);
try
note := NoteCenter.CreateNotification(pTitle,pMessage,Now+EncodeTime(0,0,1,0));
try
note.AlertAction := 'Alert';
// note.name := pTitle;
// note.AlertBody := pMessage;
// note.FireDate := Now + EncodeTime(0, 0, 1, 0);
NoteCenter.ScheduleNotification(note);
finally
note.DisposeOf;
end
finally
NoteCenter.Free;
end;
Upvotes: 0
Views: 191
Reputation: 72676
As you noticed the name of the notification is the application name and there is no way to change it through the current API. Anyway since it gets the application name you could try as a Workaround(a sort of hack) to change the application name at runtime as needed.
If changing the application name in FMX is not possible it I'm afraid that there is no way at the moment to change the Title of the notification.
However the notification Title in Mac OS X is ever the application name that have pushed it,so I think is in this way defined in the Mac OS X spec.
Upvotes: 0