You’d think that AirPlay would be abstracted away by an OS API that does the local network discovery itself.
If anything, I usually see this for apps that want to do playback via Chromecast/Miracast. The well-behaved apps wait until the user interacts with Chromecast output, the iffier ones ask on first launch.