AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Cross-Platform-Entwicklung iOS TNotificationCenter: OnReceiveLocalNotification wird nicht ausgelöst
Thema durchsuchen
Ansicht
Themen-Optionen

TNotificationCenter: OnReceiveLocalNotification wird nicht ausgelöst

Ein Thema von uups · begonnen am 5. Okt 2018 · letzter Beitrag vom 3. Feb 2022
Antwort Antwort
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
knaeuel

Registriert seit: 2. Jul 2007
110 Beiträge
 
Delphi 10.3 Rio
 
#2

AW: TNotificationCenter: OnReceiveLocalNotification wird nicht ausgelöst

  Alt 8. Okt 2018, 13:57
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
Wolfgang
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu
Online

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.140 Beiträge
 
Delphi 12 Athens
 
#3

AW: TNotificationCenter: OnReceiveLocalNotification wird nicht ausgelöst

  Alt 3. Feb 2022, 16:06
Und hier wird auch nur das TNotificationCenter erstellt, aber noch TNotification erstellt und abgeschickt (PresentNotification/ScheduleNotification).
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:46 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz