iOS: Silencing Device in xCode - ios

We were creating an app that requires us to silence the notifications and ringers of our device. When the app is being used it must silence the device, and when it is done it needs to restore the volume and sounds.
We've thought of three ways to do this. We would like our app to be approved by the App store.
AVSystemController -> not approved
Setting a silent audio file as ringtone and notification
Tricking the device into thinking the headphones are plugged in.
Any suggestions? This is the biggest obstacle we've had.

This cannot be achieved.
I believe even if you find someway to overcome this issue, probably/definitely apple will reject it.
According to Apple's Review Guidelines
10.5 Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected

Related

How to fix App Store connect demo video error?

I’m trying to upload an speedometer app to apple App Store. But I get this error message from apple:
Does your app interact with hardware, and if so please provide a link to a demo video that demonstrates the current version of your app in use on a physical iOS device, which shows the initial pairing process and entire app workflow with the designated hardware.
I have sent them an video of the whole app but don’t accept it. Does anyone know how to fix this issue?
In the video, make sure you demonstrate the pairing of the "physical iOS device" and other hardware(BLE device?).
I think there is no other way to make your app approved.
With another phone take a video of your iPhone using the app physically.
For example: while walking record yourself holding the phone and the speedometer changing.
Also, tell Apple that your app does not interact with external hardware.

Make iOS application run at startup iPhone or iPad

I would like to do my app open when iPhone is turned on. I saw that have some people saying can be using voip key in Info.plist but I tried and can't to do that. Do someone have any idea to help me? Thanks
In short, iphone does not have any access to permission to edit about "onboot" or "onstartup."
Thus, without jailbreaking this would not be possible.
Check the links I provided on your comment.
This would not happen, your app will be active in background through pushkit only when your app dismissed before device goes off.
VOIP - The app provides Voice-over-IP services. Apps with this key are automatically launched after system boot so that the app can reestablish VoIP services. Apps with this key are also allowed to play background audio.
Even with "voip" present in "UIBackgroundModes" in "plist", iOS App does not auto start after device reboot in iOS10
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW1

Can we lock a phone with iOS programatically?

I need to set a timer to lock an iPhone from my app. While using the application, after 3 to 5 minutes the phone should become locked.
Short answer: You can't.
Long Answer: For the security of iOS users, Apple does not allow any application to work with important hardware matters, such as locking the iPhone or controlling the usage of other apps. If your app even attempts to do such a thing (using any method, like external APIs), your app will immediately be rejected by Apple. It is not even worth trying.
You cannot lock the screen programmatically without any private API. Even if you use a private API, your app may probably be rejected by App Store.
However you can indeed achieve by sending keyboard events from paired bluetooth hardware devices. But that means your code depends on a Bluetooth connection and I cannot think of any practice use of that. To do this with Bluetooth, click here.

Understanding interaction between Apple Watch and iPhone device

I am a bit confused as when I run the Apple Watch extension App schema on the simulator I see only that the Apple Watch app gets lunched. However I am not sure what will happen with real hardware once we get our hands on the Apple Watch.
I'd like to understand the following:
Do I need to start the corresponding iPhone App on the phone before
starting the App on the Apple Watch?
If the answer to 1 is no then, can I
start an iPhone App from the App on the Apple Watch? If the answer to 2
is yes then how can I start the iPhone App in a way that is not in
the background? (I found handleWatchKitExtensionRequest can trigger
background tasks but I haven't found any documentation yet for
that - I also found the Handoff Api which allows you to resume a task on the device but I don't like that it requires an iCloud account and I am not sure how to structure an App/watch interaction without forcing the user to adopt iCloud).
Given that the Apple Watch App extension resides on the iPhone App
bundle does this mean that when you start the Apple Watch App it needs a
connection and proximity with the iPhone device? I assume that there will
be a bluetooth connection and that it won't be possible to start
some apps if the user and its watch are away from the Iphone (what's
the range?)
Many Thanks
No.
No.
Unless you are on a Wifi network recognized by both your Watch and your iPhone, they'll need to be relatively close to each other. Guessing at range is useless – a number of factors can impact the useable distance of BTLE.

ios simulator - where is settings>notifications>appname?

I built a VOIP app for iphone where if you receive a call, you will hear a telephone ring tone. Some users have complained that they don't hear any ringtone. I discovered later that on the physical device, you can go to Settings>Notifications>TheAppName, and adjust your notification settings. One of htese settings is to disable sounds or allow sound, which corresponds to whether you get the ringtone or not when receiving a call. However, some users still don't seem to hear the ringtone at all despite having the most permissive sound settings.
I wanted to reproduce their issues in the iOS simulator. But I can't seem to find the Settings>NOtifications in the simulator. How do I locate this?
You cannot test push notification services on the simulator. You have to use a device to test it.

Resources