mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 05:36:17 +00:00
fix(cast): use modern cast menus
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
const OPTIONS_PROVIDER_NAME =
|
||||
"com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME";
|
||||
const OPTIONS_PROVIDER_VALUE = "dev.zoriya.omni.OmniCastOptionsProvider";
|
||||
const MEDIA_TRANSFER_RECEIVER_NAME =
|
||||
"androidx.mediarouter.media.MediaTransferReceiver";
|
||||
|
||||
function patchManifestForCast(
|
||||
androidManifest: AndroidConfig.Manifest.AndroidManifest,
|
||||
@@ -36,6 +38,21 @@ function patchManifestForCast(
|
||||
}
|
||||
mainApplication["meta-data"] = metaData;
|
||||
|
||||
const receivers = mainApplication.receiver ?? [];
|
||||
if (
|
||||
!receivers.some(
|
||||
(item) => item.$["android:name"] === MEDIA_TRANSFER_RECEIVER_NAME,
|
||||
)
|
||||
) {
|
||||
receivers.push({
|
||||
$: {
|
||||
"android:name": MEDIA_TRANSFER_RECEIVER_NAME,
|
||||
"android:exported": "true",
|
||||
},
|
||||
});
|
||||
}
|
||||
mainApplication.receiver = receivers;
|
||||
|
||||
return androidManifest;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user