So I try to create a custom keyboard extension with a speech recognition functionality provided by our own server. In some older thread I read about the restriction where you cannot use the microphone from an App Extension, but I cannot found any hints about that in the new Developer Documentation. There is only a bullet point which mentioned the fact that you cannot access the Microphone when RequestOpenAccess is set to false in the Info.plist file, which made me thought that I can use the microphone from inside the keyboard.
So I tried it myself, set the RequestOpenAccess setting to true and also set the "Microphone usage Description". The question to allow the microphone showed up on the first try but the recording did not start and there were no hint about it in the console and no errors poped up. I tried the recording code before, directly inside the app and there it worked perfectly, so I think it has nothing to do with this code.
As an addition I tried the Keyboard in the Simulator and there the recording worked also as intended so I think I maybe miss some permissions or something.
Does anybody know something about this and can help me figuring out my issue?
The workaround is to make keyboard extension open containing app which does the actual mic recording and communicates with extension via user defaults. The containing app switches back to host app after it starts recording.
I’m using the default iOS file manager for a Swift application. I’m writing the class for a UIDocumentBrowserViewController and I want the whole file name to show. For example rather than Untitled, I want Untitled.txt. Or rather than script, script.py.
As a side note, I notice that the actual files app does not have functionality to show the extension.
Sometimes its worth to check apple documentation) https://developer.apple.com/documentation/uikit/uidocumentbrowserviewcontroller
As I see it is possible to show file's extension, with help of var shouldShowFileExtensions: Bool from UIDocumentBrowserViewController. But to our sorrow it's available only from iOS 13.0+.
And as Apple says about this property https://developer.apple.com/documentation/uikit/uidocumentbrowserviewcontroller/3153159-shouldshowfileextensions
The default value is false.
This property has no effect in iPad apps running in macOS.
I have been working on a project wherein i made a framework where i automatically test the SDK my company is developing.
I have created my dummy sample application for all the platforms(iOS, Android, OSX, Windows) which makes use of this SDK and i thereby test this SDK, call the SDK API's do my work.
Now my question is for iOS i get permission alerts for Contacts, Camera and Microphone first time whenever i use the API's of my SDK which internally is invoking something in iOS framework. Is there a way i can automatically give this permission to my application ?? i know it's iOS own Security concern and it's correct. But how do i bypass it.
I see there is Apple's XCUITest framework but i don't want to open my application via it.
Right now i handle this alert manually but i need to implement Continuous Integration(using ios-deploy), i have done everything but i can't handle these alerts automatically.
Can someone please help me.. Thanks!!
I am making a simple sprite kit game that needs an audio input from the microphone for voice commands. I have already created a simple game and I have already created a separate app that if you speak a word it detects and it displays on the screen using cmu-sphinx/pocketsphinx (http://cmusphinx.sourceforge.net/).
I was using Novocaine (https://github.com/alexbw/novocaine) because I have used this library numerous times and had great success with it in other projects in the past, but whenever I initiate the Novocaine object in the game, my app crashes with an exception.
So I figured that since I was using a wrapper library it must have been some deprecated functions that were not supported any more, so I did some more research. I came across Apple's demo app AurioTouch (https://developer.apple.com/library/ios/samplecode/aurioTouch/Introduction/Intro.html). After playing around with that sample app, I was able to narrow down the classes that I needed to get the raw input values, which was primarily the AudioController class. So I imported over the AudioController class and its necessary components and was able to build it. Fortunately, the example had proper exception handling so I was able to see where it was failing. The exception was caused by this line:
AudioUnitInitialize(_rioUnit)
I was beginning to suspect that trying to access the microphone in a SpriteKit/SceneKit environment was causing the issue. I've also tried the same steps mentioned above in brand new SpriteKit and SceneKit projects and did not resolve the issue. So I am wondering if it is anyway possible for you to give real time microphone input within a SpriteKit/SceneKit project.
There is a setting in the iOS Settings app under Privacy : Microphone, where you have to switch on permission for an app to use the device's microphone. The AVAudioSession requestRecordPermission API can help check this permission setting.
There are also some AVAudioSession categories that should be set and activated to use the microphone. The use of SpriteKit and SceneKit does not interfere with these settings.
In iOS 10 Apple is extending the scope of privacy control. You have to declare in Info.plist file access of any private data.
Goto Info.Plist file and added the privacy key according to your requirement.
Microphone :
Key : Privacy - Microphone Usage Description
Value : $(PRODUCT_NAME) allow microphone use to give audio input for voice commands.
Currently I have to test app and set the different fake GPS locations on real IOS 7 devices. On Android I use 'My Fake Location'. Unfortunately, I didn't find the same app for IOS 7.
Any ideas to solve my problem?
When running in debug mode you can use the little arrow button in the debug area (Shift+Cmd+Y) in Xcode to specify a location. There are some presets or you can also add a GPX file.
You can generate GPX files here manually: http://www.bikehike.co.uk/mapview.php
(from answer: https://stackoverflow.com/a/17478860/881197)
Create a .GPX file with xcode, then specify your coordinates and when your device connected, hit the little arrow button and select your .GPX file.
You can create multiple files and add lots of coordinates to single .GPX file in order to make some kind of route.
Of course ios7 prohibits creating fake locations on real device.
For testing purpose there are two approches:
1) while device is connected to xcode, use the simulator and let it play a gpx track.
2) for real world testing, not connected to simu, one possibility is that your app, has a special modus built in, where you set it to "playback" mode. In that mode the app has to create the locations itself, using a timer of 1s, and creating a new CLLocation object.
3) A third possibility is described here:
https://blackpixel.com/writing/2013/05/simulating-locations-with-xcode.html
Working with GPX files with Xcode compatibility
I followed the link given by AlexWien and it was extremely useful: https://blackpixel.com/writing/2013/05/simulating-locations-with-xcode.html
But, I spent quite some time searching for how to generate .gpx files with waypoints (wpt tags), as Xcode only accepts wpt tags.
The following tool converts a Google Maps link (also works with Google Maps Directions) to a .gpx file.
https://mapstogpx.com/mobiledev.php
Simulating a trip duration is supported, custom durations can be specified. Just select Xcode and it gets the route as waypoints.
xCode is picky about the GPX file it accepts.
But, in xCode you can create a GPX file with the format it will accept:
And then just change the content of the file to the location you need.
you can do it on real device by run device in Debug mode
Click Debug->Simulate Location -> add .gpx file for your location during run time
I had a similar issue, but with no source code to run on Xcode.
So if you want to test an application on a real device with a fake location you should use a VPN application.
There are plenty in the App Store to choose from - free ones without the option to choose a specific country/city and free ones which assign you a random location or asks you to choose from a limited set of default options.
it seems with XCode 9.2 the way to import .gpx has changed, I tried the ways described here and did not do. The only way worked for me was to drag and drop the file .gpx to the project navigator window on the left. Then I can choose the country in the simulator item.
Hope this helps to someone.
There are one solution for fake GPS in ios simulator and real device. we can use GPX file for fake GPS and simulation.
I followed the step by step guidelines of GPX file use in Xcode with simulation.
Here is full step by step guidelines of GPX file use. And also you can download the GPX file Demo from github.