[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[[["\u003cp\u003eiOS 14 introduces new local network permissions that require updates to Cast sender apps for maintaining Cast functionality.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should update to Google Cast SDK v4.6.0 or later, add necessary entries to \u003ccode\u003eInfo.plist\u003c/code\u003e, and re-release their apps for iOS 14 compatibility.\u003c/p\u003e\n"],["\u003cp\u003eUsers will experience a one-time local network access permission prompt when attempting to Cast for the first time after updating to iOS 14.\u003c/p\u003e\n"],["\u003cp\u003eWith Cast SDK v4.6.0 or later, the Cast button is always visible, and a dialog provides guidance if Cast devices are unavailable.\u003c/p\u003e\n"],["\u003cp\u003eiOS 13 users should update to Cast SDK v4.4.4 or later to ensure reliable casting experience.\u003c/p\u003e\n"]]],["iOS 14 requires Cast app updates: Use Cast SDK v4.6.0 or later, prompting users for local network access permission. Apps must add `NSBonjourServices` and `NSLocalNetworkUsageDescription` to `Info.plist`, including Bonjour service names and a local network usage message. SDK v4.6.0 changes discovery to work with Xcode 12. SDK 4.8.3 is recommended. Apps with custom device pickers need to manually call `startDiscovery`. The Cast button always appears on Wi-Fi; if devices are unavailable, a dialog provides troubleshooting guidance.\n"],null,["# iOS Permissions and Discovery\n\nStarting with iOS 14, the operating system will enforce new restrictions and\npermissions that affect the Cast user experience. It will also affect how you\nbuild the Cast SDK into your app. For your app to maintain Cast functionality\nwith the latest versions of iOS, you must make updates to handle these\npermissions changes.\n\niOS 14\n------\n\nDevelopers should update their iOS Cast sender apps to the Google Cast SDK\nv4.6.0 or later. These versions provide support for iOS 14 and its requirements.\n\nBeginning with iOS 14, applications that scan for devices on the local network\nwill now prompt users with a one-time permissions dialog to find and connect to\nlocal network devices. The Cast platform uses the local network to discover and\ncontrol Cast devices, so if the user denies permission, they will not be able to\ncast.\n\nTo improve the user experience, we are making some UX modifications to the SDK\nfor those apps that are using the standard device picker. These UX modifications\nmake it more obvious to users why local network access permissions are needed,\nas well as how to enable casting if local network device access has been\ndisabled.\n\nApps built with versions of the Cast SDK using v4.4.8 or earlier will continue\nto work as long as they are built with Xcode 11.7 or earlier. If you are\nbuilding for iOS 14 with Xcode 12 or above, we recommend you update to the Cast\nSDK v4.6.0 or later to ensure that your Cast app will continue to work properly.\n\nThe Cast iOS SDK v4.6.0 or later can be downloaded with CocoaPods by following\nthe [CocoaPods setup](/cast/docs/ios_sender#cocoapods_setup) or manually by\nfollowing the [manual setup](/cast/docs/ios_sender#manual_setup). This release\nincludes changes to the underlying discovery mechanism to allow apps that are\nbuilt with Xcode 12 to find Cast devices on the network. The Cast button should\nnow always display. If no devices are available when the user taps on the Cast\nbutton, a dialog will be displayed providing guidance on why devices may not be\navailable, including information on how to re-enable local-network access\npermission.\n\n### Cast SDK changes\n\n#### First-time casting\n\nThe first time a user attempts to Cast, a local network access (LNA)\ninterstitial dialog will appear explaining why local networking access is\nneeded, followed by the Apple-provided iOS local network access permissions\nprompt. The mocks below illustrate the flow:\n\n#### Cast unavailable\n\nStarting with iOS sender SDK 4.6.0, the Cast button always appears when the user\nis connected to Wi-Fi. When Cast devices are unavailable,\ntapping on the Cast button brings up a dialog that gives the user\nhints as to possible reasons Cast is unavailable, as shown in the mocks below:\n\n### Updating your app on iOS 14\n\n1. **Add the Cast iOS SDK 4.8.3 to your project**\n\n\n If using CocoaPods, use `pod update` to add the 4.8.3 SDK to your project.\n\n\n Otherwise,\n [pull in the SDK manually](https://developers.google.com/cast/docs/ios_sender#manual_setup).\n | **Note** : If you built a custom device picker in your app, then you will need to explicitly call the `startDiscovery` method on the [`GCKDiscoveryManager`](/cast/docs/reference/ios/interface_g_c_k_discovery_manager) class to initiate device discovery. Automatic scanning was disabled by default beginning with the v4.5.0 release of the Cast SDK.\n2. **Add `NSBonjourServices` to your `Info.plist`**\n\n\n Specify `NSBonjourServices` in your `Info.plist` to\n allow local network discovery to succeed on iOS 14.\n\n\n You will need to add both `_googlecast._tcp` and\n `_\u003cyour-app-id\u003e._googlecast._tcp` as services for device\n discovery to work properly.\n\n\n The appID is your receiverID, which is the same ID that is defined in your\n `GCKDiscoveryCriteria`.\n\n\n Update the following example `NSBonjourServices` definition and\n replace \"ABCD1234\" with your appID. \n\n ```scdoc\n \u003ckey\u003eNSBonjourServices\u003c/key\u003e\n \u003carray\u003e\n \u003cstring\u003e_googlecast._tcp\u003c/string\u003e\n \u003cstring\u003e_ABCD1234._googlecast._tcp\u003c/string\u003e\n \u003c/array\u003e\n ```\n3. **Add `NSLocalNetworkUsageDescription` to your\n `Info.plist`**\n\n\n We strongly recommend that you customize the message shown in the Local\n Network prompt by adding an app-specific permission string in your app's\n `Info.plist` file for the\n `NSLocalNetworkUsageDescription` such as to describe Cast\n discovery and other discovery services, like DIAL. \n\n ```genshi\n \u003ckey\u003eNSLocalNetworkUsageDescription\u003c/key\u003e\n \u003cstring\u003e${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi\n network.\u003c/string\u003e\n ```\n\n\n This message will appear as part of the iOS Local Network Access dialog as\n shown in the mock.\n4. **Re-release your app to the Apple App Store**\n\n\n We recommend you also re-release your app using 4.8.3 as\n soon as possible.\n\n#### Customizations\n\n**Cast device discovery initiation**\n\nBy default, Cast device discovery is initiated the first time the user taps\nthe Cast button (`GCKUICastButton`). If this is the first time the user has\nattempted to use the Cast app on the local network after upgrading to iOS\n14, the new LNA interstitial will appear, followed by the iOS Local Network\nAccess permissions dialog.\n\nA new flag is available to allow you to control when device discovery starts\nand the behavior of certain elements of the UX:\n\n[`startDiscoveryAfterFirstTapOnCastButton: BOOL(true/false)`](/cast/docs/reference/ios/interface_g_c_k_cast_options#a1e701e7d1852d1e09ec2aee936b46413)\n\nThe default value is `true`. This flag is only applicable when the flag\n[`GCKCastOptions::disableDiscoveryAutostart`](/cast/docs/reference/ios/interface_g_c_k_cast_options#a6cfeb6f96487fd0e1fc68c31928d3e3d)\nis set to `false`.\n\nIf set to `true`, Cast device discovery starts when a user taps on the\n`GCKUICastButton` for the first time. An informational message will be\ndisplayed to the user letting them know why local network permission is\nneeded. Following that message, the iOS 14 LNA message will be displayed.\nCast device discovery starts after the message is acknowledged.\n\nIn subsequent App launches, `GCKUICastButton` always displays.\n\nIf set to `false`, device discovery will start based on the value of the\nflag\n[`GCKCastOptions::disableDiscoveryAutostart`](/cast/docs/reference/ios/interface_g_c_k_cast_options#a6cfeb6f96487fd0e1fc68c31928d3e3d).\n\n### Frequently asked questions\n\n#### What happens if I re-release my\nCast sender app with the Cast SDK v4.4.8 and Xcode 12?\n\nYour app may not be able to discover Cast devices on the local network\nunless you have obtained a networking multicast entitlement from Apple.\nNote that Apple will not be granting multicast entitlements solely for the\npurpose of supporting Cast.\n**If you plan to build with Xcode 12, you should release your app\nwith Cast 4.6.0.** \n\n#### If I re-release my app with the new Cast SDK, what\nwill my users running on iOS 13 or earlier experience?\n\nThey will continue to see the same user experience they had prior to\nre-release of your app. User-visible changes are limited to users\nrunning on iOS 14. \n\n#### What will I need to do to update my app once the new\nversion of the Cast SDK is released?\n\n- Update your app's `Info.plist` to include a local network usage description.\n- Add `NSBonjourServices` to your app's `Info.plist` and provide the Bonjour service names for Cast and your app ID.\n- Upgrade your sender app to use Cast SDK 4.6.0.\n- Re-release your app to the Apple app store. \n\n#### Why did devices stop showing up in my custom device\npicker after I upgraded to 4.6.0?\n\nThis is a known issue that can happen if you are using a custom device\npicker instead of the standard device picker. In version 4.4.8 of the\nCast SDK and earlier, device scanning was automatic. Beginning in version\n4.6.0, you will need to explicitly call the `startDiscovery`\nmethod on the\n[`GCKDiscoveryManager`](/cast/docs/reference/ios/interface_g_c_k_discovery_manager) class to initiate device discovery.\n\nThe reason for this change is because the Local Network Access (LNA)\npermissions prompt will appear after the app has scanned for the first\ntime. This could result in permissions dialogs appearing at random places\nin your app.\n\nDevelopers who build a custom device picker for their app will be\nexpected to provide an one-time interstitial prior to intiating device\nscanning for the first time in iOS 14.\n\niOS 13\n------\n\nWith iOS 13, new permissions requirements were introduced which impact\napps using the Google Cast SDK.\n\nStarting with Google Cast SDK v4.4.3, an additional SDK is available that does\nnot require Bluetooth® permission. This is available both on the [developer\nsite](/cast/docs/ios_sender#google_cast_sdk) and on the new\n`google-cast-sdk-no-bluetooth` Cocoapods.\n| **Warning:** The Guest Mode feature gave the ability for the sender app to be able to detect cast devices within a certain physical proximity without being on the same network, using a PIN displayed on guest mode-enabled devices. This feature is deprecated.\n\n### App breakdown\n\nHere is a breakdown depending on the version of the iOS SDK you are currently\nusing:\n\n#### Apps built with the iOS 12 SDK or earlier\n\n- **Action Recommended**. Device discovery performance may decrease when running on iOS 13, but will still be functional. We highly recommend developers upgrade to Cast SDK v4.4.4 when available.\n- iOS 13 will prompt users to grant Bluetooth® permissions to the app.\n\n#### Apps built with the iOS 13 SDK\n\n- **Action Required**: Update to Cast SDK 4.4.4 or the cast button may not appear if the user does not grant location permission. Upgrading to Cast SDK 4.4.4 is necessary to ensure a reliable casting experience on iOS 13."]]