Skip to content

Commit

Permalink
Merge pull request #22 from WebEngage/hotfix/pushclick_killed_state
Browse files Browse the repository at this point in the history
v1.2.8
  • Loading branch information
UnmeshRathod authored Jun 16, 2021
2 parents 7b19747 + a290aa8 commit ea59e44
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion lib/ios/WEGWebEngageBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,16 @@ - (void)notificationShown:(NSMutableDictionary *)inAppNotificationData {
-(void)WEGHandleDeeplink:(NSString *)deeplink userData:(NSDictionary *)data{
RCTLogInfo(@"webengageBridge: push notification clicked with deeplink: %@", deeplink);
NSDictionary *pushData = @{@"deeplink":deeplink, @"userData":data};
[self sendEventWithName:@"pushNotificationClicked" body:pushData];
if (hasListeners) {
[self sendEventWithName:@"pushNotificationClicked" body:pushData];
} else {
if (self.pendingEventsDict == nil) {
self.pendingEventsDict = [NSMutableDictionary dictionary];
self.pendingEventsDict[@"pushNotificationClicked"] = pushData;
} else {
self.pendingEventsDict[@"pushNotificationClicked"] = pushData;
}
}
}

- (void)sendUniversalLinkLocation:(NSString *)location{
Expand All @@ -264,6 +273,8 @@ - (void)sendUniversalLinkLocation:(NSString *)location{
if (self.pendingEventsDict == nil) {
self.pendingEventsDict = [NSMutableDictionary dictionary];
self.pendingEventsDict[@"universalLinkClicked"] = data;
} else {
self.pendingEventsDict[@"universalLinkClicked"] = data;
}
}
}
Expand All @@ -274,6 +285,7 @@ - (void) startObserving {
if (self.pendingEventsDict != nil) {
for (id key in self.pendingEventsDict) {
[self sendEventWithName:key body:self.pendingEventsDict[key]];
[self.pendingEventsDict removeObjectForKey: key];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-webengage",
"version": "1.2.7",
"version": "1.2.8",
"description": "WebEngage React Native library.",
"license": "MIT",
"author": "WebEngage",
Expand Down

0 comments on commit ea59e44

Please sign in to comment.