Raja0sama / rn-foreground-service

Foreground Service for React Native made with ❤
https://rn-foreground.vercel.app/
148 stars 70 forks source link

Foreground Service Icon Not Displaying as Expected #108

Open singh-anant opened 2 weeks ago

singh-anant commented 2 weeks ago

WhatsApp Image 2024-11-04 at 8 04 42 AM WhatsApp Image 2024-11-04 at 8 04 56 AM Description I'm using ReactNativeForegroundService to start a foreground service in my React Native project, but I'm not seeing the expected icon when the service starts. Instead of displaying my chosen icon, no icon (or the default icon) is shown.

Code Sample

useEffect(() => {
  ReactNativeForegroundService.add_task(() => sendCoords(), {
    delay: 60000,
    onLoop: true,
    taskId: 'taskid',
    onError: e => console.log(`Error logging:`, e),
  });
}, []);

const startTask = () => {
  ReactNativeForegroundService.start({
    id: 1244,
    icon: 'ic_launcher',  // Icon I expect to see
    setOnlyAlertOnce: false,
    color: '#000000',
  });
};

Additional Information