Einzelnen Beitrag anzeigen

uups

Registriert seit: 23. Aug 2004
68 Beiträge
 
#1

TNotificationCenter: OnReceiveLocalNotification wird nicht ausgelöst

  Alt 5. Okt 2018, 18:01
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:
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;
Hat jemand eine Idee, woran es liegen könnte?

Geändert von uups ( 6. Okt 2018 um 16:51 Uhr)
  Mit Zitat antworten Zitat