Skip to content

[iOS] Problem listening FinishedLoading & FinishedPlaying  #162

@HugoEdd

Description

@HugoEdd

I have a warning message on IOS devices, I created a general function. I do not how to avoid that warning. This is my function
let onFinishedPlaying = null;

export const playButtonSound = (sound: SoundNames, format: SoundFormat) => {
onFinishedPlaying = SoundPlayer.addEventListener(
'FinishedPlaying',
({ success }) => {
console.log('finished playing', success);
},
);

// Llamar a la función playSoundFile
SoundPlayer.playSoundFile(sound, format);
console.log('Reproduciendo');

// Eliminar las suscripciones después de su uso
onFinishedPlaying.remove();
console.log('removiendo');
};

Of this way I call it into other screens

playButtonSound(SoundNames.CartLimit, MP3);

warning message: Sending FinishedPlaying with no listeners registered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions