Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-24266] iOS: Expose UIApplicationDelegate to modules / Hyperloop #9761

Merged
merged 6 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion iphone/Classes/NetworkModule.m
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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