Skip to content

Commit

Permalink
[expo-notifications] Smaller fixes (#6790)
Browse files Browse the repository at this point in the history
# Why, How

Whilst preparing #6773 I noticed two commits that don't belong to that PR. So I created a separate one to make the other one simpler to review.

# Test Plan

Code compiles.
  • Loading branch information
sjchmiela authored and EvanBacon committed Feb 13, 2020
1 parent 0e106f4 commit db232d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -41,12 +41,12 @@ public String getName() {

@Override
public void onCreate(ModuleRegistry moduleRegistry) {
mEventEmitter = moduleRegistry.getModule(EventEmitter.class);

// Register the module as a listener in PushTokenManager singleton module.
// Deregistration happens in onDestroy callback.
mPushTokenManager = moduleRegistry.getSingletonModule("PushTokenManager", PushTokenManager.class);
mPushTokenManager.addListener(this);

mEventEmitter = moduleRegistry.getModule(EventEmitter.class);
}

@Override
Expand Down
Expand Up @@ -5,7 +5,7 @@

#import <UMCore/UMEventEmitterService.h>

static const NSString *onDevicePushTokenEventName = @"onDevicePushToken";
static NSString * const onDevicePushTokenEventName = @"onDevicePushToken";

@interface EXPushTokenModule ()

Expand Down Expand Up @@ -57,7 +57,7 @@ - (void)setModuleRegistry:(UMModuleRegistry *)moduleRegistry

- (NSArray<NSString *> *)supportedEvents
{
return @[(NSString *)onDevicePushTokenEventName];
return @[onDevicePushTokenEventName];
}

- (void)startObserving
Expand Down Expand Up @@ -102,7 +102,7 @@ - (void)onDidRegisterWithDeviceToken:(NSData *)devicePushToken
}

if (_isBeingObserved) {
[_eventEmitter sendEventWithName:(NSString *)onDevicePushTokenEventName
[_eventEmitter sendEventWithName:onDevicePushTokenEventName
body:@{ @"devicePushToken": stringToken }];
}
}
Expand Down

0 comments on commit db232d8

Please sign in to comment.