@trycourier/courier-react-native 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +382 -0
- package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +17 -0
- package/android/.idea/jarRepositories.xml +35 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +149 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +5 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/courierreactnative/CourierReactNativeActivity.kt +62 -0
- package/android/src/main/java/com/courierreactnative/CourierReactNativeModule.kt +199 -0
- package/android/src/main/java/com/courierreactnative/CourierReactNativePackage.kt +19 -0
- package/android/src/main/java/com/courierreactnative/NotificationPermissionStatus.kt +6 -0
- package/courier-react-native.podspec +37 -0
- package/ios/CourierReactNative-Bridging-Header.h +3 -0
- package/ios/CourierReactNative.m +53 -0
- package/ios/CourierReactNative.swift +286 -0
- package/ios/CourierReactNative.xcodeproj/project.pbxproj +283 -0
- package/ios/CourierReactNativeDelegate.h +20 -0
- package/ios/CourierReactNativeDelegate.m +125 -0
- package/lib/commonjs/index.js +305 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +295 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.d.ts +140 -0
- package/package.json +156 -0
- package/src/index.ts +337 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import Courier_iOS
|
|
2
|
+
|
|
3
|
+
@objc(CourierReactNative)
|
|
4
|
+
class CourierReactNative: RCTEventEmitter {
|
|
5
|
+
|
|
6
|
+
private static let COURIER_ERROR_TAG = "Courier iOS SDK Error"
|
|
7
|
+
internal static let COURIER_PUSH_NOTIFICATION_CLICKED_EVENT = "pushNotificationClicked"
|
|
8
|
+
internal static let COURIER_PUSH_NOTIFICATION_DELIVERED_EVENT = "pushNotificationDelivered"
|
|
9
|
+
private static let COURIER_PUSH_NOTIFICATION_DEBUG_LOG_EVENT = "courierDebugEvent"
|
|
10
|
+
|
|
11
|
+
private var lastClickedMessage: [AnyHashable: Any]? = nil
|
|
12
|
+
private var notificationCenter: NotificationCenter {
|
|
13
|
+
get {
|
|
14
|
+
return NotificationCenter.default
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override init() {
|
|
19
|
+
super.init()
|
|
20
|
+
|
|
21
|
+
// Set the user agent
|
|
22
|
+
// Used to know the platform performing requests
|
|
23
|
+
Courier.agent = CourierAgent.react_native_ios
|
|
24
|
+
|
|
25
|
+
// Attach the listeners
|
|
26
|
+
attachObservers()
|
|
27
|
+
|
|
28
|
+
// Send notification to react native side
|
|
29
|
+
Courier.shared.logListener = {log in
|
|
30
|
+
self.sendEvent(withName: CourierReactNative.COURIER_PUSH_NOTIFICATION_DEBUG_LOG_EVENT, body: log)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private func attachObservers() {
|
|
36
|
+
|
|
37
|
+
notificationCenter.addObserver(
|
|
38
|
+
self,
|
|
39
|
+
selector: #selector(pushNotificationClicked),
|
|
40
|
+
name: Notification.Name(rawValue: CourierReactNative.COURIER_PUSH_NOTIFICATION_CLICKED_EVENT),
|
|
41
|
+
object: nil
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
notificationCenter.addObserver(
|
|
45
|
+
self,
|
|
46
|
+
selector: #selector(pushNotificationDelivered),
|
|
47
|
+
name: Notification.Name(rawValue: CourierReactNative.COURIER_PUSH_NOTIFICATION_DELIVERED_EVENT),
|
|
48
|
+
object: nil
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private func sendMessage(name: String, message: [AnyHashable: Any]?) {
|
|
54
|
+
|
|
55
|
+
guard let message = message else {
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
do {
|
|
60
|
+
sendEvent(
|
|
61
|
+
withName: name,
|
|
62
|
+
body: try message.toString()
|
|
63
|
+
)
|
|
64
|
+
} catch {
|
|
65
|
+
Courier.log(String(describing: error))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@objc private func pushNotificationClicked(notification: Notification) {
|
|
71
|
+
|
|
72
|
+
lastClickedMessage = notification.userInfo
|
|
73
|
+
sendMessage(
|
|
74
|
+
name: CourierReactNative.COURIER_PUSH_NOTIFICATION_CLICKED_EVENT,
|
|
75
|
+
message: lastClickedMessage
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@objc private func pushNotificationDelivered(notification: Notification) {
|
|
81
|
+
|
|
82
|
+
sendMessage(
|
|
83
|
+
name: CourierReactNative.COURIER_PUSH_NOTIFICATION_DELIVERED_EVENT,
|
|
84
|
+
message: notification.userInfo
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@objc func registerPushNotificationClickedOnKilledState() {
|
|
90
|
+
|
|
91
|
+
sendMessage(
|
|
92
|
+
name: CourierReactNative.COURIER_PUSH_NOTIFICATION_CLICKED_EVENT,
|
|
93
|
+
message: lastClickedMessage
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@objc(signIn: accessToken: withResolver: withRejecter:)
|
|
99
|
+
func signIn(userId: NSString, accessToken: NSString, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
100
|
+
|
|
101
|
+
Courier.shared.signIn(
|
|
102
|
+
accessToken: accessToken as String,
|
|
103
|
+
userId: userId as String,
|
|
104
|
+
onSuccess: {
|
|
105
|
+
resolve(nil)
|
|
106
|
+
},
|
|
107
|
+
onFailure: { error in
|
|
108
|
+
reject(String(describing: error), CourierReactNative.COURIER_ERROR_TAG, nil)
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@objc(getNotificationPermissionStatus: withRejecter:)
|
|
115
|
+
func getNotificationPermissionStatus(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
116
|
+
|
|
117
|
+
Courier.getNotificationPermissionStatus { status in
|
|
118
|
+
resolve(status.name)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@objc(requestNotificationPermission: withRejecter:)
|
|
124
|
+
func requestNotificationPermission(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
125
|
+
|
|
126
|
+
Courier.requestNotificationPermission { status in
|
|
127
|
+
resolve(status.name)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@objc(signOut: withRejecter:)
|
|
133
|
+
func signOut(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
134
|
+
|
|
135
|
+
Courier.shared.signOut(
|
|
136
|
+
onSuccess: {
|
|
137
|
+
resolve(nil)
|
|
138
|
+
},
|
|
139
|
+
onFailure: { error in
|
|
140
|
+
reject(String(describing: error), CourierReactNative.COURIER_ERROR_TAG, nil)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@objc(getUserId: withRejecter:)
|
|
147
|
+
func getUserId(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
148
|
+
|
|
149
|
+
let userId = Courier.shared.userId
|
|
150
|
+
resolve(userId)
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@objc(getFcmToken: withRejecter:)
|
|
155
|
+
func getFcmToken(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
156
|
+
|
|
157
|
+
let token = Courier.shared.fcmToken
|
|
158
|
+
resolve(token)
|
|
159
|
+
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@objc(setFcmToken: withResolver: withRejecter:)
|
|
163
|
+
func setFcmToken(token: NSString, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
164
|
+
|
|
165
|
+
Courier.shared.setFCMToken(
|
|
166
|
+
token as String,
|
|
167
|
+
onSuccess: {
|
|
168
|
+
resolve(nil)
|
|
169
|
+
},
|
|
170
|
+
onFailure: { error in
|
|
171
|
+
reject(String(describing: error), CourierReactNative.COURIER_ERROR_TAG, nil)
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@objc(getApnsToken: withRejecter:)
|
|
178
|
+
func getApnsToken(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
179
|
+
|
|
180
|
+
let token = Courier.shared.apnsToken
|
|
181
|
+
resolve(token)
|
|
182
|
+
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@objc(sendPush: withUserId: withTitle: withBody: withProviders: withIsProduction: withResolver: withRejecter:)
|
|
186
|
+
func sendPush(authKey: NSString, userId: NSString, title: NSString, body: NSString, providers: NSArray, isProduction: Bool, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
187
|
+
|
|
188
|
+
guard let courierProviders = providers as? [String] else {
|
|
189
|
+
reject("No provider supported", CourierReactNative.COURIER_ERROR_TAG, nil)
|
|
190
|
+
return
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
Courier.shared.sendPush(
|
|
194
|
+
authKey: authKey as String,
|
|
195
|
+
userId: userId as String,
|
|
196
|
+
title: title as String,
|
|
197
|
+
message: body as String,
|
|
198
|
+
isProduction: isProduction,
|
|
199
|
+
providers: courierProviders,
|
|
200
|
+
onSuccess: { requestId in
|
|
201
|
+
resolve(requestId)
|
|
202
|
+
},
|
|
203
|
+
onFailure: { error in
|
|
204
|
+
reject(String(describing: error), CourierReactNative.COURIER_ERROR_TAG, nil)
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@objc(iOSForegroundPresentationOptions:)
|
|
211
|
+
func iOSForegroundPresentationOptions(params: NSDictionary) {
|
|
212
|
+
|
|
213
|
+
let rawValue = params.toPresentationOptions().rawValue
|
|
214
|
+
NotificationCenter.default.post(
|
|
215
|
+
name: Notification.Name("iosForegroundNotificationPresentationOptions"),
|
|
216
|
+
object: nil,
|
|
217
|
+
userInfo: ["options": rawValue]
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@objc(setDebugMode: withResolver: withRejecter:)
|
|
223
|
+
func setDebugMode(isDebugging: Bool,resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock){
|
|
224
|
+
Courier.shared.isDebugging = isDebugging
|
|
225
|
+
print("setIsDebugging", isDebugging);
|
|
226
|
+
resolve(Courier.shared.isDebugging)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
override func supportedEvents() -> [String]! {
|
|
230
|
+
return [
|
|
231
|
+
CourierReactNative.COURIER_PUSH_NOTIFICATION_CLICKED_EVENT,
|
|
232
|
+
CourierReactNative.COURIER_PUSH_NOTIFICATION_DELIVERED_EVENT,
|
|
233
|
+
CourierReactNative.COURIER_PUSH_NOTIFICATION_DEBUG_LOG_EVENT
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
extension [AnyHashable: Any] {
|
|
240
|
+
|
|
241
|
+
func toString() throws -> String {
|
|
242
|
+
let json = try JSONSerialization.data(withJSONObject: self)
|
|
243
|
+
let str = String(data: json, encoding: .utf8)
|
|
244
|
+
return str ?? "Invalid JSON"
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
extension NSDictionary {
|
|
250
|
+
|
|
251
|
+
func toPresentationOptions() -> UNNotificationPresentationOptions {
|
|
252
|
+
|
|
253
|
+
var foregroundPresentationOptions: UNNotificationPresentationOptions = []
|
|
254
|
+
|
|
255
|
+
if let options = self["options"] as? [String] {
|
|
256
|
+
options.forEach { option in
|
|
257
|
+
switch option {
|
|
258
|
+
case "sound": foregroundPresentationOptions.insert(.sound)
|
|
259
|
+
case "badge": foregroundPresentationOptions.insert(.badge)
|
|
260
|
+
case "list": if #available(iOS 14.0, *) { foregroundPresentationOptions.insert(.list) } else { foregroundPresentationOptions.insert(.alert) }
|
|
261
|
+
case "banner": if #available(iOS 14.0, *) { foregroundPresentationOptions.insert(.banner) } else { foregroundPresentationOptions.insert(.alert) }
|
|
262
|
+
default: break
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return foregroundPresentationOptions
|
|
268
|
+
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
extension UNAuthorizationStatus {
|
|
274
|
+
|
|
275
|
+
var name: String {
|
|
276
|
+
switch (self) {
|
|
277
|
+
case .notDetermined: return "notDetermined"
|
|
278
|
+
case .denied: return "denied"
|
|
279
|
+
case .authorized: return "authorized"
|
|
280
|
+
case .provisional: return "provisional"
|
|
281
|
+
case .ephemeral: return "ephemeral"
|
|
282
|
+
@unknown default: return "unknown"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 46;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
5E555C0D2413F4C50049A1A2 /* CourierReactNative.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* CourierReactNative.m */; };
|
|
11
|
+
F4FF95D7245B92E800C19C63 /* CourierReactNative.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* CourierReactNative.swift */; };
|
|
12
|
+
/* End PBXBuildFile section */
|
|
13
|
+
|
|
14
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
15
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
16
|
+
isa = PBXCopyFilesBuildPhase;
|
|
17
|
+
buildActionMask = 2147483647;
|
|
18
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
19
|
+
dstSubfolderSpec = 16;
|
|
20
|
+
files = (
|
|
21
|
+
);
|
|
22
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
23
|
+
};
|
|
24
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
25
|
+
|
|
26
|
+
/* Begin PBXFileReference section */
|
|
27
|
+
134814201AA4EA6300B7C361 /* libCourierReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCourierReactNative.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
28
|
+
B3E7B5891CC2AC0600A0062D /* CourierReactNative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CourierReactNative.m; sourceTree = "<group>"; };
|
|
29
|
+
F4FF95D5245B92E700C19C63 /* CourierReactNative-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CourierReactNative-Bridging-Header.h"; sourceTree = "<group>"; };
|
|
30
|
+
F4FF95D6245B92E800C19C63 /* CourierReactNative.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourierReactNative.swift; sourceTree = "<group>"; };
|
|
31
|
+
/* End PBXFileReference section */
|
|
32
|
+
|
|
33
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
34
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
35
|
+
isa = PBXFrameworksBuildPhase;
|
|
36
|
+
buildActionMask = 2147483647;
|
|
37
|
+
files = (
|
|
38
|
+
);
|
|
39
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
40
|
+
};
|
|
41
|
+
/* End PBXFrameworksBuildPhase section */
|
|
42
|
+
|
|
43
|
+
/* Begin PBXGroup section */
|
|
44
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
45
|
+
isa = PBXGroup;
|
|
46
|
+
children = (
|
|
47
|
+
134814201AA4EA6300B7C361 /* libCourierReactNative.a */,
|
|
48
|
+
);
|
|
49
|
+
name = Products;
|
|
50
|
+
sourceTree = "<group>";
|
|
51
|
+
};
|
|
52
|
+
58B511D21A9E6C8500147676 = {
|
|
53
|
+
isa = PBXGroup;
|
|
54
|
+
children = (
|
|
55
|
+
F4FF95D6245B92E800C19C63 /* CourierReactNative.swift */,
|
|
56
|
+
B3E7B5891CC2AC0600A0062D /* CourierReactNative.m */,
|
|
57
|
+
F4FF95D5245B92E700C19C63 /* CourierReactNative-Bridging-Header.h */,
|
|
58
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
|
59
|
+
);
|
|
60
|
+
sourceTree = "<group>";
|
|
61
|
+
};
|
|
62
|
+
/* End PBXGroup section */
|
|
63
|
+
|
|
64
|
+
/* Begin PBXNativeTarget section */
|
|
65
|
+
58B511DA1A9E6C8500147676 /* CourierReactNative */ = {
|
|
66
|
+
isa = PBXNativeTarget;
|
|
67
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "CourierReactNative" */;
|
|
68
|
+
buildPhases = (
|
|
69
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
|
70
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
71
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
72
|
+
);
|
|
73
|
+
buildRules = (
|
|
74
|
+
);
|
|
75
|
+
dependencies = (
|
|
76
|
+
);
|
|
77
|
+
name = CourierReactNative;
|
|
78
|
+
productName = RCTDataManager;
|
|
79
|
+
productReference = 134814201AA4EA6300B7C361 /* libCourierReactNative.a */;
|
|
80
|
+
productType = "com.apple.product-type.library.static";
|
|
81
|
+
};
|
|
82
|
+
/* End PBXNativeTarget section */
|
|
83
|
+
|
|
84
|
+
/* Begin PBXProject section */
|
|
85
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
86
|
+
isa = PBXProject;
|
|
87
|
+
attributes = {
|
|
88
|
+
LastUpgradeCheck = 0920;
|
|
89
|
+
ORGANIZATIONNAME = Facebook;
|
|
90
|
+
TargetAttributes = {
|
|
91
|
+
58B511DA1A9E6C8500147676 = {
|
|
92
|
+
CreatedOnToolsVersion = 6.1.1;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "CourierReactNative" */;
|
|
97
|
+
compatibilityVersion = "Xcode 3.2";
|
|
98
|
+
developmentRegion = English;
|
|
99
|
+
hasScannedForEncodings = 0;
|
|
100
|
+
knownRegions = (
|
|
101
|
+
English,
|
|
102
|
+
en,
|
|
103
|
+
);
|
|
104
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
|
105
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
|
106
|
+
projectDirPath = "";
|
|
107
|
+
projectRoot = "";
|
|
108
|
+
targets = (
|
|
109
|
+
58B511DA1A9E6C8500147676 /* CourierReactNative */,
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
/* End PBXProject section */
|
|
113
|
+
|
|
114
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
115
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
116
|
+
isa = PBXSourcesBuildPhase;
|
|
117
|
+
buildActionMask = 2147483647;
|
|
118
|
+
files = (
|
|
119
|
+
F4FF95D7245B92E800C19C63 /* CourierReactNative.swift in Sources */,
|
|
120
|
+
B3E7B58A1CC2AC0600A0062D /* CourierReactNative.m in Sources */,
|
|
121
|
+
);
|
|
122
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
123
|
+
};
|
|
124
|
+
/* End PBXSourcesBuildPhase section */
|
|
125
|
+
|
|
126
|
+
/* Begin XCBuildConfiguration section */
|
|
127
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
128
|
+
isa = XCBuildConfiguration;
|
|
129
|
+
buildSettings = {
|
|
130
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
131
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
132
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
133
|
+
CLANG_ENABLE_MODULES = YES;
|
|
134
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
135
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
136
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
137
|
+
CLANG_WARN_COMMA = YES;
|
|
138
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
139
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
140
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
141
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
142
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
143
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
144
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
145
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
146
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
147
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
148
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
149
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
150
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
151
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
152
|
+
COPY_PHASE_STRIP = NO;
|
|
153
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
154
|
+
ENABLE_TESTABILITY = YES;
|
|
155
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
156
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
157
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
158
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
159
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
160
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
161
|
+
"DEBUG=1",
|
|
162
|
+
"$(inherited)",
|
|
163
|
+
);
|
|
164
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
165
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
166
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
167
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
168
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
169
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
170
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
171
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
172
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
|
173
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
174
|
+
SDKROOT = iphoneos;
|
|
175
|
+
};
|
|
176
|
+
name = Debug;
|
|
177
|
+
};
|
|
178
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
179
|
+
isa = XCBuildConfiguration;
|
|
180
|
+
buildSettings = {
|
|
181
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
182
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
183
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
184
|
+
CLANG_ENABLE_MODULES = YES;
|
|
185
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
186
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
187
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
188
|
+
CLANG_WARN_COMMA = YES;
|
|
189
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
190
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
191
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
192
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
193
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
194
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
195
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
196
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
197
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
198
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
199
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
200
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
201
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
202
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
203
|
+
COPY_PHASE_STRIP = YES;
|
|
204
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
205
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
206
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
207
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
208
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
209
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
210
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
211
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
212
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
213
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
214
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
215
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
216
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
217
|
+
SDKROOT = iphoneos;
|
|
218
|
+
VALIDATE_PRODUCT = YES;
|
|
219
|
+
};
|
|
220
|
+
name = Release;
|
|
221
|
+
};
|
|
222
|
+
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
223
|
+
isa = XCBuildConfiguration;
|
|
224
|
+
buildSettings = {
|
|
225
|
+
HEADER_SEARCH_PATHS = (
|
|
226
|
+
"$(inherited)",
|
|
227
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
228
|
+
"$(SRCROOT)/../../../React/**",
|
|
229
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
230
|
+
);
|
|
231
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
232
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
233
|
+
PRODUCT_NAME = CourierReactNative;
|
|
234
|
+
SKIP_INSTALL = YES;
|
|
235
|
+
SWIFT_OBJC_BRIDGING_HEADER = "CourierReactNative-Bridging-Header.h";
|
|
236
|
+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
|
237
|
+
SWIFT_VERSION = 5.0;
|
|
238
|
+
};
|
|
239
|
+
name = Debug;
|
|
240
|
+
};
|
|
241
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
|
242
|
+
isa = XCBuildConfiguration;
|
|
243
|
+
buildSettings = {
|
|
244
|
+
HEADER_SEARCH_PATHS = (
|
|
245
|
+
"$(inherited)",
|
|
246
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
247
|
+
"$(SRCROOT)/../../../React/**",
|
|
248
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
249
|
+
);
|
|
250
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
251
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
252
|
+
PRODUCT_NAME = CourierReactNative;
|
|
253
|
+
SKIP_INSTALL = YES;
|
|
254
|
+
SWIFT_OBJC_BRIDGING_HEADER = "CourierReactNative-Bridging-Header.h";
|
|
255
|
+
SWIFT_VERSION = 5.0;
|
|
256
|
+
};
|
|
257
|
+
name = Release;
|
|
258
|
+
};
|
|
259
|
+
/* End XCBuildConfiguration section */
|
|
260
|
+
|
|
261
|
+
/* Begin XCConfigurationList section */
|
|
262
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "CourierReactNative" */ = {
|
|
263
|
+
isa = XCConfigurationList;
|
|
264
|
+
buildConfigurations = (
|
|
265
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
|
266
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
|
267
|
+
);
|
|
268
|
+
defaultConfigurationIsVisible = 0;
|
|
269
|
+
defaultConfigurationName = Release;
|
|
270
|
+
};
|
|
271
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "CourierReactNative" */ = {
|
|
272
|
+
isa = XCConfigurationList;
|
|
273
|
+
buildConfigurations = (
|
|
274
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
|
275
|
+
58B511F11A9E6C8500147676 /* Release */,
|
|
276
|
+
);
|
|
277
|
+
defaultConfigurationIsVisible = 0;
|
|
278
|
+
defaultConfigurationName = Release;
|
|
279
|
+
};
|
|
280
|
+
/* End XCConfigurationList section */
|
|
281
|
+
};
|
|
282
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
283
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CourierReactNativeDelegate.h
|
|
3
|
+
// courier-react-native
|
|
4
|
+
//
|
|
5
|
+
// Created by Michael Miller on 10/7/22.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <UIKit/UIKit.h>
|
|
9
|
+
#import <React/RCTBridgeDelegate.h>
|
|
10
|
+
#import <UserNotifications/UserNotifications.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
@interface CourierReactNativeDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, UNUserNotificationCenterDelegate>
|
|
15
|
+
|
|
16
|
+
@property (nonatomic, strong) UIWindow *window;
|
|
17
|
+
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
NS_ASSUME_NONNULL_END
|