![]() |
TNotificationCenter: OnReceiveLocalNotification wird nicht ausgelöst
Hallo!
Ich ein Problem mit dem TNotificationCenter in einer iOS-App. Ich weise der OnReceiveLocalNotification eine Objekt-Methode zu, diese wird jedoch weder beim Erscheinen der Notification noch beim Tap darauf ausgelöst.
Delphi-Quellcode:
Hat jemand eine Idee, woran es liegen könnte?
type
TapIOSDeviceNotifications = class constructor Create; destructor Destroy; override; private [...] protected [...] procedure LocalNotificationReceived(Sender: TObject; ANotification: TNotification); public [...] end; implementation constructor TapIOSDeviceNotifications.Create; begin inherited Create; NotificationCenter := TNotificationCenter.Create(nil); NotificationCenter.OnReceiveLocalNotification := LocalNotificationReceived; end; procedure TapIOSDeviceNotifications.LocalNotificationReceived(Sender: TObject; ANotification: TNotification); begin WriteLog(ANotification.Name); end; |
AW: TNotificationCenter: OnReceiveLocalNotification wird nicht ausgelöst
Hi,
du schreibst vom Erscheinen der Notification. Erscheint sie wirklich oder meinst du nur das Auslösen? Da bisher noch niemand geantwortet hat, schreibe ich einfach trotzdem, was mir dazu einfällt. Auf iOS-Geräten muss die App im Hintergrund sein, damit Notifications ausgelöst werden. Die Berechtigung muss gesetzt sein. Das machst du in der IDE unter Projekt -> Optionen -> Versionsinformationen. Dort muss der Schlüssel "FMLocalNotificationPermission" mit dem Wert "true" gefüttert werden. Wenn alles richtig ist, wird die App beim ersten Start eine Benutzerbestätigung für die Berechtigung anfordern. Vielleicht hilfts ja doch :) lg |
AW: TNotificationCenter: OnReceiveLocalNotification wird nicht ausgelöst
Und hier wird auch nur das TNotificationCenter erstellt, aber noch TNotification erstellt und abgeschickt (PresentNotification/ScheduleNotification).
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:41 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz