Onion Hair
Onion Hair

Reputation: 11

originator doesn't have entitlement in Capacitor app build for iOS. Playing Audio

I'm having a problem playing regular audio in an html/js file, built to iOS. The audio plays correctly (.wav files/ sound effect triggered in a game), but the debugger pops the error:

Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.assertions.webkit AND originator doesn't have entitlement com.apple.multitasking.systemappassertions)}>

`function initAudioContext() {
    if (!audioContext) {
        audioContext = new AudioContext();
        // Step 2: Load Audio File
        loadSound('assets/wersh.wav');
    }
}

// Load and decode audio file
function loadSound(url) {
    fetch(url)
        .then(response => response.arrayBuffer())
        .then(arrayBuffer => audioContext.decodeAudioData(arrayBuffer))
        .then(decodedBuffer => {
            soundBuffer = decodedBuffer;
        });
}

// Step 3: Play Sound
function playSound() {
    if (soundBuffer && audioContext) {
        const source = audioContext.createBufferSource();
        source.buffer = soundBuffer;
        source.connect(audioContext.destination);
        source.start(0); // Play immediately
    }
}`

then I call playSound(); in a trigger.

I've added the entitlements for: Audio, AirPlay, and Picture in Picture Background fetch Remote notifications Background processing

I tried different methods to trigger/play sound.

Upvotes: 1

Views: 276

Answers (0)

Related Questions