@developer_tribe/react-native-comnyx 0.10.6 → 0.10.8
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/android/src/main/java/com/comnyx/src/messaging/notifications/NotificationsService.kt +22 -11
- package/lib/commonjs/hooks/usePermissionChange.js +11 -0
- package/lib/commonjs/hooks/usePermissionChange.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/index.js.map +1 -1
- package/lib/module/hooks/usePermissionChange.js +7 -0
- package/lib/module/hooks/usePermissionChange.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/index.js.map +1 -1
- package/lib/typescript/src/hooks/usePermissionChange.d.ts +2 -0
- package/lib/typescript/src/hooks/usePermissionChange.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/notifications/index.d.ts +30 -26
- package/lib/typescript/src/notifications/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/hooks/usePermissionChange.ts +5 -0
- package/src/index.ts +9 -0
- package/src/notifications/index.ts +34 -26
package/android/src/main/java/com/comnyx/src/messaging/notifications/NotificationsService.kt
CHANGED
|
@@ -123,19 +123,30 @@ class NotificationsHelper(private val context: Context) {
|
|
|
123
123
|
.setContentTitle(title)
|
|
124
124
|
.setContentText(message)
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
// Check if Firebase notification icon is defined in manifest metadata
|
|
127
|
+
try {
|
|
128
|
+
val appInfo = context.packageManager.getApplicationInfo(context.packageName, android.content.pm.PackageManager.GET_META_DATA)
|
|
129
|
+
val metaData = appInfo.metaData
|
|
130
|
+
var iconResourceId = 0
|
|
131
|
+
|
|
132
|
+
// Get Firebase notification icon from manifest metadata
|
|
133
|
+
if (metaData != null && metaData.containsKey("com.google.firebase.messaging.default_notification_icon")) {
|
|
134
|
+
iconResourceId = metaData.getInt("com.google.firebase.messaging.default_notification_icon", 0)
|
|
135
|
+
Log.d(TAG, "Found Firebase notification icon metadata: $iconResourceId")
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (iconResourceId != 0) {
|
|
139
|
+
builder.setSmallIcon(iconResourceId)
|
|
140
|
+
Log.d(TAG, "Using Firebase default notification icon from manifest")
|
|
141
|
+
} else {
|
|
142
|
+
// Fallback to app icon
|
|
133
143
|
builder.setSmallIcon(appInfo.icon)
|
|
134
|
-
Log.d(TAG, "Firebase default notification icon not found, using app icon as fallback")
|
|
135
|
-
} catch (e: Exception) {
|
|
136
|
-
builder.setSmallIcon(android.R.drawable.ic_dialog_info)
|
|
137
|
-
Log.d(TAG, "Using system default icon as final fallback")
|
|
144
|
+
Log.d(TAG, "Firebase default notification icon not found in manifest, using app icon as fallback")
|
|
138
145
|
}
|
|
146
|
+
} catch (e: Exception) {
|
|
147
|
+
// Ultimate fallback to Android system icon
|
|
148
|
+
builder.setSmallIcon(android.R.drawable.ic_dialog_info)
|
|
149
|
+
Log.d(TAG, "Error getting app info, using system default icon as final fallback: ${e.message}")
|
|
139
150
|
}
|
|
140
151
|
|
|
141
152
|
builder.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useNotificationPermission = useNotificationPermission;
|
|
7
|
+
var _store = require("../store/store.js");
|
|
8
|
+
function useNotificationPermission() {
|
|
9
|
+
return (0, _store.useAppStore)(s => s.permissionGiven);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=usePermissionChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_store","require","useNotificationPermission","useAppStore","s","permissionGiven"],"sourceRoot":"../../../src","sources":["hooks/usePermissionChange.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,OAAO,IAAAC,kBAAW,EAAEC,CAAC,IAAKA,CAAC,CAACC,eAAe,CAAC;AAC9C","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -33,9 +33,16 @@ Object.defineProperty(exports, "registerOneSignalForComnyx", {
|
|
|
33
33
|
return _collectData.registerOneSignalForComnyx;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "usePermissionChange", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _usePermissionChange.useNotificationPermission;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
var _index = require("./register/index.js");
|
|
37
43
|
var _index2 = require("./support/index.js");
|
|
38
44
|
var _index3 = require("./notifications/index.js");
|
|
39
45
|
var _NativeComnyx = require("./NativeComnyx.js");
|
|
40
46
|
var _collectData = require("./register/collectData.js");
|
|
47
|
+
var _usePermissionChange = require("./hooks/usePermissionChange.js");
|
|
41
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","_index2","_index3","_NativeComnyx","_collectData"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_index","require","_index2","_index3","_NativeComnyx","_collectData","_usePermissionChange"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAGA,IAAAG,aAAA,GAAAH,OAAA;AASA,IAAAI,YAAA,GAAAJ,OAAA;AAGA,IAAAK,oBAAA,GAAAL,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_NativeComnyx","_initializeNotifications","comnyxEmitter","Platform","OS","NativeEventEmitter","NativeModules","Comnyx","ComnyxNotifications","exports","initialize","initializeNotifications","optIn","nativeComnyx","checkOptIn","linkToSettings","addEventListener","eventType","listener","addListener","event"],"sourceRoot":"../../../src","sources":["notifications/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AAKA,MAAMG,aAAa,GACjBC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACrB,IAAIC,+BAAkB,CAAC,CAAC,CAAC;AAAA,EACzB,IAAIA,+BAAkB,CAACC,0BAAa,CAACC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_NativeComnyx","_initializeNotifications","comnyxEmitter","Platform","OS","NativeEventEmitter","NativeModules","Comnyx","ComnyxNotifications","exports","initialize","initializeNotifications","optIn","nativeComnyx","checkOptIn","linkToSettings","addEventListener","eventType","listener","addListener","event"],"sourceRoot":"../../../src","sources":["notifications/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AAKA,MAAMG,aAAa,GACjBC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACrB,IAAIC,+BAAkB,CAAC,CAAC,CAAC;AAAA,EACzB,IAAIA,+BAAkB,CAACC,0BAAa,CAACC,MAAM,CAAC;AA0F3C,MAAMC,mBAA4C,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EAC1DE,UAAU,EAAEC,gDAAuB;EACnCC,KAAK,EAAEC,0BAAY,CAACD,KAAK;EACzBE,UAAU,EAAED,0BAAY,CAACC,UAAU;EACnCC,cAAc,EAAEF,0BAAY,CAACE,cAAc;EAC3CC,gBAAgB,EAAE,SAAAA,CAChBC,SAAY,EACZC,QAA4D,EACvC;IACrB,OAAOhB,aAAa,CAACiB,WAAW,CAACF,SAAS,EAAGG,KAAK,IAAK;MACrDF,QAAQ,CAACE,KAAK,CAAC;IACjB,CAAC,CAAC;EACJ;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAppStore","useNotificationPermission","s","permissionGiven"],"sourceRoot":"../../../src","sources":["hooks/usePermissionChange.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAE5C,OAAO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,OAAOD,WAAW,CAAEE,CAAC,IAAKA,CAAC,CAACC,eAAe,CAAC;AAC9C","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -6,7 +6,9 @@ export { ComnyxNotifications } from "./notifications/index.js";
|
|
|
6
6
|
|
|
7
7
|
//types
|
|
8
8
|
export { NotificationPermissionStatus } from "./NativeComnyx.js";
|
|
9
|
-
|
|
10
9
|
//deprecated
|
|
11
10
|
export { registerOneSignalForComnyx } from "./register/collectData.js";
|
|
11
|
+
|
|
12
|
+
//hooks
|
|
13
|
+
export { useNotificationPermission as usePermissionChange } from "./hooks/usePermissionChange.js";
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Comnyx","ComnyxSupport","ComnyxNotifications","NotificationPermissionStatus","registerOneSignalForComnyx"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,qBAAY;AACnC,SAASC,aAAa,QAAQ,oBAAW;AACzC,SAASC,mBAAmB,QAAQ,0BAAiB;;AAErD;AACA,SAASC,4BAA4B,QAAQ,mBAAgB
|
|
1
|
+
{"version":3,"names":["Comnyx","ComnyxSupport","ComnyxNotifications","NotificationPermissionStatus","registerOneSignalForComnyx","useNotificationPermission","usePermissionChange"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,qBAAY;AACnC,SAASC,aAAa,QAAQ,oBAAW;AACzC,SAASC,mBAAmB,QAAQ,0BAAiB;;AAErD;AACA,SAASC,4BAA4B,QAAQ,mBAAgB;AAQ7D;AACA,SAASC,0BAA0B,QAAQ,2BAAwB;;AAEnE;AACA,SAASC,yBAAyB,IAAIC,mBAAmB,QAAQ,gCAA6B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","NativeEventEmitter","NativeModules","nativeComnyx","initializeNotifications","comnyxEmitter","OS","Comnyx","ComnyxNotifications","initialize","optIn","checkOptIn","linkToSettings","addEventListener","eventType","listener","addListener","event"],"sourceRoot":"../../../src","sources":["notifications/index.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAkC,cAAc;AACjE,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAASC,YAAY,QAAsC,oBAAiB;AAC5E,SACEC,uBAAuB,QAElB,8BAA2B;AAElC,MAAMC,aAAa,GACjBL,QAAQ,CAACM,EAAE,KAAK,SAAS,GACrB,IAAIL,kBAAkB,CAAC,CAAC,CAAC;AAAA,EACzB,IAAIA,kBAAkB,CAACC,aAAa,CAACK,MAAM,CAAC;
|
|
1
|
+
{"version":3,"names":["Platform","NativeEventEmitter","NativeModules","nativeComnyx","initializeNotifications","comnyxEmitter","OS","Comnyx","ComnyxNotifications","initialize","optIn","checkOptIn","linkToSettings","addEventListener","eventType","listener","addListener","event"],"sourceRoot":"../../../src","sources":["notifications/index.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAkC,cAAc;AACjE,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAASC,YAAY,QAAsC,oBAAiB;AAC5E,SACEC,uBAAuB,QAElB,8BAA2B;AAElC,MAAMC,aAAa,GACjBL,QAAQ,CAACM,EAAE,KAAK,SAAS,GACrB,IAAIL,kBAAkB,CAAC,CAAC,CAAC;AAAA,EACzB,IAAIA,kBAAkB,CAACC,aAAa,CAACK,MAAM,CAAC;AA0FlD,OAAO,MAAMC,mBAA4C,GAAG;EAC1DC,UAAU,EAAEL,uBAAuB;EACnCM,KAAK,EAAEP,YAAY,CAACO,KAAK;EACzBC,UAAU,EAAER,YAAY,CAACQ,UAAU;EACnCC,cAAc,EAAET,YAAY,CAACS,cAAc;EAC3CC,gBAAgB,EAAE,SAAAA,CAChBC,SAAY,EACZC,QAA4D,EACvC;IACrB,OAAOV,aAAa,CAACW,WAAW,CAACF,SAAS,EAAGG,KAAK,IAAK;MACrDF,QAAQ,CAACE,KAAK,CAAC;IACjB,CAAC,CAAC;EACJ;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermissionChange.d.ts","sourceRoot":"","sources":["../../../../src/hooks/usePermissionChange.ts"],"names":[],"mappings":"AAEA,wBAAgB,yBAAyB,YAExC"}
|
|
@@ -2,5 +2,7 @@ export { Comnyx } from './register';
|
|
|
2
2
|
export { ComnyxSupport } from './support';
|
|
3
3
|
export { ComnyxNotifications } from './notifications';
|
|
4
4
|
export { NotificationPermissionStatus } from './NativeComnyx';
|
|
5
|
+
export type { TokenInitEvent, TokenFailedEvent, NotificationReceivedEvent, NotificationClickedEvent, } from './notifications';
|
|
5
6
|
export { registerOneSignalForComnyx } from './register/collectData';
|
|
7
|
+
export { useNotificationPermission as usePermissionChange } from './hooks/usePermissionChange';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAC9D,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAGpE,OAAO,EAAE,yBAAyB,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -34,33 +34,37 @@ type IOSRawNotificationResponse = {
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
type AndroidRawNotificationResponse = {};
|
|
37
|
+
export type TokenInitEvent = {
|
|
38
|
+
type: string;
|
|
39
|
+
token: string;
|
|
40
|
+
};
|
|
41
|
+
export type TokenFailedEvent = {
|
|
42
|
+
type: string;
|
|
43
|
+
token: null;
|
|
44
|
+
};
|
|
45
|
+
export type NotificationReceivedEvent = {
|
|
46
|
+
title: string;
|
|
47
|
+
body: string;
|
|
48
|
+
subtitle: string;
|
|
49
|
+
badge: number;
|
|
50
|
+
sound: string;
|
|
51
|
+
data: unknown;
|
|
52
|
+
raw: IOSRawNotification | AndroidRawNotification;
|
|
53
|
+
};
|
|
54
|
+
export type NotificationClickedEvent = {
|
|
55
|
+
title: string;
|
|
56
|
+
body: string;
|
|
57
|
+
subtitle: string;
|
|
58
|
+
badge: number;
|
|
59
|
+
sound: string;
|
|
60
|
+
data: unknown;
|
|
61
|
+
raw: IOSRawNotificationResponse | AndroidRawNotificationResponse;
|
|
62
|
+
};
|
|
37
63
|
type ComnyxNotificationsEventResult = {
|
|
38
|
-
TOKEN_INIT:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
TOKEN_FAILED: {
|
|
43
|
-
type: string;
|
|
44
|
-
token: null;
|
|
45
|
-
};
|
|
46
|
-
NOTIFICATION_RECEIVED: {
|
|
47
|
-
title: string;
|
|
48
|
-
body: string;
|
|
49
|
-
subtitle: string;
|
|
50
|
-
badge: number;
|
|
51
|
-
sound: string;
|
|
52
|
-
data: unknown;
|
|
53
|
-
raw: IOSRawNotification | AndroidRawNotification;
|
|
54
|
-
};
|
|
55
|
-
NOTIFICATION_CLICKED: {
|
|
56
|
-
title: string;
|
|
57
|
-
body: string;
|
|
58
|
-
subtitle: string;
|
|
59
|
-
badge: number;
|
|
60
|
-
sound: string;
|
|
61
|
-
data: unknown;
|
|
62
|
-
raw: IOSRawNotificationResponse | AndroidRawNotificationResponse;
|
|
63
|
-
};
|
|
64
|
+
TOKEN_INIT: TokenInitEvent;
|
|
65
|
+
TOKEN_FAILED: TokenFailedEvent;
|
|
66
|
+
NOTIFICATION_RECEIVED: NotificationReceivedEvent;
|
|
67
|
+
NOTIFICATION_CLICKED: NotificationClickedEvent;
|
|
64
68
|
};
|
|
65
69
|
interface ComnyxNotificationsType {
|
|
66
70
|
initialize: (params?: InitializeNotificationsParams) => Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAgB,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAOnC,KAAK,4BAA4B,GAC7B,YAAY,GACZ,cAAc,GACd,uBAAuB,GACvB,s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,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,0BAA0B,GAAG,8BAA8B,CAAC;CAClE,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,gBAAgB,CAAC;IAC/B,qBAAqB,EAAE,yBAAyB,CAAC;IACjD,oBAAoB,EAAE,wBAAwB,CAAC;CAChD,CAAC;AAEF,UAAU,uBAAuB;IAC/B,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzE,KAAK,EAAE,MAAM,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACnD,UAAU,EAAE,MAAM,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACxD,cAAc,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,gBAAgB,CAAC,CAAC,SAAS,4BAA4B,EACrD,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3D,mBAAmB,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,uBAajC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developer_tribe/react-native-comnyx",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.8",
|
|
4
4
|
"description": "React Native chat component with integrated support panel, enabling real-time customer communication and efficient agent workflow management.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,15 @@ export { ComnyxNotifications } from './notifications';
|
|
|
4
4
|
|
|
5
5
|
//types
|
|
6
6
|
export { NotificationPermissionStatus } from './NativeComnyx';
|
|
7
|
+
export type {
|
|
8
|
+
TokenInitEvent,
|
|
9
|
+
TokenFailedEvent,
|
|
10
|
+
NotificationReceivedEvent,
|
|
11
|
+
NotificationClickedEvent,
|
|
12
|
+
} from './notifications';
|
|
7
13
|
|
|
8
14
|
//deprecated
|
|
9
15
|
export { registerOneSignalForComnyx } from './register/collectData';
|
|
16
|
+
|
|
17
|
+
//hooks
|
|
18
|
+
export { useNotificationPermission as usePermissionChange } from './hooks/usePermissionChange';
|
|
@@ -52,33 +52,41 @@ type IOSRawNotificationResponse = {
|
|
|
52
52
|
};
|
|
53
53
|
type AndroidRawNotificationResponse = {};
|
|
54
54
|
|
|
55
|
+
export type TokenInitEvent = {
|
|
56
|
+
type: string;
|
|
57
|
+
token: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type TokenFailedEvent = {
|
|
61
|
+
type: string;
|
|
62
|
+
token: null;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type NotificationReceivedEvent = {
|
|
66
|
+
title: string;
|
|
67
|
+
body: string;
|
|
68
|
+
subtitle: string;
|
|
69
|
+
badge: number;
|
|
70
|
+
sound: string;
|
|
71
|
+
data: unknown;
|
|
72
|
+
raw: IOSRawNotification | AndroidRawNotification;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type NotificationClickedEvent = {
|
|
76
|
+
title: string;
|
|
77
|
+
body: string;
|
|
78
|
+
subtitle: string;
|
|
79
|
+
badge: number;
|
|
80
|
+
sound: string;
|
|
81
|
+
data: unknown;
|
|
82
|
+
raw: IOSRawNotificationResponse | AndroidRawNotificationResponse;
|
|
83
|
+
};
|
|
84
|
+
|
|
55
85
|
type ComnyxNotificationsEventResult = {
|
|
56
|
-
TOKEN_INIT:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
TOKEN_FAILED: {
|
|
61
|
-
type: string;
|
|
62
|
-
token: null;
|
|
63
|
-
};
|
|
64
|
-
NOTIFICATION_RECEIVED: {
|
|
65
|
-
title: string;
|
|
66
|
-
body: string;
|
|
67
|
-
subtitle: string;
|
|
68
|
-
badge: number;
|
|
69
|
-
sound: string;
|
|
70
|
-
data: unknown;
|
|
71
|
-
raw: IOSRawNotification | AndroidRawNotification;
|
|
72
|
-
};
|
|
73
|
-
NOTIFICATION_CLICKED: {
|
|
74
|
-
title: string;
|
|
75
|
-
body: string;
|
|
76
|
-
subtitle: string;
|
|
77
|
-
badge: number;
|
|
78
|
-
sound: string;
|
|
79
|
-
data: unknown;
|
|
80
|
-
raw: IOSRawNotificationResponse | AndroidRawNotificationResponse;
|
|
81
|
-
};
|
|
86
|
+
TOKEN_INIT: TokenInitEvent;
|
|
87
|
+
TOKEN_FAILED: TokenFailedEvent;
|
|
88
|
+
NOTIFICATION_RECEIVED: NotificationReceivedEvent;
|
|
89
|
+
NOTIFICATION_CLICKED: NotificationClickedEvent;
|
|
82
90
|
};
|
|
83
91
|
|
|
84
92
|
interface ComnyxNotificationsType {
|