Hardware volume button and Swift - swift

Looking for a recommended approach to using the hardware volume buttons on iOS devices to control application functions. In this case, the buttons would be used to increase or decrease a qty field in a warehouse-management application.
There have been similar questions about doing this in Objective-C, but I am specifically inquiring about Swift.

This cannot be done if you want to release your app on the App Store. It will be rejected; the regulations disallow repurposing the hardware buttons for any other function.
As a specific example, some camera apps have been refused for using volume-up as a camera shutter:
Your application cannot be added to the App Store because it uses
iPhone volume buttons in a non-standard way, potentially resulting in
user confusion. Changing the behavior of iPhone external hardware
buttons is a violation of the iPhone Developer Program License
Agreement. Applications must adhere to the iPhone Human Interface
Guidelines as outlined in the iPhone Developer Program License
Agreement section 3.3.7
http://petapixel.com/2010/08/13/camera-shuttered-from-app-store-for-hidden-banned-feature/
EDIT: since you don't need to work on App Store, I looked for a solution for you and found an older answer you could use. iOS use the volume buttons as input

Related

Restrict my iOS device to a particular app

I'm searching a way to restrict my iOS device to a particular app.
I have found a good way to disable my iPad Home button functionality through Kiosk Mode for iOS
So is it possible to restrict my iOS device to a particular app without jail-breaking?
Will App-Store reject my application if I done this?
Phew... Finally I found.Guided Access is a new feature in iOS 6 that will do the functionality .It's a built-in feature.
Guided Access is activated for a particular app, iOS device will automatically launch that app every time.
You can power off the device by holding down the "Power + Home" button.
If you’d like to learn how to use Guided Access in iOS 6, You can see more details here
That is a huge security violation as far as the App Store would be concerned. For an enterprise applications its possible you could find a way. But for a public App Store download this is not only next to impossible its also a guaranteed rejection.
So is it possible automatically launch my app every time after iPad booted without jail-breaking?
No. Jailbreaking only will allow you to mess with the default behavior of the system such as Launch Items
Will Apple-Store reject my application if I implement the behavior?
If you somehow find a way to circumvent the issue, (i.e. exploit a security breach) then your app will be rejected.
App review guidelines, section 2.4, 2.5

appstore update refusal with strange resolution

I submitted my new version of my application but it be refused and the resolution said
10.3: Apps that do not use system provided items, such as buttons and icons, correctly and as described in the Apple iPhone Human Interface Guidelines and the Apple iPad Human Interface Guidelines may be rejected
We found your app uses system-provided items in a non-standard manner, which is not in compliance with the App Store Review Guidelines.
Please refer to the attached screenshot for more information.
As recommended by the iOS Human Interface Guidelines, Pickers should only be presented within a popover element and should not take up the entire width of the screen.
Learn more about system-provided items in the iOS Human Interface Guidelines, sections: "System-Provided Buttons and Icons" and "iOS UI Element Usage Guidelines."
the problem is that this part didn't be modified in this version and be accepted several time before
does the standard change or what, if yes how to correct that
It's telling you that you should be using the picker view in a popover and not take up the width of the screen.
Just because your app did this previously in earlier versions and was accepted, doesn't mean that they can't reject it in later versions. Particularly as it is explicitly stated in the guidelines that a pop over should be used in these cases.

iOS (Apple): Is there any way for the application to ask the OS to block the device in that application?

I would find useful, in some cases, and under the user's permission, to block the device so only the running application can be accessed unless the usrer's password (pattern or whatever is used to unlock the session) is introduced.
I guess the mecanism should be something like: The application asks the os to do this, the OS asks the user for permission and then the application asks the device to block the application on "exit" or standby (or both).
This would be useful for using an iPhone or iPad as a device for public use. One example could be a Library where visitors can see the book list and some previews in the device. In this case, you don't want the user to access any other resource/application in the system.
Does it make sense?
What your asking is there any type of kiosk mode for iOS devices.
The short answer in no. The longer answer is if you're using a Jail broken device you might be able to relaunch the app on exit, but it would take significant R&D.
I hade a client ask about this last week, after some investigation and thinking I told her,
It's best to look for a case that blocks the home button. Or some kind of security bracket. It'll be cheaper and easier.
Also any App you create with this functionality would be rejected form the App store.
If your looking for advice on programming Jail broken devices there is a Stack Exchange proposal you can follow.
Supposedly there's a way to have a "kiosk" mode with a .mobileconfig file. Both of these articles talk about it, basically covering the same territory:
http://joris.kluivers.nl/blog/2012/03/02/kiosk-mode-for-ios/
http://rick-hawkins.blogspot.ca/2012/01/turning-ipad-into-kiosk-device.html
I was looking into this again and found out that iOS already supports the feature. It is called Guided Access, it was incorporated on iOS 6, it does not require jailbreak and can be used for any app installed on the device.
It makes sense, but I don't think you can do that without jailbreaking the phone. In iOS, the home button cannot be overridden by applications. Besides there is cheaper hardware out there for kiosk-style applications.

Change iPhone settings from an app

Does anyone knows how to change the iPhone settings from interior of an app? For example: close the WiFi, disable 3G, change the sound volume and so on?
Apple is changing settings trough an app: Settings.app. It means that it's possible, I just don't know how.
Apple can do it in her Settings.app indeed.
Because of limitations of the iPhone SDK, some API's are not made public so you can't do everything Apple is able to do within her own OS. However, you can let the user adjust the main volume from your application, using the MPVolumeView class.
All applications written with the public SDK are sandboxed. They only have access to the properties and data which Apple deems feasible to use within that sandbox. Some of the examples you list are possible and some aren't.
Apple can perform these operations within their own applications since they don't use the public SDKs to write their applications - they use an internal SDK which has more functionality than the external one. They're not too worried about Apple employees hacking the phone and getting all your data off the phone.
Most of us wish that Apple could migrate more things to the public APIs (and they often do) but the reality is that the sandbox environment is carefully guarded. I wouldn't hold my breath to expect Apple to move all your examples over. You could always file a radar bug and let them know what you want - it's one way to have your voice heard.

iPhone app rejected upon section 3.3.3 (but what does it mean?)

I made an iPhone application that displays a couple of pictures from the internet
where you can comment on (iPhone sms bubble style )
My app was rejected because of:
We cannot post this version of your iPhone application to the App Store
because it violates section 3.3.3 of
the iPhone SDK Agreement;
"Without Apple's prior written
approval, an Application may not
provide, unlock or enable additional
features or functionality through
distribution mechanisms other than the
iTunes Store."
If you would like to provide an
invitation-only pre-release version of
your application to a group of
friends, then we encourage you to use
the Ad Hoc application distribution
method. Please go to the Distribution
Tab in the iPhone Developer Portal for
complete information on Ad Hoc
distribution.
But what does it mean? I surfed a little on the internet and found out that this covers applications that have similarity to applications by Apple?
Does anyone have experience with that? And know how to solve this issue?
I got official response from apple
The website component of the
application is currently not available
to the general public. If you would
like to provide an invitation-only
pre-release version of your
application to a group of friends,
then we encourage you to use the Ad
Hoc application distribution method.
Please go to the Distribution Tab in
the iPhone Developer Portal for
complete information on Ad Hoc
distribution.
Section 3.3.3
Without Apple’s prior written
approval, an Application may not
provide, unlock or enable additional
features or functionality through
distribution mechanisms other than the
App Store.
That means, for example, that you are not allowed to enable your application to download music or podcast files. Apple wants the owner of iPhones to use iTunes for that purpose.
You seem to violate that section since you're providing content from your site, even if you're downloading only pictures.
See this blog entry about the PodCaster app:
Podcaster quite obviously serves to
unlock a feature using a distribution
mechanism outside the iTunes Store.
This limitation would also include
apps that are designed to install
other apps independent of iTunes (such
as the Cydia jailbreak app - it’s not
in the Apps Store either), or any
other app that distributes song, TV,
or movie downloads or podcasts.
See also this answer here on Stack Overflow: Reasons for rejecting iPhone application by Apple store
Or they believe you used the open SDK to reuse the bubble control from the SMS app.
Can you post a screenshot?