The enum UIEventSubtype (iOS UIKit Framework) contains events such as play, pause, next, seek, etc. However, the iPod Access protocol contains numerous other events, such as select, up, down and back (think iPod with clickwheel). The iPod app on iOS can receive these other events and respond accordingly (move selection up/down/back in playlists), but developer apps don't have seem access to these controls.
Does anyone know a way to receive these additional events in an iOS app (for jailbreak), other than opening the /dev/tty.iap port myself (or filing a bug report with Apple and waiting)? Perhaps there's a private framework that has what I'm looking for? I looked in the IAP framework but didn't see anything interesting.
#Victor Ronin had the right idea, in the Private Framework iPodUI I found a class IUAccessoryEventHandler containing methods like
- (void)handleDownArrowEvent;
- (void)handleUpArrowEvent
- (void)handleSelectEvent
When I hooked into them with a Theos tweak and inserted logging details, I was able to see that these methods were the ones being called when an external device was sending the commands.
Update: Unfortunately, the iPodUI framework were only available in iOS 5 and 6, according to the iPhone Wiki. Not sure if or where these methods are still available.
I don't have a ready answer for you, but since you are doing this on jailbroken device, you can use mobile substrate to inject code into iPod app and you can override UIApplication sendEvent to see all events, which it receives (including select, up, down etc).
Related
Is it possible to create pull to refresh action in WKInterfaceTable in watch os 2?
There is one question but its related to watch os 1.
WatchKit pull to refresh
Short Answer:
No, it's not possible.
Long Answer:
All WKInterface Objects are just proxy objects that allows you to send queries to real UI Object. So basically they are not treditional UI Objects.
Connections between real UIs and WKInterface objects are managed by watchOS. What if some WKInterfaceController got deactivated, the connections in it will be disconnected also. In this state, you can't send queries anymore.
You may know that there are two bundles for watch Apps, one takes storyboard and icons, the other one is extension bundle. With sand-box concept, your code(in extension) can't access UI(storyboard bundle sided) directly. The only way to interact is using Interface Builder outlets and sent action.
It(Remote-UI concepts) makes sense for watchOS1 since all the code runs on iPhone. However with some reason, WatchOS2 App also use same strategy. With this restriction, You can't write code that react user interaction to real UI Objects directly likes iOS apps. As I told earlier, You can use pre-defined sent action only.
Since Xcode Interface Builder doesn't provide sent action likes did scroll, You can't write code that react pull down.
I'm curious if there's a way in iOS to post events to the system, like touch or button press events. By posting to the system, I mean any application can receive them, including elements like the notification or control center.
I figure this requires an undocumented API, and that's fine. This is just for my own personal projects and curiosity, and not for something I would ever try to submit to the app store.
I'd love it if there was a way to do this without jailbreaking the device. However, if that's not possible (say because the undocumented API for doing this requires a private Apple entitlement) I'm open to methods that work for jailbroken devices.
I need to bind own actions on iOS headphones buttons.
For play/pause action i found solution:
Add audio background in .xcodeproj
Implement method remoteControlReceivedWithEvent
Set self as firstResponder
I can't set my class as first responder, bcs my class is subclass of UIViewController. For this method class must be a subclass of UIResponder. So i put this method in AppDelegate and create notifications.
1. Is there other way to put remoteControlReceivedWithEvent in my class, without changing superclass or using notifications?
2. Can i change volume up/down actions?
To be honest I think this is a bit of a grey area. Personally I think that if you alter the functions of those buttons your app will get rejected from the Apple iOS App Store Review process for breaching guideline 10.5. However I also don't believe that Apple will test your App with headphones unless you specifically state that headphones are required for your app to work. Though if your app needs headphones to access certain functionality and you didn't tell Apple so they didn't test it and they found out this could possibly get your account banned for dishonesty.
So in all honesty based on the review guidelines I'd say this can't be possible for the reason already stated and I also think that you'd need to access some private APIs to actually achieve this. So would also be rejected under 2.5.
2.5 Apps that use non-public APIs will be rejected
10.5 Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected
So if you are going to continue with this I'd tread very carefully about what you (1) do to implement it and (2) what you tell Apple when it goes into the review process. If it was me I'd tell Apple that there is functionality behind those buttons.
However I really don't think this would get past the review process for 2.5 no mind reaching 10.5
I can not use
UIApplication.sharedApplication().beginIgnoringInteractionEvents()
in WatchKit Extension, I have error:
'sharedApplication()' is unavailable: Use view controller based solutions where appropriate instead.
Is there some alternative ?
The short answer is: No there isn't.
The long answer:
Please keep in mind that the extension is not executed on the watch but on your phone. So if you would call UIApplication.sharedApplication() it would return you the application of the extension on your phone, anyway! Everything you do inside your extension is stuff that manipulates the extension on your phone. The only exception from this are the WatchKit methods. And even they are basically calls that are converted into instructions that are send over bluetooth to tell the watch what to do. At no time you can write code that executes on the watch!
You have no control what so ever about what the watch does with the instructions you send to it. You are basically acting as a server talking to a client and you have no control over the client. You should send as little instructions as possible and once you send them, your task is done, the rest is up to the watch.
That being said, you should carefully plan your UI in a way that you do not need any calls that manipulate the event delivery. You should focus on simple 'if user taps x I do y' interaction.
Another thing to keep in mind is, that your extension can not communicate with your main iOS app. You can create a shared app group between your iOS app and your watch extension to share data between them, however you can not directly communicate with your app. If you want to use parts of your apps logic, extract the module in question into a framework (this has become very easy with Xcode 6) and use the framework in both, your app and your extension.
I have a question about understanding event changes in iOS when VoiceOver is enabled. I'm developing some app for blind people.
Unfortunately there is not TTS support on iOS, differently from the Mac OS SDK where you can use NSSpeechSynthesizer objects.
I found VoiceService the is not public. So, in conclusione it seems that no API for speak text is available on iOS.
The question is: How can I notify the user about data processing end?
Here is a user case: User push button, the app make some calculus/process, than should return the result. In Mac this is easy you use speakString:#"Result".
But how can I tell VoiceOver to announce the result??
Excuse me if I was too contort :-)
Thank you very much...
You could use this
if (UIAccessibilityIsVoiceOverRunning()) {
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification,
#"Result has been computed.");
}
VSSpeechSynthesizer is available for the iOS - but it is a private API and as such will likely be rejected from the app store. However you can still make apps for private consumption.
http://iphone-dev-kitchan.blogspot.co.uk/2010/08/text-to-speech-using.html
I consider it being a Private API a bug as it makes creating accessible apps for the partially sighted for instance, harder. I have filed Bug ID #: 9451650 Bug Title: VSSpeechSynthesizer is Private
You can use FliteTTS which is free and reasonably simple to integrate, and still working in iOS5+.
https://bitbucket.org/sfoster/iphone-tts
You could also record a generic message 'Results available' as a wav file and play that. If your message is static (or is from a short list of possible results) you do not need TTS.
iOS6 VoiceOver / Accessibility was mentioned in the WWDC2012 keynote.
See previous answers here (which I have reiterated above)
How can I add NSSpeechSynthesizer Class Reference?
Is there an iPhone API that allows me to use VoiceOver directly in my app?