Skip to content

Commit 6b97fbb

Browse files
Added createNotificationChannel api for android
1 parent b259038 commit 6b97fbb

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/clevertap.android.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ export class CleverTap extends Common implements CleverTapInterface {
2222
return CleverTapAPI.getDefaultInstance(utils.ad.getApplicationContext());
2323
}
2424

25+
public createNotificationChannel({
26+
channelId = "Clevertap",
27+
name = "Clevertap",
28+
description = "Clevertap",
29+
importance = 5,
30+
showBadge = true
31+
}) {
32+
CleverTapAPI.createNotificationChannel(
33+
utils.ad.getApplicationContext(),
34+
channelId,
35+
name,
36+
description,
37+
importance,
38+
showBadge
39+
);
40+
}
41+
2542
public updateProfile(profile) {
2643
this.instance.pushProfile(getHashMap(profile));
2744
}

src/clevertap.ios.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ export class CleverTapImpl extends Common implements CleverTapInterface {
5353
public handleMessage(message): boolean {
5454
throw new Error("Method not implemented.");
5555
}
56+
57+
public createNotificationChannel() {
58+
throw new Error("Method not implemented.");
59+
}
5660
}
5761

5862
export const cleverTap = new CleverTapImpl();

src/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export interface CleverTap {
1616
pushFcmRegistrationId(fcmRegId);
1717

1818
handleMessage(message): boolean;
19+
20+
createNotificationChannel({ channelId, name, description, importance, showBadge });
1921
}
2022

2123
export const cleverTap: CleverTap;

0 commit comments

Comments
 (0)