Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreground Service Icon Not Displaying as Expected #108

Open
singh-anant opened this issue Nov 4, 2024 · 0 comments
Open

Foreground Service Icon Not Displaying as Expected #108

singh-anant opened this issue Nov 4, 2024 · 0 comments

Comments

@singh-anant
Copy link

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

  • React Native version: 0.69
  • ReactNativeForegroundService version: 2.0.1
  • Platform: Android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant