Disable SharePlay / screen sharing on iOS 15 - ios

iOS 15 introduces the ability for people to share their screen via FaceTime (https://www.apple.com/uk/newsroom/2021/06/ios-15-brings-powerful-new-features-to-stay-connected-focus-explore-and-more/) - from a developer POV, is there a way to disable this for my app?
I can't find any information on how this might be possible and, similar to screenshot functionality, I fully expect that the answer is no.
However, I've been asked to investigate - hence this question.
Many thanks for the help!

You can't opt-out as such, but you can detect that screen sharing is active and adapt your UI in response. For example, you could overlay a view stating "Screen sharing not available" or similar.
Apple describes this technique in this technote but, in summary:
You can listen for the capturedDidChange notification and when you receive this notification, you check the isCaptured property of UIScreen - If it is true then the screen is being shared to some external destination; This could be via a screen recording a broadcast extension, AirPlay, Quicktime capture via cable or the new SharePlay feature, but you probably want to handle all of these in the same way.

Related

How can I programmatically disable iphone home button in swift 4?

I am going to develop an application for kids. That I needed is I have to lock the home button permanently for this particular application but I didn't get any solution for this.
For kids, there is a feature in the iPhone setting called "Guided Access" this setting lock the phone with one app. This could be helpful for you. You can mention this in your app.
You can use this API to do programmatically. It was introduced in WWDC 2017. For more information how to use API and lock in a specific way. Please check this video. For doing programmatically without any device management it has been explained at 15:40th minute.

ios objective c small notification banner for no internet connection and back to online same like youtube app for iphone

I want to implement a bottom bar banner for no internet connection same like youtube app. I am not able to find any solution please help if anybody have idea about it.
You can identify change status that is, when a app is connected or disconnected or changed(wifi to data) network using reachability.
Look at this official Apple documentation
Using Reachability you can recognize the type of your connection.
There is also an example on how detect the network changes.
According to detected changes you simply have to trigger UI in main thread which will show you banner in bottom.
Note - Your question is very broad and if you google a little bit more you'll get your answer easily. Let me know if you need further help in this.

How to check whether device set vibration mode or not in iOS programatically?

I am making a VoIP application for iOS. For incoming calls, I have set some custom ringtones. It's working fine, but I want to check whether the device settings are set to Vibration mode or not programmatically.
I have searched on the web regarding this issue, but I've only found answers for silent mode detection. Instead, I want to check whether the device is in vibration mode or not.
When an incoming call comes to my app, I want to use vibration mode if the device settings are set to vibration mode.
Could any one help me?
At first look it seems like none of the Audio Session properties allow you to read the value of this setting. However an alternative, albeit not exactly what you're looking for, is to check if the ringer is set to on-or-off and provide at least a semi-expected vibration experience to your user.
Ronak Chaniyara pointed you to the right answer here, however that is deprecated in iOS 7.0. Instead use AVAudiSession -setCategory to set the proper category of your audio. If you expect your audio to be muted by the silent switch or screen lock use AVAudioSessionCategorySoloAmbient otherwise use AVAudioSessionCategoryPlayback.
More details on AVAudioSession, it's settings and properties can be found here.

ios Objective-C how to display different video feed on big screen

According to the first comment at the end of this article:
http://www.imore.com/keynote-iphone-ipad-review
And here:
http://help.apple.com/keynote/ipad/2.2/#/tand1a4ee7c
It seems that you can configure keynote for iPad, such that you can see speaker notes on the iPad when you're using a dongle to plug into a projector or big screen; but not on the big screen.
Is this functionality only afforded to Keynote through some private API in the OS level? or does anyone know of a way of achieving this programatically? My use case doesn't need to make it into the app store - so a private API hack could work for me.
No need for private API's. You can observe UIScreenDidConnectNotification notifications for when a second screen is connected whether it's airplay or hdmi.
You then provide a View/ViewController for that screen.

Where can I find iOS dual display for Apple TV documentation?

Would anyone know the whereabouts of the documentation on how to implement AirPlay dual-screen functionality into an app?
e.g. http://www.apple.com/uk/appletv/airplay/
This link has very brief, but from what I can see totally sufficient information if you scroll down to "Make the Most of a Second Display".
In short, you register for notifications on a connect to an external display to get a handle to it, and switch between drawing on the two displays by using setScreen(). Besides that, everything drawing related should be "the usual".
Overview
The user can connect additional screens to an iOS device at any time using AirPlay or a physical cable. Each additional screen represents new space on which to display your app’s content, and is managed by a UIScreen object. For example, a game might show its content on a connected display and show game controls on the iPhone screen, as illustrated in Figure 1. Displaying Content on a Connected Screen

Resources