From e46b7d401844d81dd9d49a70b3b2c338aa011cb6 Mon Sep 17 00:00:00 2001 From: mikechoch Date: Tue, 30 Jun 2020 14:40:28 -0400 Subject: [PATCH] iOS native has not yet released, but this is a fix for after * Fix is related to the `NSDictionary` param keys not matching Android * This is consistent now and determined not from the bridge method but the actual native code * `[action jsonRepresentation]` will be used to generate the `NSDictionary` and will be passed to react that way * This should also be done across other wrappers no already doing this and it fixes the react native issue #1012 --- ios/RCTOneSignal/RCTOneSignalEventEmitter.m | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ios/RCTOneSignal/RCTOneSignalEventEmitter.m b/ios/RCTOneSignal/RCTOneSignalEventEmitter.m index 7dd937e9..2249138c 100644 --- a/ios/RCTOneSignal/RCTOneSignalEventEmitter.m +++ b/ios/RCTOneSignal/RCTOneSignalEventEmitter.m @@ -405,13 +405,7 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body { RCT_EXPORT_METHOD(setInAppMessageClickHandler) { [OneSignal setInAppMessageClickHandler:^(OSInAppMessageAction *action) { - NSDictionary *result = @{ - @"clickName": action.clickName ?: [NSNull null], - @"clickUrl" : action.clickUrl.absoluteString ?: [NSNull null], - @"firstClick" : @(action.firstClick), - @"closesMessage" : @(action.closesMessage) - }; - [RCTOneSignalEventEmitter sendEventWithName:@"OneSignal-inAppMessageClicked" withBody:result]; + [RCTOneSignalEventEmitter sendEventWithName:@"OneSignal-inAppMessageClicked" withBody:[action jsonRepresentation]]; }]; }