//
//  SmartechRCTEventEmitter.m
//  smartech-base-react-native
//
//  Created by Jobin Kurian on 28/11/23.
//

#import "SmartechRCTEventEmitter.h"

@implementation SmartechRCTEventEmitter

RCT_EXPORT_MODULE();

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

- (void)startObserving {
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(emitEventInternal:)
                                                 name:kSMTDeeplinkNotificationIdentifier
                                               object:nil];
}

- (void)stopObserving {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)emitEventInternal:(NSNotification *)notification {
    [self sendEventWithName:notification.name body:notification.userInfo];
}


@end
