Show Notification in System Bar:
Show Notification in System Bar:
:)
#android #delphixe5 #xe5 #fmx
uses
  FMX.Notification;
var
  FNotificationCenter: FMX.Notification.TNotificationCenter;
...
FNotificationCenter := FMX.Notification.TNotificationCenter.Create(Application);
...
procedure TTabbedForm.Button1Click(Sender: TObject);
var
  LNotification: TNotification;
begin
  LNotification := FNotificationCenter.CreateNotification;
  try
    LNotification.Name := 'TestNotification';
    LNotification.AlertBody := 'AlertBody';
    LNotification.AlertAction := 'AlertAction';
    LNotification.Number := 1;
    LNotification.FireDate := IncSecond(Now, 5);
    LNotification.HasAction := False;
    FNotificationCenter.PresentNotification(LNotification);
  finally
    LNotification.Free;
  end;
end;
:)
#android #delphixe5 #xe5 #fmx
Excellent, thanks!
ReplyDeleteDo you maybe know what event needs to be hooked so the program can do something when user clicks on this notification?
To answer myself: FNotificationCenter.OnReceiveLocalNotification
ReplyDeletenice :)
ReplyDeleteSorry, had no time to check....