![]() |
[UILocalNotification] Wie auf Inhalt zugreifen ?
Hallo zusammen,
wie kann ich auf den Inhalt einer Variable vom Typ UILocalNotification zugreifen ? |
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Hat diese Klasse/Interface denn keine Property/Methoden?
![]() |
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Zitat:
|
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Zeig doch mal deinen Code.
|
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Delphi-Quellcode:
if Assigned(FNotification) then
begin TUILocalNotification.Init(FNotification, tmpNotificationP); tmpDictionary := TUILocalNotification.Wrap(tmpNotificationP).userInfo; // Access Violation end;
Delphi-Quellcode:
Die Variable FNotification ist vom Typ UILocalNotification.
var
tmpKeyArray: NSArray; tmpNotificationP: Pointer; begin M_1.Lines.Add(RemoteNotifications.DeviceToken); if Assigned(FNotification) then begin TUILocalNotification.Init(FNotification, tmpNotificationP); M_1.Lines.Add('OnLaunchNotification : ' + #13#10 + TUILocalNotification.Wrap(tmpNotificationP).userInfo.description.UTF8String); // Access Violation end; end; Edit 1: Selbst eine einfache Zeile wie diese hier bringt eine Access Violation :
Delphi-Quellcode:
var
UserInfo: NSDictionary; begin if Assigned(FNotification) then begin UserInfo := FNotification.userInfo; end; end; |
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Wenn deine Variable vom Typ UILocalNotification ist, brauchst Du nicht per Init/Wrap deine Variable erneut auf diesen Typen casten.
Du kannst einfach von FNotification die Felder abgreifen |
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Zitat:
|
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Dann ist bei dir was anderes im argen. Wie sieht denn den andere Code aus? Wann wird FNotification gesetzt?
|
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
FNotification wird wie in diesem
![]() |
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Hat niemand eine Idee, warum ich nicht auf den Inhalt von FNotification zugreifen kann ?
|
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Das Beispiel selber läuft aber?
Mangels fehlenden iProduktes und dank überteuerter MobileVersion kann ich's schlecht ausprobieren. |
AW: [UILocalNotification] Wie auf Inhalt zugreifen ?
Das Beispiel funktioniert soweit einwandfrei, aber in dem Beispiel wird nicht auf FNotification zugegriffen. Soweit ich den Quelltext verstehe, ist in FNotification meine Push Nachricht drin, wenn die Anwendung über eine eingehende Push Notification gestartet wird. Läuft die Anwendung im Hintergund, kann ich auf den Inhalt der Push Notification über das Event OnReceive zugreifen.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:21 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