Overloading a method in FMX.Platform.iOS

  

within FMX.Platform.iOS this method is added to the App delegate

class_addMethod(appDelegateClass, sel_getUid(‘application:didReceiveLocalNotification:’),
@applicationDidReceiveLocalNotification, ‘v@:@@’);

And its procedure is :

procedure applicationDidReceiveLocalNotification(self: id; _cmd: SEL; application: PUIApplication;
notification: Pointer); cdecl;

begin
PlatformCocoa.FAppDelegate.application(TUIApplication.Wrap(application), TUILocalNotification.Wrap(notification));
end;

I want to overload this method in my main unit, but it only works if I remove the declaration of it from FMX.Platform.iOS

In my main unit I add the Method as follows:

class_addMethod(objc_getClass(‘DelphiAppDelegate’), sel_getUid(‘application:didReceiveLocalNotification:’),
@applicationDidReceiveLocalNotification, ‘v@:@@’);

And my procedure:

procedure applicationDidReceiveLocalNotification(self: id; _cmd: SEL;
application: PUIApplication; notification: Pointer);
begin
ShowMessage(‘it works’);
end;

I want to try and Keep out of the FMX.Platform.iOS source as much as I can, is there a way to tell the compiler to use my applicationDidReceiveLocalNotification and not the one in the source?

Comments are closed.