BlueWallet/ios/EventEmitter.m

48 lines
798 B
Mathematica
Raw Normal View History

//
// EventEmitter.m
// BlueWallet
//
// Created by Marcos Rodriguez on 12/25/20.
// Copyright © 2020 BlueWallet. All rights reserved.
//
#import "EventEmitter.h"
static EventEmitter *sharedInstance;
@implementation EventEmitter
RCT_EXPORT_MODULE();
+ (BOOL)requiresMainQueueSetup {
return YES;
}
+ (EventEmitter *)sharedInstance {
return sharedInstance;
}
- (instancetype)init {
sharedInstance = [super init];
return sharedInstance;
}
- (NSArray<NSString *> *)supportedEvents {
2020-12-27 01:10:54 +01:00
return @[@"onNotificationReceived",@"openSettings"];
}
- (void)sendNotification:(NSDictionary *)userInfo
{
[sharedInstance sendEventWithName:@"onNotificationReceived" body:userInfo];
}
2020-12-27 01:10:54 +01:00
- (void)openSettings
{
[sharedInstance sendEventWithName:@"openSettings" body:nil];
}
@end