Macapi.Notifications
v1.0.0
สะพานการแจ้งเตือน macOS แบบง่ายสำหรับ Delphi #DelphiCocoaFlavored
ลิลี่ สติลสัน // 2020
หน่วยนี้ออกแบบมาเพื่อทำงานร่วมกับ RAD Studio 10.4 มันจะใช้งานไม่ได้ในเวอร์ชันเก่าเนื่องจากข้อผิดพลาดใน Macapi.Foundation หากแอปของคุณไม่ได้ลงนามด้วย Apple Developer Certificate หน่วยนี้จะใช้งานได้ตั้งแต่ macOS 10.15 เป็นต้นไป แต่จะไม่เรียกการแจ้งเตือนใดๆ เนื่องจากข้อจำกัดในระบบปฏิบัติการ
กำหนดเวลาการแจ้งเตือนที่ง่ายขึ้น แจ้งเตือนการยิงในเวลาที่กำหนด
procedure ScheduleNotification ( const ATitle, ASubtitile, AInformation: String;
const ADeliveryDate: TDateTime;
const UseTimeZone: boolean = True);
การนำเสนอการแจ้งเตือนที่ง่ายขึ้น แจ้งเตือนทันที
procedure PresentNotification ( const ATitle, ASubtitile, AInformation: String);
// SceduleNotification // Form contains TButton.
procedure TNSNotificationsTestForm.SceduleNotificationButtonClick (Sender: TObject);
begin
SceduleNotification( ' Notification Title ' , ' Foo Bar ' , ' Very Informative. Such Notification! ' ,
Now + EncodeTime( 0 , 0 , 5 , 0 ));
end ;
// NSSavePanel // Form contains TButton and TEdit
procedure TNSNotificationsTestForm.PresentNotificationButtonClick (Sender: TObject);
begin
PresentNotification( ' Notification Title ' , ' Foo Bar ' , ' Very Informative. Such Notification! ' );
end ;