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

Notification Sounds do not work on Android in push 3.0 #156

Open
MichaelJCole opened this issue Nov 25, 2015 · 5 comments
Open

Notification Sounds do not work on Android in push 3.0 #156

MichaelJCole opened this issue Nov 25, 2015 · 5 comments

Comments

@MichaelJCole
Copy link

After a day of testing, and looking through the code, I don't think this works on Android:

Here is the documentation from the Cordova Plugin used by this Meteor package.

In order for your your notification to play a custom sound you will need to add the files to your Android project's res/raw directory. Then send the follow JSON from GCM:

{
    title:"Sound Test",
    message: "Loaded res/raw",
    soundname: "test"
}
Note: when you specify the custom sound file name omit the file's extension.

Here is where raix:push wraps and sends the notification:

            if (typeof notification.sound !== 'undefined') {
              data.soundname = notification.sound;
            }

Here is how it's documented to work:

Push.send({
  from: 'Test',
  title: 'Hello',
  text: 'World',
  badge: 12,
  // sound: fileInPublicFolder
  query: {
    userId: 'xxxxxxxxxxxx'
  }
});

All of which don't make sense when put together. It may work on iOS, but on Android, I'm calling it out as broken. If you've used this on Android, I'd love to know how you got notification sounds to work.

I'm a newb at Cordova, but from the docs, these would be the steps:

From the cordova plugin docs:

  1. In order for your your notification to play a custom sound you will need to add the files to your Android project's res/raw directory.
  2. Send the notification live above (w/o the file extension)

I don't know how to do 1)

Would love to be wrong about it not working :-)

@MichaelJCole
Copy link
Author

See #138,

@MichaelJCole
Copy link
Author

See also

@MichaelJCole MichaelJCole changed the title Notification Sounds do not work on Android Notification Sounds do not work on Android in 3.0 Nov 25, 2015
@MichaelJCole MichaelJCole changed the title Notification Sounds do not work on Android in 3.0 Notification Sounds do not work on Android in push 3.0 Nov 25, 2015
@devdudeio
Copy link

any way to get this working with custom sounds for iOS ? It only works for me with the default sound.

@willemserik
Copy link

i also can not get it working with default sound on IOS. do i need to do some special settings for that?

@MichaelJCole
Copy link
Author

See #9

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

3 participants