0

I am using the Bluemix Push Notification service and the ibm-mfp-push Cordova plugin to deal with Push notifications in my Ionic app.

I would like notifications to vibrate and play sound when they are received. I managed to do it on iOS. But I can't find a way to do it on Android.

Is there any way to configure the Bluemix push service and the Cordova plugin to achieve what I want to do?

I saw this post that pretends to give a solution. But unfortunately it seems to be applicable to the Android client sdk only, and not to the Cordova sdk.

Community
  • 1
  • 1
Johan Mereaux
  • 143
  • 11
  • Possible duplicate of [Bluemix Android Push Notification unable to implement custom sound notification](http://stackoverflow.com/questions/37364262/bluemix-android-push-notification-unable-to-implement-custom-sound-notification) – Dave Cariello Nov 28 '16 at 16:29
  • To me, it is not a duplicate. Your solution seems to only work with the native Android client sdk and not with the ibm-mfp-push cordova sdk. I know that the ibm-mfp-push cordova sdk has been updated recently and renamed to bms-push. Anyway, I really need to know if a solution for this sound related issue exists with the old ibm-mfp-push cordova sdk. Could you please respond to the questions I asked in the comment to your answer below? Thanks – Johan Mereaux Dec 11 '16 at 13:19

2 Answers2

0

In order to enable custom Android push notification sounds, simply include your custom sound file in your Android native resources directory.

When you go to send a message, either add the correct path to the custom sound file in the dashboard, or use the Push Swagger API to do the same.

Dave Cariello
  • 505
  • 6
  • 12
  • As explained, I am using an Ionic app with the old version of the plugin (ibm-mfp-push). Could you please give some details about where I should put the sound file in the ionic project structure? Does it have to be a .wav file? For sending the message, when you say "the correct path to the custom sound file", should this path be like 'res/raw/sound.wav'? And finally, I guess the solution you propose is for having custom sounds, but isn't there any way to have the device default sound played when a notification is received on Android? – Johan Mereaux Nov 29 '16 at 08:26
0

Two things:

The Push team recently updated from ibm-mfp-push to bms-push, so it may be a good idea to upgrade. (This is compatible with the new bms-core Cordova SDK.)

Like David said earlier, you will need to make a native change in the correct directory, so it plays the sound files.

Community
  • 1
  • 1
joe
  • 2,468
  • 2
  • 12
  • 19
  • 2
    Hi joe. I upgraded to bms-push and now notifications received on Android devices vibrate and play the sound configured by default on the device. This was not working with the previous version of the plugin. So seems like the answer to this thread is indeed to upgrade to bms-push – Johan Mereaux Nov 29 '16 at 08:17