App给自己推送消息

时间:2021-06-08 17:08:17   收藏:0   阅读:25
procedure TMainDataModule.SendNotification(const ATitle, AAlertBody, AData: string);
var
   mNotice: TNotification;
begin
  if NotificationCenter1.Supported then
  begin
    mNotice := NotificationCenter1.CreateNotification;
    try
      mNotice.Name := kbmMWGlobal.kbmMWGenerateGUID;
      mNotice.Title := ATitle;
      mNotice.AlertBody := AAlertBody;
      mNotice.HasAction:=True;
      mNotice.AlertAction:=AData;
      // 通知
      NotificationCenter1.PresentNotification(mNotice);
    finally
      mNotice.DisposeOf;
    end;
  end;
end;

 

原文:https://www.cnblogs.com/kinglandsoft/p/14862210.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!