config-plugins icon indicating copy to clipboard operation
config-plugins copied to clipboard

feat(react-native-google-cast): add suspendSessionsWhenBackgrounded option to IOS

Open Bram-dc opened this issue 1 year ago • 0 comments

Why

This option is to enable background streaming using react-native-google-cast.

https://github.com/react-native-google-cast/react-native-google-cast/blob/main/src/api/useCastSession.ts

This is primarily targeted at iOS which by default suspends sessions when backgrounded. Alternatively, you can set options.suspendSessionsWhenBackgrounded = false when initializing the CastContext in AppDelegate.

How

Added the option to the plugin :)

Test Plan

I do not have access to an IOS device, but I did change the jest test suite to also check if the file generated is correct. Someone should run this with the example app to verify that this option is not breaking the app.

Edit: I just did and it works correctly!

Bram-dc avatar Apr 17 '24 11:04 Bram-dc