Skip to content

Commit

Permalink
fix: add smallIcon to android push config for expo naming support
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshvai committed Feb 19, 2025
1 parent 21d7eef commit ef94317
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ function setForegroundService() {
}

async function startForegroundService(call_cid: string) {
const foregroundServiceConfig = StreamVideoRN.getConfig().foregroundService;
const videoConfig = StreamVideoRN.getConfig();
const foregroundServiceConfig = videoConfig.foregroundService;
const { title, body } = foregroundServiceConfig.android.notificationTexts;

// check for notification permission and then start the foreground service
Expand Down Expand Up @@ -79,6 +80,7 @@ async function startForegroundService(call_cid: string) {
body,
android: {
channelId,
smallIcon: videoConfig.push?.android.smallIcon,
foregroundServiceTypes,
asForegroundService: true,
ongoing: true, // user cannot dismiss the notification
Expand Down
6 changes: 6 additions & 0 deletions packages/react-native-sdk/src/utils/StreamVideoRN/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export type StreamVideoConfig = {
pushProviderName?: string;
};
android: {
/**
* The small icon to be used for push notifications for Android
* Reference the name created (Optional, defaults to 'ic_launcher')
* @example "smallIcon: 'ic_small_icon'" or "smallIcon: 'ic_notification'"
*/
smallIcon?: string;
/**
* The name for the alias of push provider used for Android
* Pass undefined if you will not be using stream's push notifications but still want to use the functionality of the SDK
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native-sdk/src/utils/push/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ export const firebaseDataHandler = async (
data,
android: {
channelId,
smallIcon: pushConfig.android.smallIcon,
importance: 4, // high importance
foregroundServiceTypes: getIncomingCallForegroundServiceTypes(),
asForegroundService,
Expand Down Expand Up @@ -365,6 +366,7 @@ export const firebaseDataHandler = async (
data,
android: {
sound: callChannel.sound,
smallIcon: pushConfig.android.smallIcon,
vibrationPattern: callChannel.vibrationPattern,
channelId,
importance: 4, // high importance
Expand Down

0 comments on commit ef94317

Please sign in to comment.