0

In this javascript code which calls the immersive reader SDK, the onExit fires as expected, but the onPreferencesChanged never fires. What am I missing here?

async function LaunchImmersiveReader(title) {
    const data = {
        title: title,
        chunks: [{
            content: title,
            lang: 'en'
        }]
    };

    const token = await getImmersiveReaderTokenAsync();
    const subdomain = await getImmersiveReaderSubdomainAsync();

    const options = {            
        onPreferencesChanged: onPreferencesChangedCallback,
        onExit: exitCallback
    };
    

    ImmersiveReader.launchAsync(token, subdomain, data, options);
}

function exitCallback() {
// this fires as I click the immersive reader exit/back button
}


function onPreferencesChangedCallback(value) {
// this never fires as I change font, size, etc.
}
dev.net
  • 5
  • 2

1 Answers1

0

What version of the SDK are you using? The preferences callback is part of 1.1.0

I did notice that a lot of our sample projects and documentation is using 1.0.0 still, which might be leading to the confusion

Tessa
  • 176
  • 13
  • Thank you...that was it. I changed my version to 1.1.0 and the callback fires. – dev.net Jul 23 '20 at 15:25
  • Great! Thanks for posting the question, we're now updating all of our samples & docs to be more clear. If you could mark my answer as accepted that would be great too thanks! – Tessa Jul 23 '20 at 16:48