question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Are sounds implemented yet?

See original GitHub issue

HI,

anything I am missing to get sounds to work?

here’s my init:

Push.init({

            bagde: true,
            sound: true,
            alert: true
        });

BTW, they seem to work fine on iOS if I am using one with push simulators.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:57 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
maciejsawcommented, May 1, 2016

The cordova-build-override folder might help http://guide.meteor.com/mobile.html#advanced-build

I can confirm that this solution worked for me on Android.

  1. In root of your project create path /cordova-build-override folder
  2. Place your audio file in a folder structure like this /cordova-build-override/platforms/android/res/raw/sound.mp3 Don’t use special characters and hyphens in sound file name screen shot 2016-05-01 at 11 59 59 pm
  3. In config.push.json say “sound”: true screen shot 2016-05-02 at 12 04 56 am
  4. When sending push say sound: “sound” (sound.mp3 referred WITHOUT extension) screen shot 2016-05-01 at 11 59 47 pm

@raix can you add this into the docs and update the example app?

Possible solution for iOS (NOT TESTED): I assume for iOS you can use similar workflow but place the sound file in public folder and refer the file with full path of cordova build:

Push.send({
  ...
  apn:{
    //this should work because we added audio files in the public folder
    //so this file will be copied to cordova build into the path below
    sound: "www/application/app/sound.wav",
    ...
  },
  gcm: {
    //this will refer to the audio file we placed in /cordova-build-override
    sound: "sound",
    ...
  }
})
2reactions
Streemocommented, Nov 26, 2015

@mvgalle Great! Thanks for sharing, this works. If anyone is still having issues with this problem, here’s a summary of what worked for me, from start to finish, using a custom modification of raix:push [1]:

Create myalert.mp3 and myalert.wav. Load myalert.wav into this package via package.js:

...
api.addAssets('lib/public/myalert.wav','client');
api.export('Push')
...

Next, we need to add myalert.mp3 into a special folder to work with android. see @mvgalle’s post

#in your project's root
mkdir .meteor/local/cordova-build/platforms/android/res/raw
cp path/to/myalertmp3 .meteor/local/cordova-build/platforms/android/res/raw/myalert.mp3

Your config.push.json should look like this:

{
  ...
  "sound":true
}

Your calls to Push.send should look like this:

Push.send({
  ...
  apn:{
    //this works because we added 'myalert.wav' as an asset to the custom push package.
    sound: "www/application/packages/yourname_push/lib/public/myalert.wav",
    ...
  },
  gcm: {
    //this will refer to the file we placed in '.meteor/local/.../android/res/raw'
    sound: "myalert",
    ...
  }
})

[1] To create a custom modification of raix:push, use git clone to pipe the source code of raix:push into yourproject/packages/push. Then modify the name in package.js to yourname:push. I did this because I needed to modify some source code of raix:push. If you don’t need to modify the source, then you can just put myalert.wav into yourproject/public, and meteor should load it into the www/application/... directory during the build.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is implementing the sounds into the project part of a sound ... - Reddit
Depends on the job, but I'd say being able to implement your sounds is very valuable. Programming knowledge and experience with fmod and...
Read more >
Arousing the Sound: A Field Study on the Emotional Impact on ...
The studies above have suggested that listeners do not react emotionally just to acoustic waves but also to sound sources and sound events,...
Read more >
How software got so noisy, and why it's probably going to stay ...
Sound designers listen extensively to sounds before deploying them in products, but they can still be jarring to some people.
Read more >
Sound Advice: A Quick Guide to Designing UX Sounds - Toptal
Sound Advice: A Quick Guide to Designing UX Sounds ... Sound can be easily overlooked in UX design, but it's an essential element...
Read more >
Sound Design: Everything You Need To Know - NFI
During this initial step, sound designers may record sounds, use sounds from a sound library, or create original sounds. 2. Mixing, Editing, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found