AppDelegateListener.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include "LifeCycleListener.h"
  3. @protocol AppDelegateListener<LifeCycleListener>
  4. @optional
  5. // these do not have apple defined notifications, so we use our own notifications
  6. // notification will be posted from
  7. // - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
  8. // notification user data is deviceToken
  9. - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSNotification*)notification;
  10. // notification will be posted from
  11. // - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
  12. // notification user data is error
  13. - (void)didFailToRegisterForRemoteNotificationsWithError:(NSNotification*)notification;
  14. // notification will be posted from
  15. // - (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo
  16. // notification user data is userInfo
  17. - (void)didReceiveRemoteNotification:(NSNotification*)notification;
  18. // notification will be posted from
  19. // - (void)application:(UIApplication*)application didReceiveLocalNotification:(UILocalNotification*)notification
  20. // notification user data is notification
  21. - (void)didReceiveLocalNotification:(NSNotification*)notification;
  22. // notification will be posted from
  23. // - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
  24. // notification user data is the NSDictionary containing all the params
  25. - (void)onOpenURL:(NSNotification*)notification;
  26. // these are just hooks to existing notifications
  27. - (void)applicationDidReceiveMemoryWarning:(NSNotification*)notification;
  28. - (void)applicationSignificantTimeChange:(NSNotification*)notification;
  29. - (void)applicationWillChangeStatusBarFrame:(NSNotification*)notification;
  30. - (void)applicationWillChangeStatusBarOrientation:(NSNotification*)notification;
  31. @end
  32. void UnityRegisterAppDelegateListener(id<AppDelegateListener> obj);
  33. void UnityUnregisterAppDelegateListener(id<AppDelegateListener> obj);
  34. extern "C" __attribute__((visibility("default"))) NSString* const kUnityDidRegisterForRemoteNotificationsWithDeviceToken;
  35. extern "C" __attribute__((visibility("default"))) NSString* const kUnityDidFailToRegisterForRemoteNotificationsWithError;
  36. extern "C" __attribute__((visibility("default"))) NSString* const kUnityDidReceiveRemoteNotification;
  37. extern "C" __attribute__((visibility("default"))) NSString* const kUnityDidReceiveLocalNotification;
  38. extern "C" __attribute__((visibility("default"))) NSString* const kUnityOnOpenURL;