My iOS application is configured to accept PUSH.
When I accept "my" PUSH intended for my application, everything works fine, my behavior logic works.
When my application is open, when I click on “foreign” (for other applications) PUSH, my application closes abnormally.
Tell me, what am I doing wrong?
procedure TFmMain.FormCreate(Sender: TObject);
begin
...
TMessageManager.DefaultManager.SubscribeToMessage(TPushRemoteNotificationMessage, PushRemoteNotificationMessageHandler);
PUSHMessage := '';
...
end;
Procedure TFmMain.PushRemoteNotificationMessageHandler(const Sender: TObject; const AMessage: TMessage);
Begin
If AMessage Is TPushRemoteNotificationMessage Then
Begin
PUSHMessage := TPushRemoteNotificationMessage(AMessage).Value.Notification;
End;
end;
The form contains TNotificationCenter;
procedure TFmMain.NotificationCenter1ReceiveLocalNotification(Sender: TObject; ANotification: TNotification);
begin
// Some actions
end;
How can I process only “my own” PUSH and ignore “others”?
Even if NotificationCenter1ReceiveLocalNotification(Sender: TObject; ANotification: TNotification) is empty,
When I click on "Aliens" PUSH, my application crashes!