@trycourier/courier-react-native 5.6.16 → 5.7.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/README.md +66 -135
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/courierreactnative/CourierClientModule.kt +1 -0
- package/android/src/main/java/com/courierreactnative/CourierSharedModule.kt +3 -0
- package/android/src/main/java/com/courierreactnative/Utils.kt +11 -1
- package/courier-react-native.podspec +1 -1
- package/ios/CourierClientModule.swift +1 -0
- package/ios/CourierReactNativeDelegate.m +1 -1
- package/ios/CourierReactNativeEventEmitter.swift +1 -1
- package/ios/CourierReactNativeModule.m +1 -0
- package/ios/CourierSharedModule.swift +10 -3
- package/ios/Utils.swift +10 -0
- package/lib/commonjs/Broadcaster.js +5 -5
- package/lib/commonjs/Broadcaster.js.map +1 -1
- package/lib/commonjs/CourierApiUrls.js +29 -0
- package/lib/commonjs/CourierApiUrls.js.map +1 -0
- package/lib/commonjs/Modules.js.map +1 -1
- package/lib/commonjs/client/BrandClient.js.map +1 -1
- package/lib/commonjs/client/ClientModule.js.map +1 -1
- package/lib/commonjs/client/CourierClient.js +4 -1
- package/lib/commonjs/client/CourierClient.js.map +1 -1
- package/lib/commonjs/client/InboxClient.js.map +1 -1
- package/lib/commonjs/client/PreferenceClient.js.map +1 -1
- package/lib/commonjs/client/TokenClient.js.map +1 -1
- package/lib/commonjs/client/TrackingClient.js.map +1 -1
- package/lib/commonjs/index.js +22 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/CourierAuthenticationListener.js.map +1 -1
- package/lib/commonjs/models/CourierPushListener.js.map +1 -1
- package/lib/commonjs/models/CourierUserPreferences.js +13 -13
- package/lib/commonjs/models/CourierUserPreferences.js.map +1 -1
- package/lib/commonjs/models/InboxAction.js.map +1 -1
- package/lib/commonjs/models/InboxMessage.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/views/CourierInboxView.js +13 -13
- package/lib/commonjs/views/CourierInboxView.js.map +1 -1
- package/lib/commonjs/views/CourierPreferencesView.js +4 -4
- package/lib/commonjs/views/CourierPreferencesView.js.map +1 -1
- package/lib/module/Broadcaster.js +7 -7
- package/lib/module/Broadcaster.js.map +1 -1
- package/lib/module/CourierApiUrls.js +20 -0
- package/lib/module/CourierApiUrls.js.map +1 -0
- package/lib/module/Modules.js +1 -1
- package/lib/module/Modules.js.map +1 -1
- package/lib/module/client/BrandClient.js +1 -1
- package/lib/module/client/BrandClient.js.map +1 -1
- package/lib/module/client/ClientModule.js +1 -1
- package/lib/module/client/ClientModule.js.map +1 -1
- package/lib/module/client/CourierClient.js +10 -7
- package/lib/module/client/CourierClient.js.map +1 -1
- package/lib/module/client/InboxClient.js +1 -1
- package/lib/module/client/InboxClient.js.map +1 -1
- package/lib/module/client/PreferenceClient.js +1 -1
- package/lib/module/client/PreferenceClient.js.map +1 -1
- package/lib/module/client/TokenClient.js +1 -1
- package/lib/module/client/TokenClient.js.map +1 -1
- package/lib/module/client/TrackingClient.js +1 -1
- package/lib/module/client/TrackingClient.js.map +1 -1
- package/lib/module/index.js +5 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/CourierAuthenticationListener.js +1 -1
- package/lib/module/models/CourierAuthenticationListener.js.map +1 -1
- package/lib/module/models/CourierInboxListener.js +1 -1
- package/lib/module/models/CourierPushListener.js.map +1 -1
- package/lib/module/models/CourierUserPreferences.js +13 -13
- package/lib/module/models/CourierUserPreferences.js.map +1 -1
- package/lib/module/models/InboxAction.js.map +1 -1
- package/lib/module/models/InboxMessage.js +1 -1
- package/lib/module/models/InboxMessage.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/module/views/CourierInboxView.js +18 -18
- package/lib/module/views/CourierInboxView.js.map +1 -1
- package/lib/module/views/CourierPreferencesView.js +7 -7
- package/lib/module/views/CourierPreferencesView.js.map +1 -1
- package/lib/typescript/src/Broadcaster.d.ts +7 -7
- package/lib/typescript/src/Broadcaster.d.ts.map +1 -1
- package/lib/typescript/src/CourierApiUrls.d.ts +11 -0
- package/lib/typescript/src/CourierApiUrls.d.ts.map +1 -0
- package/lib/typescript/src/Modules.d.ts.map +1 -1
- package/lib/typescript/src/client/BrandClient.d.ts +1 -1
- package/lib/typescript/src/client/BrandClient.d.ts.map +1 -1
- package/lib/typescript/src/client/ClientModule.d.ts +1 -1
- package/lib/typescript/src/client/ClientModule.d.ts.map +1 -1
- package/lib/typescript/src/client/CourierClient.d.ts +9 -6
- package/lib/typescript/src/client/CourierClient.d.ts.map +1 -1
- package/lib/typescript/src/client/InboxClient.d.ts +1 -1
- package/lib/typescript/src/client/InboxClient.d.ts.map +1 -1
- package/lib/typescript/src/client/PreferenceClient.d.ts +1 -1
- package/lib/typescript/src/client/PreferenceClient.d.ts.map +1 -1
- package/lib/typescript/src/client/TokenClient.d.ts +1 -1
- package/lib/typescript/src/client/TokenClient.d.ts.map +1 -1
- package/lib/typescript/src/client/TrackingClient.d.ts +1 -1
- package/lib/typescript/src/client/TrackingClient.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/models/Android_CourierSheet.d.ts +1 -1
- package/lib/typescript/src/models/Android_CourierSheet.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierAuthenticationListener.d.ts +1 -1
- package/lib/typescript/src/models/CourierAuthenticationListener.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierBrand.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierButton.d.ts +1 -1
- package/lib/typescript/src/models/CourierButton.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierFont.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierInboxListener.d.ts +1 -1
- package/lib/typescript/src/models/CourierInboxMessages.d.ts +1 -1
- package/lib/typescript/src/models/CourierInboxTheme.d.ts +3 -3
- package/lib/typescript/src/models/CourierInboxTheme.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierInfoViewStyle.d.ts +2 -2
- package/lib/typescript/src/models/CourierInfoViewStyle.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierPreferencesTheme.d.ts +6 -6
- package/lib/typescript/src/models/CourierPreferencesTheme.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierPushListener.d.ts.map +1 -1
- package/lib/typescript/src/models/CourierUserPreferences.d.ts +1 -1
- package/lib/typescript/src/models/CourierUserPreferences.d.ts.map +1 -1
- package/lib/typescript/src/models/InboxAction.d.ts.map +1 -1
- package/lib/typescript/src/models/InboxMessage.d.ts +1 -1
- package/lib/typescript/src/models/InboxMessage.d.ts.map +1 -1
- package/lib/typescript/src/models/InboxMessageEvent.d.ts.map +1 -1
- package/lib/typescript/src/models/InboxMessageSet.d.ts +1 -1
- package/lib/typescript/src/models/iOS_CourierCell.d.ts.map +1 -1
- package/lib/typescript/src/models/iOS_CourierSheet.d.ts +1 -1
- package/lib/typescript/src/models/iOS_CourierSheet.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/lib/typescript/src/views/CourierInboxView.d.ts +5 -5
- package/lib/typescript/src/views/CourierInboxView.d.ts.map +1 -1
- package/lib/typescript/src/views/CourierPreferencesView.d.ts +3 -3
- package/lib/typescript/src/views/CourierPreferencesView.d.ts.map +1 -1
- package/package.json +8 -4
- package/src/Broadcaster.tsx +21 -15
- package/src/CourierApiUrls.tsx +30 -0
- package/src/Modules.tsx +22 -13
- package/src/client/BrandClient.tsx +6 -6
- package/src/client/ClientModule.tsx +4 -6
- package/src/client/CourierClient.tsx +20 -13
- package/src/client/InboxClient.tsx +40 -13
- package/src/client/PreferenceClient.tsx +47 -21
- package/src/client/TokenClient.tsx +14 -7
- package/src/client/TrackingClient.tsx +7 -6
- package/src/index.tsx +208 -115
- package/src/models/Android_CourierSheet.tsx +5 -5
- package/src/models/CourierAuthenticationListener.tsx +5 -9
- package/src/models/CourierBrand.tsx +6 -6
- package/src/models/CourierButton.tsx +5 -5
- package/src/models/CourierDevice.tsx +1 -1
- package/src/models/CourierFont.tsx +4 -4
- package/src/models/CourierInboxListener.tsx +3 -3
- package/src/models/CourierInboxMessages.tsx +2 -2
- package/src/models/CourierInboxTheme.tsx +55 -42
- package/src/models/CourierInfoViewStyle.tsx +5 -5
- package/src/models/CourierPaging.tsx +1 -1
- package/src/models/CourierPreferencesTheme.tsx +32 -27
- package/src/models/CourierPushListener.tsx +9 -7
- package/src/models/CourierPushProvider.tsx +1 -1
- package/src/models/CourierTrackingEvent.tsx +6 -6
- package/src/models/CourierUserPreferences.tsx +32 -28
- package/src/models/InboxAction.tsx +2 -6
- package/src/models/InboxMessage.tsx +4 -5
- package/src/models/InboxMessageEvent.tsx +7 -1
- package/src/models/InboxMessageFeed.tsx +1 -1
- package/src/models/InboxMessageSet.tsx +1 -1
- package/src/models/iOS_CourierCell.tsx +10 -5
- package/src/models/iOS_CourierSheet.tsx +4 -4
- package/src/utils.tsx +4 -7
- package/src/views/CourierInboxView.tsx +79 -71
- package/src/views/CourierPreferencesView.tsx +34 -35
- package/lib/example/src/App.js +0 -11
- package/lib/example/src/Emitter.js +0 -11
- package/lib/example/src/Env.js +0 -6
- package/lib/example/src/Home.js +0 -67
- package/lib/example/src/Poke.js +0 -75
- package/lib/example/src/Tabs.js +0 -36
- package/lib/example/src/Utils.js +0 -71
- package/lib/example/src/pages/Auth.js +0 -224
- package/lib/example/src/pages/Inbox.js +0 -38
- package/lib/example/src/pages/Preferences.js +0 -13
- package/lib/example/src/pages/PreferencesStack.js +0 -11
- package/lib/example/src/pages/Push.js +0 -93
- package/lib/example/src/pages/Styles.js +0 -26
- package/lib/example/src/pages/Tests.js +0 -1068
- package/lib/example/src/pages/inbox/InboxCustom.js +0 -141
- package/lib/example/src/pages/inbox/InboxDefault.js +0 -22
- package/lib/example/src/pages/inbox/InboxStyled.js +0 -220
- package/lib/example/src/pages/preferences/PreferencesCustom.js +0 -91
- package/lib/example/src/pages/preferences/PreferencesDefault.js +0 -17
- package/lib/example/src/pages/preferences/PreferencesDetail.js +0 -127
- package/lib/example/src/pages/preferences/PreferencesStyled.js +0 -110
- package/lib/package.json +0 -171
- package/lib/src/Broadcaster.js +0 -24
- package/lib/src/Modules.js +0 -26
- package/lib/src/client/BrandClient.js +0 -17
- package/lib/src/client/ClientModule.js +0 -14
- package/lib/src/client/CourierClient.js +0 -31
- package/lib/src/client/InboxClient.js +0 -99
- package/lib/src/client/PreferenceClient.js +0 -63
- package/lib/src/client/TokenClient.js +0 -27
- package/lib/src/client/TrackingClient.js +0 -17
- package/lib/src/index.js +0 -567
- package/lib/src/models/Android_CourierSheet.js +0 -1
- package/lib/src/models/CourierAuthenticationListener.js +0 -14
- package/lib/src/models/CourierBrand.js +0 -1
- package/lib/src/models/CourierButton.js +0 -1
- package/lib/src/models/CourierDevice.js +0 -1
- package/lib/src/models/CourierFont.js +0 -1
- package/lib/src/models/CourierInboxListener.js +0 -20
- package/lib/src/models/CourierInboxMessages.js +0 -1
- package/lib/src/models/CourierInboxTheme.js +0 -1
- package/lib/src/models/CourierInfoViewStyle.js +0 -1
- package/lib/src/models/CourierPaging.js +0 -1
- package/lib/src/models/CourierPreferencesTheme.js +0 -1
- package/lib/src/models/CourierPushListener.js +0 -14
- package/lib/src/models/CourierPushProvider.js +0 -8
- package/lib/src/models/CourierTrackingEvent.js +0 -8
- package/lib/src/models/CourierUserPreferences.js +0 -51
- package/lib/src/models/InboxAction.js +0 -1
- package/lib/src/models/InboxMessage.js +0 -1
- package/lib/src/models/InboxMessageFeed.js +0 -1
- package/lib/src/models/InboxMessageSet.js +0 -1
- package/lib/src/models/iOS_CourierCell.js +0 -1
- package/lib/src/models/iOS_CourierSheet.js +0 -1
- package/lib/src/utils.js +0 -27
- package/lib/src/views/CourierInboxView.js +0 -75
- package/lib/src/views/CourierPreferencesView.js +0 -33
package/README.md
CHANGED
|
@@ -1,144 +1,61 @@
|
|
|
1
1
|
<img width="1040" alt="banner-react-native" src="https://github.com/user-attachments/assets/c38f52d8-792f-4b51-a423-f1c5dd9f996b">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- AUTO-GENERATED-OVERVIEW:START — Do not edit this section. It is synced from mintlify-docs. -->
|
|
4
|
+
# Courier React Native SDK
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
The Courier React Native SDK provides prebuilt components and TypeScript APIs for adding in-app notifications, push notifications, and notification preferences to your React Native app. It handles authentication, token management, and real-time message delivery across iOS and Android from a single codebase.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
<thead>
|
|
9
|
-
<tr>
|
|
10
|
-
<th width="920px" align="left">Requirements</th>
|
|
11
|
-
<th width="120px" align="center"></th>
|
|
12
|
-
</tr>
|
|
13
|
-
</thead>
|
|
14
|
-
<tbody>
|
|
15
|
-
<tr width="600px">
|
|
16
|
-
<td align="left">Courier Account</td>
|
|
17
|
-
<td align="center">
|
|
18
|
-
<a href="https://app.courier.com/channels/courier">
|
|
19
|
-
<code>Sign Up</code>
|
|
20
|
-
</a>
|
|
21
|
-
</td>
|
|
22
|
-
</tr>
|
|
23
|
-
<tr width="600px">
|
|
24
|
-
<td align="left">Minimum iOS SDK Version</td>
|
|
25
|
-
<td align="center">
|
|
26
|
-
<code>15.0</code>
|
|
27
|
-
</td>
|
|
28
|
-
</tr>
|
|
29
|
-
<tr width="600px">
|
|
30
|
-
<td align="left">Minimum Android SDK Version</td>
|
|
31
|
-
<td align="center">
|
|
32
|
-
<code>23</code>
|
|
33
|
-
</td>
|
|
34
|
-
</tr>
|
|
35
|
-
</tbody>
|
|
36
|
-
</table>
|
|
37
|
-
|
|
38
|
-
 
|
|
39
|
-
|
|
40
|
-
# Installation
|
|
8
|
+
## Installation
|
|
41
9
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```sh
|
|
10
|
+
```bash
|
|
45
11
|
npm install @trycourier/courier-react-native
|
|
46
12
|
```
|
|
47
13
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
14
|
+
Also available via `yarn add @trycourier/courier-react-native`.
|
|
15
|
+
|
|
16
|
+
Requires iOS 15.0+, Android SDK 23+, and Gradle 8.4+. Run `cd ios && pod install` after installing.
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```jsx
|
|
21
|
+
import Courier, {
|
|
22
|
+
CourierInboxView,
|
|
23
|
+
CourierPreferencesView,
|
|
24
|
+
} from "@trycourier/courier-react-native";
|
|
25
|
+
|
|
26
|
+
// Sign in the user (JWT generated by your backend)
|
|
27
|
+
await Courier.shared.signIn({
|
|
28
|
+
userId: "user_123",
|
|
29
|
+
accessToken: jwt,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Add a prebuilt Inbox component
|
|
33
|
+
<CourierInboxView
|
|
34
|
+
onClickInboxMessageAtIndex={(message, index) => {
|
|
35
|
+
message.read
|
|
36
|
+
? Courier.shared.unreadMessage({ messageId: message.messageId })
|
|
37
|
+
: Courier.shared.readMessage({ messageId: message.messageId });
|
|
38
|
+
}}
|
|
39
|
+
style={{ flex: 1 }}
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
// Add a prebuilt Preferences component
|
|
43
|
+
<CourierPreferencesView
|
|
44
|
+
mode={{ type: "topic" }}
|
|
45
|
+
style={{ flex: 1 }}
|
|
46
|
+
/>
|
|
52
47
|
```
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## iOS
|
|
49
|
+
For Expo projects, see the [Expo setup guide](https://github.com/trycourier/courier-react-native/blob/master/Docs/6_Expo.md).
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<img width="470" alt="Screenshot 2025-01-21 at 12 55 34 PM" src="https://github.com/user-attachments/assets/ee7722b2-ce6a-4dc4-8b30-94f42494d80a" />
|
|
51
|
+
## Documentation
|
|
61
52
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
```sh
|
|
65
|
-
# Resolve react_native_pods.rb with node to allow for hoisting
|
|
66
|
-
require Pod::Executable.execute_command('node', ['-p'..
|
|
67
|
-
|
|
68
|
-
# Courier React Native requires iOS 15+
|
|
69
|
-
platform :ios, '15.0' // Add this line
|
|
70
|
-
prepare_react_native_project!
|
|
71
|
-
|
|
72
|
-
..
|
|
73
|
-
```
|
|
53
|
+
Full documentation: **[courier.com/docs/sdk-libraries/react-native](https://www.courier.com/docs/sdk-libraries/react-native/)**
|
|
74
54
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```sh
|
|
80
|
-
cd ios && pod install
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
 
|
|
84
|
-
|
|
85
|
-
## Android
|
|
86
|
-
|
|
87
|
-
### 1. Add the Jitpack repository
|
|
88
|
-
|
|
89
|
-
In your `android/build.gradle` make sure your build and repository values are as follows
|
|
90
|
-
|
|
91
|
-
```gradle
|
|
92
|
-
buildscript {
|
|
93
|
-
|
|
94
|
-
ext {
|
|
95
|
-
|
|
96
|
-
// Double check these values
|
|
97
|
-
buildToolsVersion = "33.0.0"
|
|
98
|
-
minSdkVersion = 23
|
|
99
|
-
compileSdkVersion = 33
|
|
100
|
-
targetSdkVersion = 33
|
|
101
|
-
..
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
repositories {
|
|
105
|
-
google()
|
|
106
|
-
mavenCentral()
|
|
107
|
-
maven { url 'https://www.jitpack.io' } // THIS LINE
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
..
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### 2. Run Gradle Sync
|
|
116
|
-
|
|
117
|
-
Your app must support at least gradle `8.4`
|
|
118
|
-
|
|
119
|
-
 
|
|
120
|
-
|
|
121
|
-
### 3. Extend your `MainActivity` with `CourierReactNativeActivity`
|
|
122
|
-
|
|
123
|
-
This allows the Courier SDK to manage the current user between app sessions.
|
|
124
|
-
|
|
125
|
-
Java
|
|
126
|
-
```java
|
|
127
|
-
import com.courierreactnative.CourierReactNativeActivity;
|
|
128
|
-
|
|
129
|
-
public class MainActivity extends CourierReactNativeActivity {
|
|
130
|
-
..
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Kotlin
|
|
135
|
-
```kotlin
|
|
136
|
-
import com.courierreactnative.CourierReactNativeActivity;
|
|
137
|
-
|
|
138
|
-
class MainActivity : CourierReactNativeActivity() {
|
|
139
|
-
..
|
|
140
|
-
}
|
|
141
|
-
```
|
|
55
|
+
- [Inbox Overview](https://www.courier.com/docs/platform/inbox/inbox-overview/)
|
|
56
|
+
- [Authentication](https://www.courier.com/docs/platform/inbox/authentication/)
|
|
57
|
+
- [Push Integrations](https://www.courier.com/docs/external-integrations/push/intro-to-push/)
|
|
58
|
+
<!-- AUTO-GENERATED-OVERVIEW:END -->
|
|
142
59
|
|
|
143
60
|
 
|
|
144
61
|
|
|
@@ -160,12 +77,12 @@ These are all the available features of the SDK.
|
|
|
160
77
|
1
|
|
161
78
|
</td>
|
|
162
79
|
<td align="left">
|
|
163
|
-
<a href="https://
|
|
80
|
+
<a href="https://www.courier.com/docs/sdk-libraries/react-native/#authentication">
|
|
164
81
|
<code>Authentication</code>
|
|
165
82
|
</a>
|
|
166
83
|
</td>
|
|
167
84
|
<td align="left">
|
|
168
|
-
Manages user credentials between app sessions. Required if you would like to use <a href="https://
|
|
85
|
+
Manages user credentials between app sessions. Required if you would like to use <a href="https://www.courier.com/docs/sdk-libraries/react-native/#inbox"><code>Courier Inbox</code></a> and <a href="https://www.courier.com/docs/sdk-libraries/react-native/#push-notifications"><code>Push Notifications</code></a>.
|
|
169
86
|
</td>
|
|
170
87
|
</tr>
|
|
171
88
|
<tr width="600px">
|
|
@@ -173,7 +90,7 @@ These are all the available features of the SDK.
|
|
|
173
90
|
2
|
|
174
91
|
</td>
|
|
175
92
|
<td align="left">
|
|
176
|
-
<a href="https://
|
|
93
|
+
<a href="https://www.courier.com/docs/sdk-libraries/react-native/#inbox">
|
|
177
94
|
<code>Inbox</code>
|
|
178
95
|
</a>
|
|
179
96
|
</td>
|
|
@@ -186,7 +103,7 @@ These are all the available features of the SDK.
|
|
|
186
103
|
3
|
|
187
104
|
</td>
|
|
188
105
|
<td align="left">
|
|
189
|
-
<a href="https://
|
|
106
|
+
<a href="https://www.courier.com/docs/sdk-libraries/react-native/#push-notifications">
|
|
190
107
|
<code>Push Notifications</code>
|
|
191
108
|
</a>
|
|
192
109
|
</td>
|
|
@@ -199,7 +116,7 @@ These are all the available features of the SDK.
|
|
|
199
116
|
4
|
|
200
117
|
</td>
|
|
201
118
|
<td align="left">
|
|
202
|
-
<a href="https://
|
|
119
|
+
<a href="https://www.courier.com/docs/sdk-libraries/react-native/#preferences">
|
|
203
120
|
<code>Preferences</code>
|
|
204
121
|
</a>
|
|
205
122
|
</td>
|
|
@@ -212,7 +129,7 @@ These are all the available features of the SDK.
|
|
|
212
129
|
5
|
|
213
130
|
</td>
|
|
214
131
|
<td align="left">
|
|
215
|
-
<a href="https://
|
|
132
|
+
<a href="https://www.courier.com/docs/sdk-libraries/react-native/#courierclient">
|
|
216
133
|
<code>CourierClient</code>
|
|
217
134
|
</a>
|
|
218
135
|
</td>
|
|
@@ -227,7 +144,7 @@ These are all the available features of the SDK.
|
|
|
227
144
|
|
|
228
145
|
# Expo
|
|
229
146
|
|
|
230
|
-
If you are using Expo, you should check out the [Expo Docs](https://
|
|
147
|
+
If you are using Expo, you should check out the [Expo Docs](https://www.courier.com/docs/sdk-libraries/react-native/#expo) for all the details.
|
|
231
148
|
|
|
232
149
|
 
|
|
233
150
|
|
|
@@ -259,3 +176,17 @@ Starter projects using this SDK.
|
|
|
259
176
|
We want to make this the best SDK for managing notifications! Have an idea or feedback about our SDKs? Let us know!
|
|
260
177
|
|
|
261
178
|
[Courier React Native Issues](https://github.com/trycourier/courier-react-native/issues)
|
|
179
|
+
|
|
180
|
+
## EU endpoints
|
|
181
|
+
|
|
182
|
+
If your workspace uses EU-hosted Courier endpoints, pass the built-in EU preset through `apiUrls`.
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
import Courier, { getCourierApiUrlsForRegion } from "@trycourier/courier-react-native";
|
|
186
|
+
|
|
187
|
+
await Courier.shared.signIn({
|
|
188
|
+
userId: "your_user_id",
|
|
189
|
+
accessToken: jwt,
|
|
190
|
+
apiUrls: getCourierApiUrlsForRegion("eu")
|
|
191
|
+
});
|
|
192
|
+
```
|
package/android/build.gradle
CHANGED
|
@@ -110,7 +110,7 @@ dependencies {
|
|
|
110
110
|
implementation 'com.google.code.gson:gson:2.11.0'
|
|
111
111
|
|
|
112
112
|
// Courier Core SDK
|
|
113
|
-
api 'com.github.trycourier:courier-android:5.
|
|
113
|
+
api 'com.github.trycourier:courier-android:5.3.0'
|
|
114
114
|
api 'androidx.recyclerview:recyclerview:1.3.2'
|
|
115
115
|
|
|
116
116
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.courierreactnative
|
|
2
2
|
|
|
3
3
|
import com.courier.android.Courier
|
|
4
|
+
import com.courier.android.client.CourierClient
|
|
4
5
|
import com.courier.android.models.CourierAuthenticationListener
|
|
5
6
|
import com.courier.android.models.CourierInboxListener
|
|
6
7
|
import com.courier.android.models.InboxMessageSet
|
|
@@ -92,6 +93,7 @@ class CourierSharedModule(
|
|
|
92
93
|
clientKey: String?,
|
|
93
94
|
userId: String,
|
|
94
95
|
tenantId: String?,
|
|
96
|
+
apiUrls: com.facebook.react.bridge.ReadableMap?,
|
|
95
97
|
showLogs: Boolean,
|
|
96
98
|
promise: Promise
|
|
97
99
|
) {
|
|
@@ -101,6 +103,7 @@ class CourierSharedModule(
|
|
|
101
103
|
tenantId = tenantId,
|
|
102
104
|
accessToken = accessToken,
|
|
103
105
|
clientKey = clientKey,
|
|
106
|
+
apiUrls = apiUrls?.toApiUrls() ?: CourierClient.ApiUrls(),
|
|
104
107
|
showLogs = showLogs
|
|
105
108
|
)
|
|
106
109
|
promise.resolve(null)
|
|
@@ -15,7 +15,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
|
15
15
|
import com.google.gson.GsonBuilder
|
|
16
16
|
|
|
17
17
|
internal object Utils {
|
|
18
|
-
val COURIER_AGENT = CourierAgent.ReactNativeAndroid(version = "5.
|
|
18
|
+
val COURIER_AGENT = CourierAgent.ReactNativeAndroid(version = "5.7.0")
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
internal fun ReactContext.sendEvent(eventName: String, value: Any?) {
|
|
@@ -76,6 +76,16 @@ internal fun ReadableMap.toInfoViewStyle(context: Context): CourierStyles.InfoVi
|
|
|
76
76
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
internal fun ReadableMap.toApiUrls(): com.courier.android.client.CourierClient.ApiUrls {
|
|
80
|
+
val defaults = com.courier.android.client.CourierClient.ApiUrls()
|
|
81
|
+
return com.courier.android.client.CourierClient.ApiUrls(
|
|
82
|
+
rest = getString("rest") ?: defaults.rest,
|
|
83
|
+
graphql = getString("graphql") ?: defaults.graphql,
|
|
84
|
+
inboxGraphql = getString("inboxGraphql") ?: defaults.inboxGraphql,
|
|
85
|
+
inboxWebSocket = getString("inboxWebSocket") ?: defaults.inboxWebSocket
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
79
89
|
internal fun Map<String, Any>?.toWritableMap(): WritableMap {
|
|
80
90
|
val map = Arguments.createMap()
|
|
81
91
|
this?.forEach { (key, value) ->
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
# Courier Core Dependency
|
|
20
|
-
s.dependency "Courier_iOS", "5.
|
|
20
|
+
s.dependency "Courier_iOS", "5.8.0"
|
|
21
21
|
|
|
22
22
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
23
23
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
@@ -25,6 +25,7 @@ internal class CourierClientModule: CourierReactNativeEventEmitter {
|
|
|
25
25
|
userId: userId,
|
|
26
26
|
connectionId: options["connectionId"] as? String,
|
|
27
27
|
tenantId: options["tenantId"] as? String,
|
|
28
|
+
apiUrls: (options["apiUrls"] as? NSDictionary)?.toCourierApiUrls() ?? CourierClient.ApiUrls(),
|
|
28
29
|
showLogs: showLogs
|
|
29
30
|
)
|
|
30
31
|
|
|
@@ -33,7 +33,7 @@ static NSString *const CourierForegroundOptionsDidChangeNotification = @"iosFore
|
|
|
33
33
|
if (self) {
|
|
34
34
|
|
|
35
35
|
// Set the user agent
|
|
36
|
-
Courier.agent = [CourierAgent reactNativeIOS:@"5.
|
|
36
|
+
Courier.agent = [CourierAgent reactNativeIOS:@"5.7.0"];
|
|
37
37
|
|
|
38
38
|
// Register for remote notifications
|
|
39
39
|
UIApplication *app = [UIApplication sharedApplication];
|
|
@@ -14,7 +14,7 @@ internal class CourierReactNativeEventEmitter: RCTEventEmitter {
|
|
|
14
14
|
|
|
15
15
|
// Set the user agent
|
|
16
16
|
// Used to know the platform performing requests
|
|
17
|
-
Courier.agent = CourierAgent.reactNativeIOS("5.
|
|
17
|
+
Courier.agent = CourierAgent.reactNativeIOS("5.7.0")
|
|
18
18
|
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -37,6 +37,7 @@ RCT_EXTERN_METHOD(
|
|
|
37
37
|
withClientKey: (NSString*)clientKey
|
|
38
38
|
withUserId: (NSString*)userId
|
|
39
39
|
withTenantId: (NSString*)tenantId
|
|
40
|
+
withApiUrls: (NSDictionary*)apiUrls
|
|
40
41
|
withShowLogs: (BOOL*)showLogs
|
|
41
42
|
withResolver: (RCTPromiseResolveBlock)resolve
|
|
42
43
|
withRejecter: (RCTPromiseRejectBlock)reject
|
|
@@ -40,7 +40,13 @@ class CourierSharedModule: CourierReactNativeEventEmitter {
|
|
|
40
40
|
"userId": options.userId as Any,
|
|
41
41
|
"connectionId": options.connectionId as Any,
|
|
42
42
|
"tenantId": options.tenantId as Any,
|
|
43
|
-
"showLogs": options.showLogs as Any
|
|
43
|
+
"showLogs": options.showLogs as Any,
|
|
44
|
+
"apiUrls": [
|
|
45
|
+
"rest": options.apiUrls.rest,
|
|
46
|
+
"graphql": options.apiUrls.graphql,
|
|
47
|
+
"inboxGraphql": options.apiUrls.inboxGraphql,
|
|
48
|
+
"inboxWebSocket": options.apiUrls.inboxWebSocket
|
|
49
|
+
] as Any
|
|
44
50
|
]
|
|
45
51
|
.compactMapValues { $0 }
|
|
46
52
|
|
|
@@ -90,8 +96,8 @@ class CourierSharedModule: CourierReactNativeEventEmitter {
|
|
|
90
96
|
}
|
|
91
97
|
}
|
|
92
98
|
|
|
93
|
-
@objc(signIn:withClientKey:withUserId:withTenantId:withShowLogs:withResolver:withRejecter:)
|
|
94
|
-
func signIn(accessToken: String, clientKey: String?, userId: String, tenantId: String?, showLogs: Bool, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
99
|
+
@objc(signIn:withClientKey:withUserId:withTenantId:withApiUrls:withShowLogs:withResolver:withRejecter:)
|
|
100
|
+
func signIn(accessToken: String, clientKey: String?, userId: String, tenantId: String?, apiUrls: NSDictionary?, showLogs: Bool, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
95
101
|
|
|
96
102
|
Task {
|
|
97
103
|
|
|
@@ -100,6 +106,7 @@ class CourierSharedModule: CourierReactNativeEventEmitter {
|
|
|
100
106
|
tenantId: tenantId,
|
|
101
107
|
accessToken: accessToken,
|
|
102
108
|
clientKey: clientKey,
|
|
109
|
+
apiUrls: apiUrls?.toCourierApiUrls() ?? CourierClient.ApiUrls(),
|
|
103
110
|
showLogs: showLogs
|
|
104
111
|
)
|
|
105
112
|
|
package/ios/Utils.swift
CHANGED
|
@@ -157,6 +157,16 @@ internal extension NSDictionary {
|
|
|
157
157
|
)
|
|
158
158
|
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
func toCourierApiUrls() -> CourierClient.ApiUrls {
|
|
162
|
+
let defaults = CourierClient.ApiUrls()
|
|
163
|
+
return CourierClient.ApiUrls(
|
|
164
|
+
rest: self["rest"] as? String ?? defaults.rest,
|
|
165
|
+
graphql: self["graphql"] as? String ?? defaults.graphql,
|
|
166
|
+
inboxGraphql: self["inboxGraphql"] as? String ?? defaults.inboxGraphql,
|
|
167
|
+
inboxWebSocket: self["inboxWebSocket"] as? String ?? defaults.inboxWebSocket
|
|
168
|
+
)
|
|
169
|
+
}
|
|
160
170
|
|
|
161
171
|
}
|
|
162
172
|
|
|
@@ -12,11 +12,11 @@ class Broadcaster {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
* Creates an event listener for the native function
|
|
16
|
+
* @param key Key for the listener
|
|
17
|
+
* @param callback Value returned for the listener callback
|
|
18
|
+
* @returns Subscription
|
|
19
|
+
*/
|
|
20
20
|
async addListener(id, callback) {
|
|
21
21
|
await _Modules.Modules.Shared.attachEmitter(id);
|
|
22
22
|
if (_reactNative.Platform.OS === 'android') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_Modules","Broadcaster","constructor","module","emitter","NativeEventEmitter","addListener","id","callback","Modules","Shared","attachEmitter","Platform","OS","DeviceEventEmitter","event","undefined","exports","default"],"sourceRoot":"../../src","sources":["Broadcaster.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_Modules","Broadcaster","constructor","module","emitter","NativeEventEmitter","addListener","id","callback","Modules","Shared","attachEmitter","Platform","OS","DeviceEventEmitter","event","undefined","exports","default"],"sourceRoot":"../../src","sources":["Broadcaster.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAEe,MAAME,WAAW,CAAC;EAG/BC,WAAWA,CAACC,MAAoB,EAAE;IAChC,IAAI,CAACC,OAAO,GAAG,IAAIC,+BAAkB,CAACF,MAAM,CAAC;EAC/C;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAMG,WAAWA,CACfC,EAAU,EACVC,QAA8B,EACY;IAC1C,MAAMC,gBAAO,CAACC,MAAM,CAACC,aAAa,CAACJ,EAAE,CAAC;IAEtC,IAAIK,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;MAC7B,OAAOC,+BAAkB,CAACR,WAAW,CAACC,EAAE,EAAGQ,KAAU,IACnDP,QAAQ,CAACO,KAAK,CAChB,CAAC;IACH;IAEA,IAAIH,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzB,OAAO,IAAI,CAACT,OAAO,CAACE,WAAW,CAACC,EAAE,EAAGQ,KAAU,IAAKP,QAAQ,CAACO,KAAK,CAAC,CAAC;IACtE;IAEA,OAAOC,SAAS;EAClB;AACF;AAACC,OAAA,CAAAC,OAAA,GAAAjB,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EU_COURIER_API_URLS = exports.DEFAULT_COURIER_API_URLS = void 0;
|
|
7
|
+
exports.getCourierApiUrlsForRegion = getCourierApiUrlsForRegion;
|
|
8
|
+
const DEFAULT_COURIER_API_URLS = {
|
|
9
|
+
rest: 'https://api.courier.com',
|
|
10
|
+
graphql: 'https://api.courier.com/client/q',
|
|
11
|
+
inboxGraphql: 'https://inbox.courier.io/q',
|
|
12
|
+
inboxWebSocket: 'wss://realtime.courier.io'
|
|
13
|
+
};
|
|
14
|
+
exports.DEFAULT_COURIER_API_URLS = DEFAULT_COURIER_API_URLS;
|
|
15
|
+
const EU_COURIER_API_URLS = {
|
|
16
|
+
rest: 'https://api.eu.courier.com',
|
|
17
|
+
graphql: 'https://api.eu.courier.com/client/q',
|
|
18
|
+
inboxGraphql: 'https://inbox.eu.courier.io/q',
|
|
19
|
+
inboxWebSocket: 'wss://realtime.eu.courier.io'
|
|
20
|
+
};
|
|
21
|
+
exports.EU_COURIER_API_URLS = EU_COURIER_API_URLS;
|
|
22
|
+
function getCourierApiUrlsForRegion(region) {
|
|
23
|
+
return region === 'eu' ? {
|
|
24
|
+
...EU_COURIER_API_URLS
|
|
25
|
+
} : {
|
|
26
|
+
...DEFAULT_COURIER_API_URLS
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=CourierApiUrls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_COURIER_API_URLS","rest","graphql","inboxGraphql","inboxWebSocket","exports","EU_COURIER_API_URLS","getCourierApiUrlsForRegion","region"],"sourceRoot":"../../src","sources":["CourierApiUrls.tsx"],"mappings":";;;;;;;AASO,MAAMA,wBAAwC,GAAG;EACtDC,IAAI,EAAE,yBAAyB;EAC/BC,OAAO,EAAE,kCAAkC;EAC3CC,YAAY,EAAE,4BAA4B;EAC1CC,cAAc,EAAE;AAClB,CAAC;AAACC,OAAA,CAAAL,wBAAA,GAAAA,wBAAA;AAEK,MAAMM,mBAAmC,GAAG;EACjDL,IAAI,EAAE,4BAA4B;EAClCC,OAAO,EAAE,qCAAqC;EAC9CC,YAAY,EAAE,+BAA+B;EAC7CC,cAAc,EAAE;AAClB,CAAC;AAACC,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAEK,SAASC,0BAA0BA,CACxCC,MAAwB,EACR;EAChB,OAAOA,MAAM,KAAK,IAAI,GAClB;IAAE,GAAGF;EAAoB,CAAC,GAC1B;IAAE,GAAGN;EAAyB,CAAC;AACrC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","Modules","LINKING_ERROR","Platform","select","ios","default","Client","getNativeModule","NativeModules","CourierClientModule","Shared","CourierSharedModule","System","CourierSystemModule","nativeModule","Proxy","get","Error","getNativeComponent","componentName","UIManager","getViewManagerConfig","requireNativeComponent","exports"],"sourceRoot":"../../src","sources":["Modules.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","Modules","LINKING_ERROR","Platform","select","ios","default","Client","getNativeModule","NativeModules","CourierClientModule","Shared","CourierSharedModule","System","CourierSystemModule","nativeModule","Proxy","get","Error","getNativeComponent","componentName","UIManager","getViewManagerConfig","requireNativeComponent","exports"],"sourceRoot":"../../src","sources":["Modules.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOO,MAAMC,OAAO,CAAC;EACnB,OAAgBC,aAAa,GAC3B,2FAA2F,GAC3FC,qBAAQ,CAACC,MAAM,CAAC;IAAEC,GAAG,EAAE,gCAAgC;IAAEC,OAAO,EAAE;EAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;EAEjC,OAAgBC,MAAM,GAAGN,OAAO,CAACO,eAAe,CAC9CC,0BAAa,CAACC,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGV,OAAO,CAACO,eAAe,CAC9CC,0BAAa,CAACG,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGZ,OAAO,CAACO,eAAe,CAC9CC,0BAAa,CAACK,mBAChB,CAAC;EAED,OAAON,eAAeA,CAAIO,YAA2B,EAAK;IACxD,OAAOA,YAAY,GACfA,YAAY,GACX,IAAIC,KAAK,CACR,CAAC,CAAC,EACF;MACEC,GAAGA,CAAA,EAAG;QACJ,MAAM,IAAIC,KAAK,CAACjB,OAAO,CAACC,aAAa,CAAC;MACxC;IACF,CACF,CAAO;EACb;EAEA,OAAOiB,kBAAkBA,CAACC,aAAqB,EAAE;IAC/C,OAAOC,sBAAS,CAACC,oBAAoB,CAACF,aAAa,CAAC,IAAI,IAAI,GACxD,IAAAG,mCAAsB,EAAMH,aAAa,CAAC,GAC1C,MAAM;MACJ,MAAM,IAAIF,KAAK,CAACjB,OAAO,CAACC,aAAa,CAAC;IACxC,CAAC;EACP;AACF;AAACsB,OAAA,CAAAvB,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Modules","require","BrandClient","constructor","clientId","getBrand","props","json","Modules","Client","brandId","JSON","parse","exports"],"sourceRoot":"../../../src","sources":["client/BrandClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAMC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"names":["_Modules","require","BrandClient","constructor","clientId","getBrand","props","json","Modules","Client","brandId","JSON","parse","exports"],"sourceRoot":"../../../src","sources":["client/BrandClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAMC,WAAW,CAAC;EAGvBC,WAAWA,CAACC,QAAgB,EAAE;IAC5B,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAaC,QAAQA,CAACC,KAErB,EAAiC;IAChC,MAAMC,IAAI,GAAG,MAAMC,gBAAO,CAACC,MAAM,CAACJ,QAAQ,CAAC,IAAI,CAACD,QAAQ,EAAEE,KAAK,CAACI,OAAO,CAAC;IACxE,OAAOC,IAAI,CAACC,KAAK,CAACL,IAAI,CAAC;EACzB;AACF;AAACM,OAAA,CAAAX,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Modules","require","ClientModule","constructor","options","clientId","add","Modules","Client","addClient","remove","removeClient","exports"],"sourceRoot":"../../../src","sources":["client/ClientModule.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAeC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"names":["_Modules","require","ClientModule","constructor","options","clientId","add","Modules","Client","addClient","remove","removeClient","exports"],"sourceRoot":"../../../src","sources":["client/ClientModule.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAeC,YAAY,CAAC;EAGjC;EACAC,WAAWA,CAACC,OAA6B,EAAE;IACzC,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACC,GAAG,CAACF,OAAO,CAAC;EACnC;EAEQE,GAAGA,CAACF,OAA6B,EAAU;IACjD,OAAOG,gBAAO,CAACC,MAAM,CAACC,SAAS,CAACL,OAAO,CAAC;EAC1C;EAEOM,MAAMA,CAAA,EAAW;IACtB,OAAOH,gBAAO,CAACC,MAAM,CAACG,YAAY,CAAC,IAAI,CAACN,QAAQ,CAAC;EACnD;AACF;AAACO,OAAA,CAAAV,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -18,7 +18,10 @@ class CourierClient extends _ClientModule.ClientModule {
|
|
|
18
18
|
jwt: props.jwt,
|
|
19
19
|
clientKey: props.clientKey,
|
|
20
20
|
connectionId: props.clientKey,
|
|
21
|
-
tenantId: props.tenantId
|
|
21
|
+
tenantId: props.tenantId,
|
|
22
|
+
apiUrls: props.apiUrls ? {
|
|
23
|
+
...props.apiUrls
|
|
24
|
+
} : undefined
|
|
22
25
|
};
|
|
23
26
|
super(options);
|
|
24
27
|
this.options = options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_","require","_ClientModule","_InboxClient","_PreferenceClient","_TokenClient","_TrackingClient","CourierClient","ClientModule","constructor","props","options","userId","showLogs","__DEV__","jwt","clientKey","connectionId","tenantId","tokens","TokenClient","clientId","brands","BrandClient","inbox","InboxClient","preferences","PreferenceClient","tracking","TrackingClient","exports"],"sourceRoot":"../../../src","sources":["client/CourierClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;
|
|
1
|
+
{"version":3,"names":["_","require","_ClientModule","_InboxClient","_PreferenceClient","_TokenClient","_TrackingClient","CourierClient","ClientModule","constructor","props","options","userId","showLogs","__DEV__","jwt","clientKey","connectionId","tenantId","apiUrls","undefined","tokens","TokenClient","clientId","brands","BrandClient","inbox","InboxClient","preferences","PreferenceClient","tracking","TrackingClient","exports"],"sourceRoot":"../../../src","sources":["client/CourierClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAaO,MAAMM,aAAa,SAASC,0BAAY,CAAC;EAQ9CC,WAAWA,CAACC,KAQX,EAAE;IACD,MAAMC,OAAO,GAAG;MACdC,MAAM,EAAEF,KAAK,CAACE,MAAM;MACpBC,QAAQ,EAAEH,KAAK,CAACG,QAAQ,IAAIC,OAAO;MACnCC,GAAG,EAAEL,KAAK,CAACK,GAAG;MACdC,SAAS,EAAEN,KAAK,CAACM,SAAS;MAC1BC,YAAY,EAAEP,KAAK,CAACM,SAAS;MAC7BE,QAAQ,EAAER,KAAK,CAACQ,QAAQ;MACxBC,OAAO,EAAET,KAAK,CAACS,OAAO,GAAG;QAAE,GAAGT,KAAK,CAACS;MAAQ,CAAC,GAAGC;IAClD,CAAC;IAED,KAAK,CAACT,OAAO,CAAC;IAEd,IAAI,CAACA,OAAO,GAAGA,OAAO;IAEtB,IAAI,CAACU,MAAM,GAAG,IAAIC,wBAAW,CAAC,IAAI,CAACC,QAAQ,CAAC;IAC5C,IAAI,CAACC,MAAM,GAAG,IAAIC,aAAW,CAAC,IAAI,CAACF,QAAQ,CAAC;IAC5C,IAAI,CAACG,KAAK,GAAG,IAAIC,wBAAW,CAAC,IAAI,CAACJ,QAAQ,CAAC;IAC3C,IAAI,CAACK,WAAW,GAAG,IAAIC,kCAAgB,CAAC,IAAI,CAACN,QAAQ,CAAC;IACtD,IAAI,CAACO,QAAQ,GAAG,IAAIC,8BAAc,CAAC,IAAI,CAACR,QAAQ,CAAC;EACnD;AACF;AAACS,OAAA,CAAAzB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Modules","require","InboxClient","constructor","clientId","getMessages","props","json","Modules","Client","paginationLimit","startCursor","JSON","parse","getArchivedMessages","getMessageById","messageId","getUnreadMessageCount","open","openMessage","read","readMessage","unread","unreadMessage","click","clickMessage","trackingId","archive","archiveMessage","readAll","readAllMessages","exports"],"sourceRoot":"../../../src","sources":["client/InboxClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_Modules","require","InboxClient","constructor","clientId","getMessages","props","json","Modules","Client","paginationLimit","startCursor","JSON","parse","getArchivedMessages","getMessageById","messageId","getUnreadMessageCount","open","openMessage","read","readMessage","unread","unreadMessage","click","clickMessage","trackingId","archive","archiveMessage","readAll","readAllMessages","exports"],"sourceRoot":"../../../src","sources":["client/InboxClient.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Modules","require","PreferenceClient","constructor","clientId","getUserPreferences","props","json","Modules","Client","paginationCursor","rawData","JSON","parse","items","map","item","defaultStatus","default_status","hasCustomRouting","has_custom_routing","customRouting","custom_routing","channel","status","topicId","topic_id","topicName","topic_name","sectionName","section_name","sectionId","section_id","paging","getUserPreferenceTopic","convertedTopic","putUserPreferenceTopic","exports"],"sourceRoot":"../../../src","sources":["client/PreferenceClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_Modules","require","PreferenceClient","constructor","clientId","getUserPreferences","props","json","Modules","Client","paginationCursor","rawData","JSON","parse","items","map","item","defaultStatus","default_status","hasCustomRouting","has_custom_routing","customRouting","custom_routing","channel","status","topicId","topic_id","topicName","topic_name","sectionName","section_name","sectionId","section_id","paging","getUserPreferenceTopic","convertedTopic","putUserPreferenceTopic","exports"],"sourceRoot":"../../../src","sources":["client/PreferenceClient.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,gBAAgB,CAAC;EAG5BC,WAAWA,CAACC,QAAgB,EAAE;IAC5B,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAaC,kBAAkBA,CAACC,KAE/B,EAAmC;IAClC,MAAMC,IAAI,GAAG,MAAMC,gBAAO,CAACC,MAAM,CAACJ,kBAAkB,CAClD,IAAI,CAACD,QAAQ,EACbE,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEI,gBACT,CAAC;IAED,MAAMC,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACN,IAAI,CAAC;IAEhC,OAAO;MACLO,KAAK,EAAEH,OAAO,CAACG,KAAK,CAACC,GAAG,CAAEC,IAAS,KAAM;QACvCC,aAAa,EAAED,IAAI,CAACE,cAA8C;QAClEC,gBAAgB,EAAEH,IAAI,CAACI,kBAAkB;QACzCC,aAAa,EAAEL,IAAI,CAACM,cAAc,CAACP,GAAG,CACnCQ,OAAe,IAAKA,OACvB,CAAC;QACDC,MAAM,EAAER,IAAI,CAACQ,MAAsC;QACnDC,OAAO,EAAET,IAAI,CAACU,QAAQ;QACtBC,SAAS,EAAEX,IAAI,CAACY,UAAU;QAC1BC,WAAW,EAAEb,IAAI,CAACc,YAAY;QAC9BC,SAAS,EAAEf,IAAI,CAACgB;MAClB,CAAC,CAAC,CAAC;MACHC,MAAM,EAAEtB,OAAO,CAACsB;IAClB,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAaC,sBAAsBA,CAAC5B,KAEnC,EAAwC;IACvC,MAAMC,IAAI,GAAG,MAAMC,gBAAO,CAACC,MAAM,CAACyB,sBAAsB,CACtD,IAAI,CAAC9B,QAAQ,EACbE,KAAK,CAACmB,OACR,CAAC;IACD,MAAMd,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACN,IAAI,CAAC;IAEhC,MAAM4B,cAA2C,GAAG;MAClDlB,aAAa,EAAEN,OAAO,CAACO,cAA8C;MACrEC,gBAAgB,EAAER,OAAO,CAACS,kBAAkB;MAC5CC,aAAa,EAAEV,OAAO,CAACW,cAAc,CAACP,GAAG,CACtCQ,OAAe,IAAKA,OACvB,CAAC;MACDC,MAAM,EAAEb,OAAO,CAACa,MAAsC;MACtDC,OAAO,EAAEd,OAAO,CAACe,QAAQ;MACzBC,SAAS,EAAEhB,OAAO,CAACiB,UAAU;MAC7BC,WAAW,EAAElB,OAAO,CAACmB,YAAY;MACjCC,SAAS,EAAEpB,OAAO,CAACqB;IACrB,CAAC;IAED,OAAOG,cAAc;EACvB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAaC,sBAAsBA,CAAC9B,KAKnC,EAAiB;IAChB,MAAME,gBAAO,CAACC,MAAM,CAAC2B,sBAAsB,CACzC,IAAI,CAAChC,QAAQ,EACbE,KAAK,CAACmB,OAAO,EACbnB,KAAK,CAACkB,MAAM,EACZlB,KAAK,CAACa,gBAAgB,EACtBb,KAAK,CAACe,aACR,CAAC;EACH;AACF;AAACgB,OAAA,CAAAnC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Modules","require","TokenClient","constructor","clientId","putUserToken","props","Modules","Client","token","provider","device","deleteUserToken","exports"],"sourceRoot":"../../../src","sources":["client/TokenClient.tsx"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"names":["_Modules","require","TokenClient","constructor","clientId","putUserToken","props","Modules","Client","token","provider","device","deleteUserToken","exports"],"sourceRoot":"../../../src","sources":["client/TokenClient.tsx"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,WAAW,CAAC;EAGvBC,WAAWA,CAACC,QAAgB,EAAE;IAC5B,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAaC,YAAYA,CAACC,KAIzB,EAAiB;IAChB,MAAMC,gBAAO,CAACC,MAAM,CAACH,YAAY,CAC/B,IAAI,CAACD,QAAQ,EACbE,KAAK,CAACG,KAAK,EACXH,KAAK,CAACI,QAAQ,EACdJ,KAAK,CAACK,MACR,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,MAAaC,eAAeA,CAACN,KAAwB,EAAiB;IACpE,MAAMC,gBAAO,CAACC,MAAM,CAACI,eAAe,CAAC,IAAI,CAACR,QAAQ,EAAEE,KAAK,CAACG,KAAK,CAAC;EAClE;AACF;AAACI,OAAA,CAAAX,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Modules","require","TrackingClient","constructor","clientId","postTrackingUrl","props","Modules","Client","url","event","exports"],"sourceRoot":"../../../src","sources":["client/TrackingClient.tsx"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"names":["_Modules","require","TrackingClient","constructor","clientId","postTrackingUrl","props","Modules","Client","url","event","exports"],"sourceRoot":"../../../src","sources":["client/TrackingClient.tsx"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,cAAc,CAAC;EAG1BC,WAAWA,CAACC,QAAgB,EAAE;IAC5B,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAaC,eAAeA,CAACC,KAG5B,EAAiB;IAChB,MAAMC,gBAAO,CAACC,MAAM,CAACH,eAAe,CAAC,IAAI,CAACD,QAAQ,EAAEE,KAAK,CAACG,GAAG,EAAEH,KAAK,CAACI,KAAK,CAAC;EAC7E;AACF;AAACC,OAAA,CAAAT,cAAA,GAAAA,cAAA","ignoreList":[]}
|