Macapi.Notifications
v1.0.0
جسر إشعارات macOS المبسط لـ Delphi #DelphiCocoaFlavored
ليلي ستيلسون // 2020
من المفترض أن تعمل هذه الوحدة مع RAD Studio 10.4. لن يعمل في الإصدارات الأقدم بسبب خطأ في Macapi.Foundation. إذا لم يتم توقيع تطبيقك باستخدام شهادة مطور Apple، فبدءًا من نظام التشغيل 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 ;