Skip to content

Commit

Permalink
[TIMOB-24266] Expose UIApplicationDelegate to modules / Hyperloop (#9761
Browse files Browse the repository at this point in the history
)
  • Loading branch information
hansemannn committed Mar 21, 2018
1 parent bf211dc commit 62e42b5
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 15 deletions.
3 changes: 2 additions & 1 deletion iphone/Classes/NetworkModule.m
Expand Up @@ -254,7 +254,7 @@ - (void)registerForPushNotifications:(id)args
pushNotificationError = [[args objectForKey:@"error"] retain];
pushNotificationCallback = [[args objectForKey:@"callback"] retain];

[[TiApp app] setRemoteNotificationDelegate:self];
[[TiApp app] registerApplicationDelegate:self];

UIApplication *app = [UIApplication sharedApplication];

Expand All @@ -280,6 +280,7 @@ - (void)unregisterForPushNotifications:(id)args
{
UIApplication *app = [UIApplication sharedApplication];
[app unregisterForRemoteNotifications];
[[TiApp app] unregisterApplicationDelegate:self];
}

#pragma mark Push Notification Delegates
Expand Down
10 changes: 7 additions & 3 deletions iphone/Classes/TiApp.h
Expand Up @@ -50,12 +50,14 @@ TI_INLINE void waitForMemoryPanicCleared() //WARNING: This must never be run on
NSString *userAgent;
NSString *remoteDeviceUUID;

id remoteNotificationDelegate;
NSDictionary *remoteNotification;
NSMutableDictionary *pendingCompletionHandlers;
NSMutableDictionary *pendingReplyHandlers;
NSMutableDictionary *backgroundTransferCompletionHandlers;
NSMutableDictionary *queuedBootEvents;
NSMutableDictionary<NSString *, NSSet<id> *> *_queuedApplicationSelectors;
NSMutableSet<id> *_applicationDelegates;

BOOL appBooted;

NSString *sessionId;
Expand All @@ -76,8 +78,6 @@ TI_INLINE void waitForMemoryPanicCleared() //WARNING: This must never be run on
*/
@property (nonatomic, retain) IBOutlet UIWindow *window;

@property (nonatomic, assign) id remoteNotificationDelegate;

@property (nonatomic, readonly) NSMutableDictionary *pendingCompletionHandlers;
@property (nonatomic, readonly) NSMutableDictionary *backgroundTransferCompletionHandlers;

Expand Down Expand Up @@ -129,6 +129,10 @@ TI_INLINE void waitForMemoryPanicCleared() //WARNING: This must never be run on

- (void)attachXHRBridgeIfRequired;

- (void)registerApplicationDelegate:(id)applicationDelegate;

- (void)unregisterApplicationDelegate:(id)applicationDelegate;

/**
Returns application launch options
Expand Down

0 comments on commit 62e42b5

Please sign in to comment.