From 07e42bdfe6ed51f6a97cd2aa12d2063cfb251a81 Mon Sep 17 00:00:00 2001 From: schempp Date: Mon, 4 Apr 2022 12:32:02 -0700 Subject: [PATCH 1/4] Test --- ios/IntercomEventEmitter.h | 1 + ios/IntercomEventEmitter.m | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ios/IntercomEventEmitter.h b/ios/IntercomEventEmitter.h index 18171dea..09e89fa6 100644 --- a/ios/IntercomEventEmitter.h +++ b/ios/IntercomEventEmitter.h @@ -1,4 +1,5 @@ #import @interface IntercomEventEmitter : RCTEventEmitter +- (void)handleUpdateUnreadCount2; @end diff --git a/ios/IntercomEventEmitter.m b/ios/IntercomEventEmitter.m index 9b3fdd03..9c8b8c37 100644 --- a/ios/IntercomEventEmitter.m +++ b/ios/IntercomEventEmitter.m @@ -15,17 +15,25 @@ + (BOOL)requiresMainQueueSetup { @"WINDOW_DID_HIDE_NOTIFICATION": IntercomWindowDidHideNotification, @"WINDOW_DID_SHOW_NOTIFICATION": IntercomWindowDidShowNotification, @"HELP_CENTER_WINDOW_DID_SHOW_NOTIFICATION": IntercomHelpCenterDidShowNotification, - @"HELP_CENTER_WINDOW_DID_HIDE_NOTIFICATION": IntercomHelpCenterDidHideNotification + @"HELP_CENTER_WINDOW_DID_HIDE_NOTIFICATION": IntercomHelpCenterDidHideNotification, + @"UNREAD_COUNT_CHANGE_NOTIFICATION2": IntercomUnreadConversationCountDidChangeNotification2 }; } - (NSArray *)supportedEvents { return @[IntercomUnreadConversationCountDidChangeNotification, IntercomWindowDidHideNotification, IntercomWindowDidShowNotification, - IntercomHelpCenterDidShowNotification, IntercomHelpCenterDidHideNotification + IntercomHelpCenterDidShowNotification, IntercomHelpCenterDidHideNotification, + IntercomUnreadConversationCountDidChangeNotification2 ]; } +- (void)handleUpdateUnreadCount2 { + NSUInteger unreadCount = [Intercom unreadConversationCount]; + NSNumber *unreadCountNumber = @(unreadCount); + [self sendEventWithName:IntercomUnreadConversationCountDidChangeNotification2 body:@{@"count": unreadCountNumber}]; +} + - (void)handleUpdateUnreadCount:(NSNotification *)notification { NSUInteger unreadCount = [Intercom unreadConversationCount]; From 60ed4bfbfa6af5165a4a87abcf0b91be32cbbcfb Mon Sep 17 00:00:00 2001 From: tschempp-scs Date: Mon, 4 Apr 2022 12:50:31 -0700 Subject: [PATCH 2/4] test2 --- src/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.tsx b/src/index.tsx index 537f48db..cc7e4665 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -44,6 +44,7 @@ export const IntercomEvents = { type EventType = | 'IntercomUnreadConversationCountDidChangeNotification' + | 'IntercomUnreadConversationCountDidChangeNotification2' | 'IntercomHelpCenterDidShowNotification' | 'IntercomHelpCenterDidHideNotification' | 'IntercomWindowDidHideNotification' From 650fa555ae3b879d9465313c91eeb36ad1834372 Mon Sep 17 00:00:00 2001 From: tschempp-scs Date: Mon, 4 Apr 2022 13:04:53 -0700 Subject: [PATCH 3/4] test3 --- ios/IntercomEventEmitter.m | 15 +++------------ src/index.tsx | 1 - 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/ios/IntercomEventEmitter.m b/ios/IntercomEventEmitter.m index 9c8b8c37..ae7b9ca5 100644 --- a/ios/IntercomEventEmitter.m +++ b/ios/IntercomEventEmitter.m @@ -15,27 +15,18 @@ + (BOOL)requiresMainQueueSetup { @"WINDOW_DID_HIDE_NOTIFICATION": IntercomWindowDidHideNotification, @"WINDOW_DID_SHOW_NOTIFICATION": IntercomWindowDidShowNotification, @"HELP_CENTER_WINDOW_DID_SHOW_NOTIFICATION": IntercomHelpCenterDidShowNotification, - @"HELP_CENTER_WINDOW_DID_HIDE_NOTIFICATION": IntercomHelpCenterDidHideNotification, - @"UNREAD_COUNT_CHANGE_NOTIFICATION2": IntercomUnreadConversationCountDidChangeNotification2 + @"HELP_CENTER_WINDOW_DID_HIDE_NOTIFICATION": IntercomHelpCenterDidHideNotification }; } - (NSArray *)supportedEvents { return @[IntercomUnreadConversationCountDidChangeNotification, IntercomWindowDidHideNotification, IntercomWindowDidShowNotification, - IntercomHelpCenterDidShowNotification, IntercomHelpCenterDidHideNotification, - IntercomUnreadConversationCountDidChangeNotification2 + IntercomHelpCenterDidShowNotification, IntercomHelpCenterDidHideNotification ]; } -- (void)handleUpdateUnreadCount2 { - NSUInteger unreadCount = [Intercom unreadConversationCount]; - NSNumber *unreadCountNumber = @(unreadCount); - [self sendEventWithName:IntercomUnreadConversationCountDidChangeNotification2 body:@{@"count": unreadCountNumber}]; -} - - -- (void)handleUpdateUnreadCount:(NSNotification *)notification { +- (void)handleUpdateUnreadCount { NSUInteger unreadCount = [Intercom unreadConversationCount]; NSNumber *unreadCountNumber = @(unreadCount); [self sendEventWithName:IntercomUnreadConversationCountDidChangeNotification body:@{@"count": unreadCountNumber}]; diff --git a/src/index.tsx b/src/index.tsx index cc7e4665..537f48db 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -44,7 +44,6 @@ export const IntercomEvents = { type EventType = | 'IntercomUnreadConversationCountDidChangeNotification' - | 'IntercomUnreadConversationCountDidChangeNotification2' | 'IntercomHelpCenterDidShowNotification' | 'IntercomHelpCenterDidHideNotification' | 'IntercomWindowDidHideNotification' From 1af2ff04f40fce5d0c7193fc46e61b2272f2133b Mon Sep 17 00:00:00 2001 From: tschempp-scs Date: Mon, 4 Apr 2022 13:12:55 -0700 Subject: [PATCH 4/4] test4 --- ios/IntercomEventEmitter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/IntercomEventEmitter.h b/ios/IntercomEventEmitter.h index 09e89fa6..799eb039 100644 --- a/ios/IntercomEventEmitter.h +++ b/ios/IntercomEventEmitter.h @@ -1,5 +1,5 @@ #import @interface IntercomEventEmitter : RCTEventEmitter -- (void)handleUpdateUnreadCount2; +- (void)handleUpdateUnreadCount; @end