I immediately noticed that I forgot to add the documentation for the new functions. So here is the sneak peek of the documentation for these functions:
void dmExtension::RegisteriOSUIApplicationDelegate(void* delegate);
void dmExtension::UnregisteriOSUIApplicationDelegate(void* delegate);
And, how to use them:
// myextension_ios.mm
id<UIApplicationDelegate> g_MyApplicationDelegate;
@interface MyApplicationDelegate : NSObject <UIApplicationDelegate>
- (void) applicationDidBecomeActive:(UIApplication *) application;
@end
@implementation MyApplicationDelegate
- (void) applicationDidBecomeActive:(UIApplication *) application {
dmLogWarning("applicationDidBecomeActive - MyAppDelegate");
}
@end
// Invoked from myextension.cpp in ExtensionAppInitialize
void ExtensionAppInitializeiOS(dmExtension::AppParams* params)
{
g_MyApplicationDelegate = [[MyApplicationDelegate alloc] init];
dmExtension::RegisteriOSUIApplicationDelegate(g_MyApplicationDelegate);
}
// Invoked from myextension.cpp in ExtensionAppFinalize
void ExtensionAppFinalizeiOS(dmExtension::AppParams* params)
{
dmExtension::UnregisteriOSUIApplicationDelegate(g_MyApplicationDelegate);
[g_MyApplicationDelegate release];
g_MyApplicationDelegate = 0;
}