Skip to content

Commit 8e9d87c

Browse files
VailenceVailence
andauthored
WMSDK-572- Adds JS delivery bridge for RN (#137)
Introduces the MindboxJsDeliveryBridge class. This bridge provides a native mechanism to emit UNNotificationResponse objects, enabling the Mindbox SDK to pass these responses to the React Native JavaScript delivery module for consistent handling within the RN environment. Relates to WMSDK-572 Co-authored-by: Vailence <[email protected]>
1 parent 638b0ac commit 8e9d87c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

ios/MindboxJsDeliveryBridge.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Foundation
2+
import UserNotifications
3+
4+
@objc(MindboxJsDeliveryBridge)
5+
public final class MindboxJsDeliveryBridge: NSObject {
6+
7+
@objc public static func emit(_ response: UNNotificationResponse) {
8+
MindboxJsDelivery.emitEvent(response)
9+
}
10+
}

ios/MindboxSdk.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Mindbox
22
import MindboxLogger
3-
import CoreFoundation
43

54
enum CustomError: Error {
65
case tokenAPNSisNull

ios/MindboxSdk.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
61249CFA2719673B00FC4033 /* MindboxJsDelivery.m in Sources */ = {isa = PBXBuildFile; fileRef = 61249CF92719673B00FC4033 /* MindboxJsDelivery.m */; };
11+
D0F7B0012B1C4A1A00A1B2C3 /* MindboxJsDeliveryBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F7B0002B1C4A1A00A1B2C3 /* MindboxJsDeliveryBridge.swift */; };
1112
F4FF95D7245B92E800C19C63 /* MindboxSdk.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* MindboxSdk.swift */; };
1213
/* End PBXBuildFile section */
1314

@@ -28,6 +29,7 @@
2829
61249CF82719673B00FC4033 /* MindboxJsDelivery.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MindboxJsDelivery.h; sourceTree = "<group>"; };
2930
61249CF92719673B00FC4033 /* MindboxJsDelivery.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MindboxJsDelivery.m; sourceTree = "<group>"; };
3031
B3E7B5891CC2AC0600A0062D /* MindboxSdk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MindboxSdk.m; sourceTree = "<group>"; };
32+
D0F7B0002B1C4A1A00A1B2C3 /* MindboxJsDeliveryBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MindboxJsDeliveryBridge.swift; sourceTree = "<group>"; };
3133
F4FF95D5245B92E700C19C63 /* MindboxSdk-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MindboxSdk-Bridging-Header.h"; sourceTree = "<group>"; };
3234
F4FF95D6245B92E800C19C63 /* MindboxSdk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MindboxSdk.swift; sourceTree = "<group>"; };
3335
/* End PBXFileReference section */
@@ -56,6 +58,7 @@
5658
children = (
5759
61249CF82719673B00FC4033 /* MindboxJsDelivery.h */,
5860
61249CF92719673B00FC4033 /* MindboxJsDelivery.m */,
61+
D0F7B0002B1C4A1A00A1B2C3 /* MindboxJsDeliveryBridge.swift */,
5962
F4FF95D6245B92E800C19C63 /* MindboxSdk.swift */,
6063
B3E7B5891CC2AC0600A0062D /* MindboxSdk.m */,
6164
F4FF95D5245B92E700C19C63 /* MindboxSdk-Bridging-Header.h */,
@@ -121,6 +124,7 @@
121124
buildActionMask = 2147483647;
122125
files = (
123126
61249CFA2719673B00FC4033 /* MindboxJsDelivery.m in Sources */,
127+
D0F7B0012B1C4A1A00A1B2C3 /* MindboxJsDeliveryBridge.swift in Sources */,
124128
F4FF95D7245B92E800C19C63 /* MindboxSdk.swift in Sources */,
125129
);
126130
runOnlyForDeploymentPostprocessing = 0;

0 commit comments

Comments
 (0)