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

Sound not playing #723

Closed
0x111 opened this issue Feb 12, 2021 · 16 comments · Fixed by #750
Closed

Sound not playing #723

0x111 opened this issue Feb 12, 2021 · 16 comments · Fixed by #750
Assignees

Comments

@0x111
Copy link

0x111 commented Feb 12, 2021

Hi guys,

Anyone did manage to get the notification sound playing? I create a custom channel, set a soundfile, put it into the res/raw folder under the same name but the notification is simply not playing the sound.
Anyone got this working?

Notifications.setNotificationChannel({
      channelId: 'doorbell-channel',
      name: 'Doorbell',
      importance: 2,
      description: 'Notifications for doorbell',
      enableLights: true,
      enableVibration: true,
      // groupId: 'your-group',
      showBadge: true,
      soundFile: 'doorbell.mp3', // place this in <project_root>/android/app/src/main/res/raw/custom_sound.mp3
      vibrationPattern: [200, 1000, 500, 1000, 500],
    });

This is how the json looks that I am sending to the API:

{
    "to": "<redacted>",
    "priority": "high",
    "notification": {
        "title": "Title",
        "body": "You have received a new notification yayyy :) :) :)",
        "android_channel_id": "doorbell-channel",
        "badge": "0",
        "soundFile": "doorbell.mp3"
    },
    "data": {
        "some": "data here"
    }
}

Further specs:
I am trying this on an Android phone, notification appears but no sound is played not even the default.

@artymir
Copy link

artymir commented Feb 20, 2021

same issue

@0x111
Copy link
Author

0x111 commented Feb 20, 2021

same issue

You did not figure out a solution either? 🙁

@artymir
Copy link

artymir commented Feb 24, 2021

same issue

You did not figure out a solution either? 🙁

Nope

@stale
Copy link

stale bot commented Mar 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the 🏚 stale label Mar 26, 2021
@0x111
Copy link
Author

0x111 commented Mar 26, 2021

@wixmobile any help please

@stale stale bot removed the 🏚 stale label Mar 26, 2021
@artymir
Copy link

artymir commented Mar 26, 2021

@wixmobile we need your help

@stale
Copy link

stale bot commented Apr 25, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the 🏚 stale label Apr 25, 2021
@0x111
Copy link
Author

0x111 commented Apr 28, 2021

Not stale

@stale stale bot removed the 🏚 stale label Apr 28, 2021
@stale
Copy link

stale bot commented May 29, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the 🏚 stale label May 29, 2021
@0x111
Copy link
Author

0x111 commented May 30, 2021

This stale issue thing is just ridiculous

@stale stale bot removed the 🏚 stale label May 30, 2021
@DanielEliraz DanielEliraz self-assigned this Jun 21, 2021
yogevbd added a commit that referenced this issue Jun 23, 2021
#535 started implementing custom channel and channels group creation but there were some missing parts that this PR finishes:

- Using the incoming channel in `PostNotification` after creating it
- Add channel group name and add this group to the custom channel
- Show it in the example app

This PR also fixes very old tests
Closes #723 

Co-authored-by: Yogev Ben David <[email protected]>
@0x111
Copy link
Author

0x111 commented Jun 23, 2021

@DanielEliraz Thanks for the fix. How can I try this out in my project without a release being published on npm? If you could provide steps to build from master I would be glad. (no rush, just want to try it out, but I was not able to determine a simple way of doing so apparently)

If it is too complicated, then I will just have to wait. Thanks for the efforts though!
Edit: Nevermind, I figured it out. Thanks again!

@Nayan014
Copy link

@0x111 How do you fix it?

@0x111
Copy link
Author

0x111 commented Feb 24, 2022

@0x111 How do you fix it?

With the latest fixes it worked as described in the example

@Nayan014
Copy link

Nayan014 commented Feb 24, 2022

I want to use the default sound of notification, is it mandatory to create notification channels for that?

@0x111 How do you fix it?

With the latest fixes it worked as described in the example

@0x111
Copy link
Author

0x111 commented Feb 24, 2022

I don't think that you need to create channels if I remember correctly if not specified the notification uses the default channel but I would suggest to create a new issue for your problem if any 🙂

@DanielEliraz
Copy link
Collaborator

@Nayan014, with default sound you mean the default sound in the device?
If yes, so as @0x111 said you don't need to create a channel and in the default channel there isn't any special sound so the device will use the default sound for your notifications.

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

Successfully merging a pull request may close this issue.

4 participants