Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   iOS XE6: Push Notifications - Schwerer Debugger-Fehler (https://www.delphipraxis.net/180135-xe6-push-notifications-schwerer-debugger-fehler.html)

Crocotronic 25. Apr 2014 01:50

XE6: Push Notifications - Schwerer Debugger-Fehler
 
Hallo zusammen,
ich wollte meine App gerade Push-Notification-Fähig machen, bekomme das aber aufgrund meiner Architektur nicht gebacken :pale:
Hier erstmak der Aufbau meines Projekts:
Quelltext:
Delphi-Quellcode:
var Controller: Interfaces.Controller.GUI.IAppController;
begin
  Controller:= TAppController.Create;

  {$IFDEF IOS}
  TF_MainIOS.OnCreateGUI:= procedure(const AGUI: IAppGUI)
   begin
    Controller.RegisterGUI(AGUI);
   end;
  {$ENDIF}

  {$IFDEF ANDROID}
  TF_MainAnd.OnCreateGUI:= procedure(const AGUI: IAppGUI)
   begin
    Controller.RegisterGUI(AGUI);
   end;
  {$ENDIF}

  {$IFDEF MSWINDOWS}
  TF_MainFMX.OnCreateGUI:= procedure(const AGUI: IAppGUI)
   begin
    Controller.RegisterGUI(AGUI);
   end;
  {$ENDIF}

  Application.Initialize;
  {$IFDEF IOS}
  Application.CreateForm(TF_MainiOS, F_MainiOS);
  {$ENDIF}
  {$IFDEF ANDROID}
  Application.CreateForm(TF_MainAnd, F_MainAnd);
  {$ENDIF}
  {$IFDEF MSWINDOWS}
  Application.CreateForm(TF_MainFMX, F_MainFMX);
  {$ENDIF}
  Application.Run;
Formular:
Delphi-Quellcode:
type
  TF_MainFMX = class(TForm)
  private
   {...} 
   type
     TOnCreateGUI = reference to procedure(const AGUI: IAppGUI);
   class var
     FOnCreateGUI: TOnCreateGUI;
  public
    class property OnCreateGUI: TOnCreateGUI read FOnCreateGUI write FOnCreateGUI;
  end;

procedure TF_MainFMX.FormCreate(Sender: TObject);
begin
 if Assigned(FOnCreateGUI) then
  FOnCreateGUI(Self);
 {...}
end;
(Siehe auch hier)
So, jetzt beendet Delphi das Debugging noch bevor die App überhaupt aufgerufen wurde (Schwerer Debugger-Fehler: Gerät antwortet nicht mehr).
Starte ich die App dann im Nachhinein, bleibt nur der Splash Screen eine Weile sichtbar und stürzt dann ab.
Die ganze Push-Notification-Sache funktioniert gekapselt in einem Testprojekt (abgeguckt von Sarina)

Vermutlich stimmt hier was am Ablauf nicht so ganz, weshalb wahrscheinlich noch etwas an der Architektur gefeilt werden muss.
Irgendwelche Ideen?

Viele Grüße
Croco

moe120 27. Mai 2014 09:46

AW: XE6: Push Notifications - Schwerer Debugger-Fehler
 
dass die App beim nicht-debugging Start abschmiert hab ich auch ständig, probier mal während des Splash-Screens (bei mir so nach 5-10 Sekunden) die Home Taste zu drücken. Bei mir geht die App dann in den Hintergrund, dann kommt sie automatisch wieder vor und läuft.

Keine Ahnung was Embarcadero da gemacht hat, die 15 Sekunden für den App-Start bis zum Crash sind noch vor der ersten Zeile im OnCreate.


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:52 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