Require ForceTouch iOS App - ios

Is there a way to write an app's "Required device capabilities" such that the app runs only iPhone 6s and above (due to a requirement of force touch)?

You normally use the UIRequiredDeviceCapabilities key, which can require certain features to be present. However at this time it doesn't seem like 3D Touch has been added.
A large warning will have to suffice for now, while waiting for apple to add 3D touch as a thing you can require. Otherwise there might be some features only the new iPhones models have, such as the arm chip, you could require. I haven't looked into this though.
On apples page for documentation you can see available keys for the UIRequiredDeviceCapabilities, where 3D Touch doesn't seem to be present.
open https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW3

No, at this time it is not possible.
It is likely that Apple will introduce a new value to use with the UIRequiredDeviceCapabilities key.
Until that time, the best you can do is require one of (arm64, metal or opengles-3), and one of something like telephony or sms (until iPads get 3D Touch). This will at least restrict your app to the iPhone 5S and up.
And put a notice in the app description that your device requires 3D Touch.
Keep an eye on this document for all the possible device capability values:
https://developer.apple.com/library/ios/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html
Also, this is handy:
http://28byteslater.com/ios-compatibility/?exclude=&require=22,7,19,26#chart

Related

Is there a way to exclude an app that requires pedometer from the App Store?

I'm working on an app that requires step counting.
There are several devices that don't support this feature (for example in my iPad mini 2, CMPedometer.isStepCountingAvailable() returns false).
Since the app heavily relies on the pedometer, I'd like to make it unavailable to download for unsupported devices.
I would expect to find a pedometer-related entry in the documentation of UIRequiredDeviceCapabilities, but there is none.
Is this possible in any way?
No, it is not possible to make an app unavailable for download on the basis of CMPedometer.isStepCountingAvailable(). The preferred method would be to display a notice to the user once downloaded, that their device does not support the required functionality.

identifierForVendor or similar for watchOS (2.0+)

Is there any replacement for identifierForVendoron watchOS (2.X)? I have been reading the documentation but it doesn't look like there's any similar method for identifying the device.
Thanks!
You don't need to identify the watch. (hand wave)
A user can un-pair and re-pair different watches — say, to switch between a Sport for the gym and an Edition for cocktails — and from the user's point of view when interacting with software, they appear to be the same watch. (The un/re-pairing process is a bit cumbersome, but some people can and do rely on this behavior.)
If you must identify the user, use identifierForVendor on the paired iPhone (and pass it to the watch with WatchConnectivity if you need it there).
Update: it seems that since watch0S 6.2 the identifier was added

Lock iOS app in single app mode programmatically

Note : I don't want to submit this app to app store.
What i want to achieve :
I want simple app with one view having two button Lock and Unlock.
Lock - This button will lock device. Only this app's screen will show nothing else will be accessible even after restart same screen will show up. Home button, gestures will get disabled similar to single app mode.
Unlock - This will unlock device and switch to normal behaviour of device.
iOS :
I want this for iOS 4.3 and above.
I have checked following solutions, but these don't match my requirements
Configuration profile
Lock-down iPhone/iPod/iPad so it can only run one app
But it is manual (reboot device, open app which you want to run in single app mode). I want to do it programmatically the way i mentioned above through my app.
Guided access (iOS 6 and above)
How to lock down user to Single App mode in iOS 6, Programmatically?
I want it do for all os and programatically.
Is there any way to do this ? As i don't wan't to submit it to app store is there any private api, some hack for springboard to achieve this ?
Thanks in advance !!
As I know in iOS 7 there is a new feature which allow to do exactly what you want.
However, it's only applicable for iOS 7 (and I believe it's only applicable to a supervised devices).
1) You will need to install restriction configuration profile with autonomousSingleAppModePermittedAppIDs key (take a look here)
This is one time step and a user will need to manually accept this configuration profile.
There is another option to use MDM to install it silently, but it could be an overkill for you.
2) You should use API:
UIAccessibilityRequestGuidedAccessSession (to lock/unlock)
It is defined here
3) And most beautility part. All of it is officially document. So, you can even submit it to AppStore.
P.S. Why do you care about 4.3 or 5? They have tiny market share by now. Most likely even iOS 6 has below 20% market share already.
Update 1
Potentially, you can try to use API which sends clicks and keys (search for GSEvent in iPhone-privateapi tag). May be using these API's you can do triple home to toggle accessibility on and off.
If this work, I think you should be able to cover iOS 6. I am not sure whether both this API and triple home click were available prior that.
It looks like this private API is unaccessible anymore in iOS 7. So, probably you can ignore this idea.
Just wanted to write on this even though this is old as i needed to implement a similar solution and i got it working. The steps for me as follows and a note here is that this involves MDM and other specific steps.
My requirement was as follows. Each of the iPad at different locations has a set of apps installed.For ease of it lets assume each Dept. has their own apps. Participants open a app related to their dept. to take a test, the APP automatically Locks the iPad to single-app Mode and at the end of the test, it will unlock it self.
Supervise the iPad/iphone using the Apple Configurator.
Install the MDM related files ( Each MDM has its own set of instructions, usually involves downloading a profile).
Every MDM has a option of Single APP Mode or MultipleAppMode. Select the second option and add the app IDs to the list. (A single APP mode works pretty well with MDM's but i did not want the app to be locked to a single APP all the time).
I used the UIAccessibilityRequestGuidedAccessSession api to lock unlock the device from single app mode.
http://bobxcode.blogspot.com/2015/12/programmatically-implement-single-app.html
Thanks,
Bob
In MDM configuration, There is an option
autonomousSingleAppModePermittedAppIDs
Optional. Supervised only. If present, allows apps
identified by the bundle IDs listed in the array to
autonomously enter Single App Mode.
Availability: Available only in iOS 7.0 and later.
But this needs Supervised Device mode.

Pasteboard not accessible when locked with passcode on iOS

I have noticed I cannot access the Pasteboard in iOS whenever my device is locked with passcode. I know there was a restriction regarding keychain, but not sure why its affecting pasteboard as well. Is this a known issue or purposeful restriction?
I'm assuming this is desired function.
Imagine an app like 1Password. That app supports copying a password to the paste/clip board.
If I have a passcode set on my device, it's probably because I don't want people to be able to see the data on that device - it could contain stuff like, say, all the specs and launch date for the next iPad.
As a user, I probably shouldn't be copying such information to the pasteboard, but, hey - my device is locked with a passcode, right? No one can see my info, right?
Apple knows that users often use this line of reasoning, and, however flawed it may be, you build your OS for the user - not the user for your OS.*
* Unless you're Microsoft building Windows 8. Then you can break all the rules and make a strange OS.

Is it possible to use iPhone's volume control buttons for some other purpose?

I need to make a photo app.
Will it be possible to assign some function, like controlling the light intensity or brightness to an iPhone's hardware volume control buttons?
Changing the behavior of iPhone external hardware buttons is a
violation of the iPhone Developer Program License Agreement.
There is an app that was banned from the appstore for trying this.
Ironically, iOS5 Camera App allows to use the volume control as a shutter. Perhaps the SDK will eventually allow more.
This is possible. This tutorial will walk you through the steps.
http://fredandrandall.com/blog/2011/11/18/taking-control-of-the-volume-buttons-on-ios-like-camera/
In general, the App Store Review Guidelines state that re-purposing physical buttons is not allowed. However, since the volume up button is now a standard feature for taking photos, there appears to be some leniency for camera apps that also adopt this feature. The official guidelines state this rule in section 2.5.9:
https://developer.apple.com/app-store/review/guidelines/#software-requirements
2.5.9 Apps that alter or disable the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, or other native user interface elements or behaviors will be rejected. For example, apps should not block links out to other apps or other features that users would expect to work a certain way. Learn more about proper handling of links.
Short Answer:No.
A few photography applications have tried to do this and Apple has rejected them all. Maybe one day...
Yes, but only on a jail-broken phone.
I don't think this is really possible as we cannot change the in-built functionalities of the volume control of iPhone and for that matter any of the iOS devices and make it work as we want.
I think all this is not a part of Public API for iOS developers which we can modify and use it for other functions in our application. It is a part of Private API.
So as far as I know, it is not possible.
Hope this helps you.

Resources