So I have this code to play an audio and redirect depending on an argument passed through the function.
In the case of iOS is works totally fine. But in the case of android it does not do anything. The code block doesn’t work at all.
async redirect(loc) {
const soundObject = new Expo.Audio.Sound();
if(this.state.mute === false){
try {
await soundObject.loadAsync(loadedClickSound);
await soundObject.replayAsync();
} catch (error) {
}
}
switch(loc){
case "help": {
Actions.help();
break;
}
case "score": {
Actions.scorePage();
break;
}
case "play": {
if(this.state.mute === false){
soundObject2.unloadAsync();
}
Actions.loading({ soundObject });
break;
}
case "selectPlay": {
Actions.select({ soundObject2 });
break;
}
default: {
Actions.trophies();
break;
}
}
}