@trycourier/courier-react-native 1.0.9 → 2.0.0-beta1

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.
Files changed (89) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +16 -412
  3. package/android/build.gradle +48 -83
  4. package/android/src/main/AndroidManifest.xml +0 -1
  5. package/android/src/main/AndroidManifestNew.xml +2 -0
  6. package/android/src/main/java/com/courierreactnative/CourierReactNativeActivity.kt +10 -10
  7. package/android/src/main/java/com/courierreactnative/CourierReactNativeModule.kt +146 -137
  8. package/android/src/main/java/com/courierreactnative/CourierReactNativePackage.kt +1 -3
  9. package/android/src/main/java/com/courierreactnative/CourierReactNativeViewManager.kt +43 -0
  10. package/courier-react-native.podspec +12 -4
  11. package/ios/CourierReactNative-Bridging-Header.h +0 -1
  12. package/ios/CourierReactNative.xcodeproj/project.pbxproj +4 -4
  13. package/ios/CourierReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  14. package/ios/CourierReactNativeModule.m +53 -0
  15. package/ios/{CourierReactNative.swift → CourierReactNativeModule.swift} +178 -45
  16. package/ios/CourierReactNativeViewManager.m +15 -0
  17. package/ios/CourierReactNativeViewManager.swift +348 -0
  18. package/lib/commonjs/index.js +86 -210
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/models/CourierInboxListener.js +26 -0
  21. package/lib/commonjs/models/CourierInboxListener.js.map +1 -0
  22. package/lib/commonjs/models/CourierInboxTheme.js +2 -0
  23. package/lib/commonjs/models/CourierInboxTheme.js.map +1 -0
  24. package/lib/commonjs/models/InboxAction.js +2 -0
  25. package/lib/commonjs/models/InboxAction.js.map +1 -0
  26. package/lib/commonjs/models/InboxMessage.js +6 -0
  27. package/lib/commonjs/models/InboxMessage.js.map +1 -0
  28. package/lib/commonjs/views/CourierInboxView.js +53 -0
  29. package/lib/commonjs/views/CourierInboxView.js.map +1 -0
  30. package/lib/module/index.js +80 -209
  31. package/lib/module/index.js.map +1 -1
  32. package/lib/module/models/CourierInboxListener.js +18 -0
  33. package/lib/module/models/CourierInboxListener.js.map +1 -0
  34. package/lib/module/models/CourierInboxTheme.js +2 -0
  35. package/lib/module/models/CourierInboxTheme.js.map +1 -0
  36. package/lib/module/models/InboxAction.js +2 -0
  37. package/lib/module/models/InboxAction.js.map +1 -0
  38. package/lib/module/models/InboxMessage.js +2 -0
  39. package/lib/module/models/InboxMessage.js.map +1 -0
  40. package/lib/module/views/CourierInboxView.js +45 -0
  41. package/lib/module/views/CourierInboxView.js.map +1 -0
  42. package/lib/typescript/index.d.ts +46 -92
  43. package/lib/typescript/index.d.ts.map +1 -0
  44. package/lib/typescript/models/CourierInboxListener.d.ts +9 -0
  45. package/lib/typescript/models/CourierInboxListener.d.ts.map +1 -0
  46. package/lib/typescript/models/CourierInboxTheme.d.ts +34 -0
  47. package/lib/typescript/models/CourierInboxTheme.d.ts.map +1 -0
  48. package/lib/typescript/models/InboxAction.d.ts +8 -0
  49. package/lib/typescript/models/InboxAction.d.ts.map +1 -0
  50. package/lib/typescript/models/InboxMessage.d.ts +18 -0
  51. package/lib/typescript/models/InboxMessage.d.ts.map +1 -0
  52. package/lib/typescript/views/CourierInboxView.d.ts +16 -0
  53. package/lib/typescript/views/CourierInboxView.d.ts.map +1 -0
  54. package/package.json +61 -44
  55. package/src/index.tsx +213 -0
  56. package/src/models/CourierInboxListener.tsx +25 -0
  57. package/src/models/CourierInboxTheme.tsx +30 -0
  58. package/src/models/InboxAction.tsx +5 -0
  59. package/src/models/InboxMessage.tsx +16 -0
  60. package/src/views/CourierInboxView.tsx +85 -0
  61. package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  62. package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
  63. package/android/.gradle/7.1/executionHistory/executionHistory.lock +0 -0
  64. package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
  65. package/android/.gradle/7.1/fileHashes/fileHashes.bin +0 -0
  66. package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
  67. package/android/.gradle/7.1/gc.properties +0 -0
  68. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  69. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  70. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  71. package/android/.gradle/checksums/checksums.lock +0 -0
  72. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  73. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  74. package/android/.gradle/vcs-1/gc.properties +0 -0
  75. package/android/.idea/compiler.xml +0 -6
  76. package/android/.idea/gradle.xml +0 -17
  77. package/android/.idea/jarRepositories.xml +0 -35
  78. package/android/.idea/misc.xml +0 -10
  79. package/android/.idea/vcs.xml +0 -6
  80. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  81. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  82. package/android/gradlew +0 -185
  83. package/android/gradlew.bat +0 -89
  84. package/android/local.properties +0 -8
  85. package/android/src/main/java/com/courierreactnative/NotificationPermissionStatus.kt +0 -6
  86. package/ios/CourierReactNative.m +0 -52
  87. package/ios/CourierReactNativeDelegate.h +0 -20
  88. package/ios/CourierReactNativeDelegate.m +0 -125
  89. package/src/index.ts +0 -337
@@ -1,14 +1,13 @@
1
- export declare enum CourierProvider {
2
- FCM = "firebase-fcm",
3
- APNS = "apn"
4
- }
1
+ import { CourierInboxListener } from './models/CourierInboxListener';
2
+ import { InboxMessage } from './models/InboxMessage';
3
+ export { CourierInboxView } from './views/CourierInboxView';
5
4
  declare class Courier {
6
- readonly PUSH_NOTIFICATION_CLICKED = "pushNotificationClicked";
7
- readonly PUSH_NOTIFICATION_DELIVERED = "pushNotificationDelivered";
8
- constructor();
9
- private setDefaults;
5
+ private static _sharedInstance;
10
6
  private _isDebugging;
11
7
  private debugListener;
8
+ constructor();
9
+ static get shared(): Courier;
10
+ private setDefaults;
12
11
  /**
13
12
  * Tells native Courier SDKs to show or hide logs.
14
13
  * Defaults to the React __DEV__ mode
@@ -29,6 +28,7 @@ declare class Courier {
29
28
  * ```
30
29
  *await Courier.signIn({
31
30
  accessToken: YOUR_COURIER_GENERATED_JWT,
31
+ clientKey: YOUR_CLIENT_KEY,
32
32
  userId: YOUR_USER_ID,
33
33
  })
34
34
  * ```
@@ -36,103 +36,57 @@ declare class Courier {
36
36
  * that is requested from your backend
37
37
  * https://www.courier.com/docs/reference/auth/issue-token/
38
38
  */
39
- signIn({ accessToken, userId, }: {
39
+ signIn(props: {
40
40
  accessToken: string;
41
+ clientKey?: string;
41
42
  userId: string;
42
43
  }): Promise<void>;
43
44
  /**
44
- * Logs user out of native level user storage.
45
- * This will clear the userId, accessToken, and apns / fcm tokens and
46
- * delete the matching devices apns / fcm tokens for the user in Courier token management
47
- * @example await Courier.signOut()
45
+ * TODO
46
+ * @param props
47
+ * @returns
48
48
  */
49
- signOut(): Promise<void>;
50
- /**
51
- * Sets the current Apple Push Notification Service (APNS) token
52
- * using Courier token management apis
53
- * @example const apnsToken = await Courier.apnsToken
54
- */
55
- get apnsToken(): Promise<string | undefined>;
49
+ readMessage(props: {
50
+ messageId: string;
51
+ }): Promise<void>;
56
52
  /**
57
- * Sets the current Firebase Cloud Messaging (FCM) token
58
- * using Courier token management apis
59
- * @example const fcmToken = await Courier.fcmToken
53
+ * TODO
54
+ * @param props
55
+ * @returns
60
56
  */
61
- get fcmToken(): Promise<string | undefined>;
57
+ unreadMessage(props: {
58
+ messageId: string;
59
+ }): Promise<void>;
62
60
  /**
63
- * Sets the current Firebase Cloud Messaging (FCM) token
64
- * using Courier token management apis
65
- * @example await setFcmToken('asdf...asdf')
61
+ * TODO
62
+ * @param props
63
+ * @returns
66
64
  */
67
- setFcmToken(token: string): Promise<void>;
65
+ readAllInboxMessages(): Promise<void>;
68
66
  /**
69
- * Hits the Courier /send endpoint and sends a test push notification
70
- * @example
71
- * ```
72
- *const messageId = await sendPush({
73
- authKey: YOUR_AUTH_KEY_THAT_SHOULD_NOT_STAY_IN_YOUR_PRODUCTION_APP,
74
- userId: USER_ID,
75
- title: 'This is a title',
76
- body: 'This is a body',
77
- providers: [CourierProvider.APNS, CourierProvider.FCM],
78
- });
79
- * ```
80
- * @returns promise
81
- */
82
- sendPush({ authKey, userId, title, body, providers, }: {
83
- authKey: string;
84
- userId: string;
85
- title?: string;
86
- body?: string;
87
- providers: CourierProvider[];
88
- }): Promise<string>;
89
- /**
90
- * Gets notification permission status at a system level.
91
- * @example const permissionStatus = await Courier.getNotificationPermissionStatus()
67
+ * TODO
68
+ * @param props
69
+ * @returns
92
70
  */
93
- get notificationPermissionStatus(): Promise<string>;
71
+ addInboxListener(props: {
72
+ onInitialLoad?: () => void;
73
+ onError?: (error: string) => void;
74
+ onMessagesChanged?: (messages: InboxMessage[], unreadMessageCount: number, totalMessageCount: number, canPaginate: boolean) => void;
75
+ }): CourierInboxListener;
94
76
  /**
95
- * Requests notification permission status at a system level.
96
- * Returns the string associated with the permission status.
97
- * Will return the current status and will not present a popup
98
- * if the user has already been asked for permission.
99
- * @example const permissionStatus = await Courier.requestNotificationPermission()
77
+ * TODO
78
+ * @param props
79
+ * @returns
100
80
  */
101
- requestNotificationPermission(): Promise<string>;
81
+ removeInboxListener(props: {
82
+ listenerId: string;
83
+ }): string;
102
84
  /**
103
- * Sets the push notification presentation style when the app is in the foreground
104
- * This does not affect how the notification is shown when the app is killed or in the background states
105
- *
106
- * Defaults to sound, badge, list and/or banner.
107
- *
108
- * @example iOSForegroundPresentationOptions({options: ['sound']});
85
+ * TODO
86
+ * @param props
87
+ * @returns
109
88
  */
110
- iOSForegroundPresentationOptions({ options, }: {
111
- options: ('sound' | 'badge' | 'list' | 'banner')[];
112
- }): Promise<void>;
113
- /**
114
- * @example
115
- *```
116
- const unsubPushListeners = () => {
117
- return Courier.registerPushNotificationListeners<YOUR_NOTIFICATION_TYPE>({
118
- onPushNotificationClicked: (push) => {
119
- ...
120
- },
121
- onPushNotificationDelivered: (push) => {
122
- ...
123
- },
124
- })
125
- }
126
-
127
- // To unsubscribe the listeners
128
- unsubPushListeners()
129
- *```
130
- * @returns function that can be used to unsubscribe from registered listeners
131
- */
132
- registerPushNotificationListeners({ onPushNotificationClicked, onPushNotificationDelivered, }: {
133
- onPushNotificationClicked: (_push: any) => void;
134
- onPushNotificationDelivered: (_push: any) => void;
135
- }): () => void;
89
+ refreshInbox(): Promise<void>;
136
90
  }
137
- declare const _default: Courier;
138
- export default _default;
91
+ export default Courier;
92
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAuB5D,cAAM,OAAO;IAEX,OAAO,CAAC,MAAM,CAAC,eAAe,CAAU;IACxC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAkC;;IAWvD,WAAkB,MAAM,IAAI,OAAO,CAQlC;YAEa,WAAW;IAazB;;;;OAIG;IACU,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBnE,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAExC;IAED;;;;;;;;;;;;;;;OAeG;IACI,MAAM,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhG;;;;OAIG;IACI,WAAW,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D;;;;OAIG;IACI,aAAa,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE;;;;OAIG;IACI,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C;;;;OAIG;IACI,gBAAgB,CAAC,KAAK,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,GAAG,oBAAoB;IAkC5P;;;;OAIG;IACI,mBAAmB,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAIjE;;;;OAIG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAI3C;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { EmitterSubscription } from "react-native";
2
+ export declare class CourierInboxListener {
3
+ listenerId?: string;
4
+ onInitialLoad?: EmitterSubscription;
5
+ onError?: EmitterSubscription;
6
+ onMessagesChanged?: EmitterSubscription;
7
+ remove(): void;
8
+ }
9
+ //# sourceMappingURL=CourierInboxListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CourierInboxListener.d.ts","sourceRoot":"","sources":["../../../src/models/CourierInboxListener.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,qBAAa,oBAAoB;IAExB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,iBAAiB,CAAC,EAAE,mBAAmB,CAAA;IAEvC,MAAM;CAcd"}
@@ -0,0 +1,34 @@
1
+ export interface CourierInboxFont {
2
+ family?: string;
3
+ size?: number;
4
+ color?: string;
5
+ }
6
+ export interface CourierInboxButtonStyles {
7
+ font?: CourierInboxFont;
8
+ backgroundColor?: string;
9
+ cornerRadius?: number;
10
+ }
11
+ export default interface CourierInboxTheme {
12
+ unreadIndicatorBarColor?: string;
13
+ loadingIndicatorColor?: string;
14
+ titleFont?: CourierInboxFont;
15
+ timeFont?: CourierInboxFont;
16
+ bodyFont?: CourierInboxFont;
17
+ detailTitleFont?: CourierInboxFont;
18
+ buttonStyles?: CourierInboxButtonStyles;
19
+ iOS?: {
20
+ messageAnimationStyle?: 'fade' | 'right' | 'left' | 'top' | 'bottom' | 'none' | 'middle' | 'automatic';
21
+ cellStyles?: {
22
+ separatorStyle?: 'none' | 'singleLine' | 'singleLineEtched';
23
+ separatorInsets?: {
24
+ top?: number;
25
+ left?: number;
26
+ bottom?: number;
27
+ right?: number;
28
+ };
29
+ separatorColor?: string;
30
+ selectionStyle?: 'none' | 'blue' | 'gray' | 'default';
31
+ };
32
+ };
33
+ }
34
+ //# sourceMappingURL=CourierInboxTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CourierInboxTheme.d.ts","sourceRoot":"","sources":["../../../src/models/CourierInboxTheme.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,eAAe,CAAC,EAAE,gBAAgB,CAAA;IAClC,YAAY,CAAC,EAAE,wBAAwB,CAAA;IACvC,GAAG,CAAC,EAAE;QACJ,qBAAqB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;QACvG,UAAU,CAAC,EAAE;YACX,cAAc,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,CAAC;YAC5D,eAAe,CAAC,EAAE;gBAAE,GAAG,CAAC,EAAE,MAAM,CAAC;gBAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAAC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAAC,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YACnF,cAAc,CAAC,EAAE,MAAM,CAAC;YACxB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;SACtD,CAAA;KACF,CAAA;CACF"}
@@ -0,0 +1,8 @@
1
+ export interface InboxAction {
2
+ content?: string | null;
3
+ href?: string | null;
4
+ data?: {
5
+ [key: string]: any;
6
+ } | null;
7
+ }
8
+ //# sourceMappingURL=InboxAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InboxAction.d.ts","sourceRoot":"","sources":["../../../src/models/InboxAction.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;CACtC"}
@@ -0,0 +1,18 @@
1
+ import { InboxAction } from "./InboxAction";
2
+ export interface InboxMessage {
3
+ messageId: string;
4
+ title?: string | null;
5
+ body?: string | null;
6
+ preview?: string | null;
7
+ created?: string | null;
8
+ actions?: InboxAction[] | null;
9
+ data?: {
10
+ [key: string]: any;
11
+ } | null;
12
+ read?: boolean | null;
13
+ opened?: boolean | null;
14
+ archived?: boolean | null;
15
+ subtitle?: string | null;
16
+ time?: string;
17
+ }
18
+ //# sourceMappingURL=InboxMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InboxMessage.d.ts","sourceRoot":"","sources":["../../../src/models/InboxMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;IACrC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { ViewStyle } from "react-native";
3
+ import CourierInboxTheme from "src/models/CourierInboxTheme";
4
+ import { InboxAction } from "src/models/InboxAction";
5
+ import { InboxMessage } from "src/models/InboxMessage";
6
+ type CourierInboxViewProps = {
7
+ lightTheme?: CourierInboxTheme;
8
+ darkTheme?: CourierInboxTheme;
9
+ onClickInboxMessageAtIndex?: (message: InboxMessage, index: number) => void;
10
+ onClickInboxActionForMessageAtIndex?: (action: InboxAction, message: InboxMessage, index: number) => void;
11
+ onScrollInbox?: (offsetY: number, offsetX: number) => void;
12
+ style?: ViewStyle;
13
+ };
14
+ export declare const CourierInboxView: (props: CourierInboxViewProps) => React.JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=CourierInboxView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CourierInboxView.d.ts","sourceRoot":"","sources":["../../../src/views/CourierInboxView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA+C,SAAS,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,KAAK,qBAAqB,GAAG;IAC3B,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,0BAA0B,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,mCAAmC,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1G,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAiBF,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,sBAsD5D,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trycourier/courier-react-native",
3
- "version": "1.0.9",
4
- "description": "test",
3
+ "version": "2.0.0-beta1",
4
+ "description": "Inbox & Push Notifications for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/index.d.ts",
@@ -13,24 +13,30 @@
13
13
  "android",
14
14
  "ios",
15
15
  "cpp",
16
- "courier-react-native.podspec",
16
+ "*.podspec",
17
17
  "!lib/typescript/example",
18
- "!android/build",
19
18
  "!ios/build",
19
+ "!android/build",
20
+ "!android/gradle",
21
+ "!android/gradlew",
22
+ "!android/gradlew.bat",
23
+ "!android/local.properties",
20
24
  "!**/__tests__",
21
25
  "!**/__fixtures__",
22
- "!**/__mocks__"
26
+ "!**/__mocks__",
27
+ "!**/.*"
23
28
  ],
24
29
  "scripts": {
25
30
  "test": "jest",
26
- "typescript": "tsc --noEmit",
31
+ "typecheck": "tsc --noEmit",
27
32
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
28
- "prepare": "bob build",
33
+ "prepack": "bob build",
29
34
  "release": "release-it",
30
35
  "example": "yarn --cwd example",
31
- "bootstrap": "yarn example && yarn && yarn example pods",
32
- "linkPackage": "yarn link && yarn example link @trycourier/courier-react-native && yarn example setupEnv",
33
- "setup": "sh setup.sh"
36
+ "build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
37
+ "build:ios": "cd example/ios && xcodebuild -workspace CourierReactNativeExample.xcworkspace -scheme CourierReactNativeExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
38
+ "bootstrap": "yarn example && yarn install && yarn example pods",
39
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
34
40
  },
35
41
  "keywords": [
36
42
  "react-native",
@@ -38,7 +44,7 @@
38
44
  "android"
39
45
  ],
40
46
  "repository": "https://github.com/trycourier/courier-react-native",
41
- "author": "FahadAminShovon <shovonfahad991@gmail.com> (https://github.com/FahadAminShovon)",
47
+ "author": "mikemilla <mike@mikemiller.design> (https://github.com/mikemilla)",
42
48
  "license": "MIT",
43
49
  "bugs": {
44
50
  "url": "https://github.com/trycourier/courier-react-native/issues"
@@ -48,33 +54,27 @@
48
54
  "registry": "https://registry.npmjs.org/"
49
55
  },
50
56
  "devDependencies": {
51
- "@babel/eslint-parser": "^7.18.2",
52
57
  "@commitlint/config-conventional": "^17.0.2",
53
- "@react-native-community/eslint-config": "^3.2.0",
58
+ "@evilmartians/lefthook": "^1.2.2",
59
+ "@react-native-community/eslint-config": "^3.0.2",
54
60
  "@release-it/conventional-changelog": "^5.0.0",
55
61
  "@types/jest": "^28.1.2",
56
62
  "@types/react": "~17.0.21",
57
- "@types/react-native": "0.68.0",
58
- "@typescript-eslint/parser": "^5.42.1",
59
- "commitizen": "^4.2.5",
60
- "commitlint": "^17.2.0",
61
- "cz-conventional-changelog": "^3.3.0",
62
- "eslint": "^8.27.0",
63
- "eslint-config-airbnb": "^19.0.4",
63
+ "@types/react-native": "0.70.0",
64
+ "commitlint": "^17.0.2",
65
+ "del-cli": "^5.0.0",
66
+ "eslint": "^8.4.1",
64
67
  "eslint-config-prettier": "^8.5.0",
65
- "eslint-plugin-import": "^2.26.0",
66
- "eslint-plugin-jsx-a11y": "^6.6.1",
67
- "eslint-plugin-prettier": "^4.2.1",
68
- "eslint-plugin-react": "^7.31.10",
68
+ "eslint-plugin-prettier": "^4.0.0",
69
69
  "jest": "^28.1.1",
70
- "lefthook": "^1.2.0",
71
70
  "pod-install": "^0.1.0",
72
- "prettier": "^2.7.1",
73
- "react": "17.0.2",
74
- "react-native": "0.68.2",
75
- "react-native-builder-bob": "^0.18.3",
71
+ "prettier": "^2.0.5",
72
+ "react": "18.2.0",
73
+ "react-native": "0.72.4",
74
+ "react-native-builder-bob": "^0.21.3",
76
75
  "release-it": "^15.0.0",
77
- "typescript": "^4.8.4"
76
+ "turbo": "^1.10.7",
77
+ "typescript": "^5.0.2"
78
78
  },
79
79
  "resolutions": {
80
80
  "@types/react": "17.0.21"
@@ -83,14 +83,15 @@
83
83
  "react": "*",
84
84
  "react-native": "*"
85
85
  },
86
+ "engines": {
87
+ "node": ">= 16.0.0"
88
+ },
89
+ "packageManager": "^yarn@1.22.15",
86
90
  "jest": {
87
91
  "preset": "react-native",
88
92
  "modulePathIgnorePatterns": [
89
93
  "<rootDir>/example/node_modules",
90
94
  "<rootDir>/lib/"
91
- ],
92
- "setupFiles": [
93
- "./src/__mocks__/native-module-bridge.js"
94
95
  ]
95
96
  },
96
97
  "commitlint": {
@@ -115,14 +116,36 @@
115
116
  }
116
117
  }
117
118
  },
119
+ "eslintConfig": {
120
+ "root": true,
121
+ "extends": [
122
+ "@react-native-community",
123
+ "prettier"
124
+ ],
125
+ "rules": {
126
+ "prettier/prettier": [
127
+ "error",
128
+ {
129
+ "quoteProps": "consistent",
130
+ "singleQuote": true,
131
+ "tabWidth": 2,
132
+ "trailingComma": "off",
133
+ "useTabs": false
134
+ }
135
+ ]
136
+ }
137
+ },
118
138
  "eslintIgnore": [
119
139
  "node_modules/",
120
- "lib/",
121
- "**/babel.config.**",
122
- "**/metro.config.**",
123
- "**/react-native.config.**",
124
- "**/scripts/**"
140
+ "lib/"
125
141
  ],
142
+ "prettier": {
143
+ "quoteProps": "consistent",
144
+ "singleQuote": true,
145
+ "tabWidth": 2,
146
+ "trailingComma": "es5",
147
+ "useTabs": false
148
+ },
126
149
  "react-native-builder-bob": {
127
150
  "source": "src",
128
151
  "output": "lib",
@@ -136,11 +159,5 @@
136
159
  }
137
160
  ]
138
161
  ]
139
- },
140
- "dependencies": {},
141
- "config": {
142
- "commitizen": {
143
- "path": "./node_modules/cz-conventional-changelog"
144
- }
145
162
  }
146
163
  }