I am trying to run an audio on a specific event when app is open (foreground). When app is not running (background or force closed) this is taken care of by push notification
This is what i am doing in my constructor
this.platform.ready().then(() => {
this.nativeAudio.preloadSimple('uid134199', 'audio/newOrder.mp3');
this.audio = {
key: 'uid134199',
asset: 'audio/newOrder.mp3',
type: 'native'
};
})
This is what i do at that particular event
this.nativeAudio.play(this.audio.asset).then((res) => {
alert(JSON.stringify(res));
}, (err) => {
alert(JSON.stringify(err));
});
Does not work whatsoever, neither success alert, nor failure alert.