I want to create an Expo app for ios that will say something, and wait for my reply, via headphones. The headphones part is immaterial but it indicates what I want... which is for this to run while my phone is locked and in my pocket. Once I have replied, the app would proceed. I have built Expo apps but I am unsure of whether an app can still interact with me via audio and the microphone in this way while the phone is locked. Also, I don't know if Expo has introduced this sort of capability. I also don't know if React Native (i.e. ejected Expo apps) can do this sort of thing. The lack of apps that truly interact in this way (not via Siri etc) are far and few between so I'm assuming it's a hard problem to solve. I would be just as happy if I could have a browser page running on the device do the same thing, but I'm pretty sure webpages can't play audio and wait for replies when a phone is locked. Is any of this possible at this point?
I did research this online, just to be clear. I wasn't able to find an answer so I came here. I mention this because this whole post does have that 'can you research this for me' vibe. I'm just hoping someone has knowledge of what is possible.
There is a page in the expo documentation that says when not to use expo, and the following is in there:
The SDK doesn't support all types of background code execution
Background execution is the ability to run code when the app is not foregrounded or the device is sleeping. We support background geolocation (including geofencing) and background fetch, but we do not yet support background audio with the operating-system playback controls and you cannot handle push notifications in the background. This is a work in progress.
You can take a look at it here.
I think you can do it in React Native though, however I can't say if there is a library to do it, so you can try creating your own with native code. You can see how here for android and here for ios.
Related
We want to develop and iOS app which can be able to skip YouTube ads while YouTube video is playing in iOS APP. This app runs in background while video is playing. Our Android team develop this app because android gives them a system level permission to skip ads. Is there any OS level permission in iOS to skip ads?
Unfortunately I don’t think that’s actually possible.
In order to have an app run in the background like that, you would probably have to be jailbroken or have root access. To skip a youtube ad as well as that, that sounds impossible, unless Youtube has some sort of system in place allowing other apps to add functionality to the Youtube app.
There are apps that connect with the Safari app and block certain things on webpages, but none skip youtube ads, they just block them.
With a jailbroken iOS device, I have seen many tweaks which do things similar to this, but I haven’t yet seen a tweak which actually skips the ad the way you want.
Considering this, your request may be impossible with the current nature of iOS.
Anybody please correct me if I’m wrong about any of this.
We are facing some strange issue in the iOS app , we are handling the signal when app in background mode.
It's perfectly working in xcode simulator and the same thing it's not working in real iOS devices. The signals not receiving in app background mode.
Do we need to enable any settings in iOS devices to handle this?
And, It's perfectly working in android devices.
Please help on this.
(Also Project->Capabilities-> Background Modes -> Audio,AirPlay,PIP is enabled for this to work in background.)
Apps sent to the background are generally expected to get suspended unless there is a reason for the process to stay running. In the case of using the OpenTok SDK, usually this means the app will be suspended unless there is a Publisher and/or Subscriber running -- background permission is tied to the AVAudioSession.
If you are trying to just keep a session connected without any subscribers/publishers while the app is in the background, this is not a recommended implementation. Keeping a websocket active for an OpenTok session requires trickling data every few seconds, creating an unnecessary burden on energy and data costs. For this reason, it is recommended to do your offline signaling via APNS rather than through an OpenTok session.
I trust you may have already seen this, but just for completeness, a more in-depth writeup on the topic is available here: https://tokbox.com/developer/sdks/ios/background-state.html
Disclosure: I work for TokBox.
Being relatively new to iOS App development, I wish to develop an app which runs like a service in background (comparable with android service). The goal of my app is to use the native voice recognition, also while the app is inactive. My question is, would it principally be possible to code an app to be able to run also in background? I've read in a few pretty old threads that iOS closes any app after three minutes. However, should it be possible, I would be thankful for any coding example.
I don't think so, because if the app is on background, the local audio recogisation is for Siri.
I am playing around with a TI CC2541 chip, and was wondering if it is possible to send a "keypress" over BLE. This would be similar to the new Muku Shutter for iOS and Android, because I am trying to figure out a way to interface with a mobile device without installing a 3rd party application. Essentially, I would press the button on the CC2541 chip, and then it would emulate a keypress of volume up?
I have been researching for a while now, and all solutions to handle this have included writing a 3rd party application to map the commands in the BLE packet to a system command.
Any help would greatly be appreciated. Thank you!
On iOS the answer is no
Edit:
Exception: You might be able to set up your BT chip as a Bluetooth keyboard.
You could certainly write an app that talks with a remote BLE device and uses an agreed-upon protocol to pass key presses to your app, and then you could interpret those messages using code in your app.
However, Apple enforces a "sandbox" on its apps, and apps are not allowed to interact directly with the system except through very tightly controlled set of APIs. If there is not an official interfere to do something, it is not allowed.
If you were to run on a jailbroken device then the answer would likely be different. I can't help you there however.
Edit:
#OliverMason says in a comment that iOS shutter buttons are apparently single-key BlueTooth keyboards that emulate the volume up button, which the camera app recognizes as a way to trigger a photo. Thus my answer above isn't quite accurate.
I have an idea for an app that I'd like to develop, but before I invest a lot of time learning objective C and the iOS APIs, I'd like to make sure that what I want to do is feasible.
The app I want to make is a purely auditory (sound-only) version of Google Glass. I'm visually impaired, so spending a lot of money on something visual, even though it can read content to you, would not be worth it. But if I could use an iPhone to give many of the same options as Google Glass, that would be great.
Many times, I've wanted a piece of information while walking down the street, where I couldn't easily get to my iPhone, because I have my cane in one hand, and something else in the other. In such cases, it'd be awesome if I could say a command, and get a voice response.
I'd use the microphone built into the Apple earphones for audio input, but I'm not sure if it's possible to listen for audio input while the screen is locked. I'm certain it's not possible with a non-jailbroken iPhone.
Can anyone can tell me if this is possible?
Yes, you can do this.
In order to keep your app running all the time, even when the iPhone is locked, you could build a Launch Daemon. A launch daemon can start when the phone does, and is not subject to the restrictions that iOS puts on sandboxed apps, installed to /var/mobile/Applications/.
You do need to have a jailbroken device to take advantage of Launch Daemons. Here is a good tutorial on building one.
Launch Daemons are also a normal part of OS X, so if you need more information, you might try consulting the OS X docs online. Most aspects of Launch Daemons work the same way on a jailbroken iPhone.
You'll also want to be able to detect certain events, to activate your app. You certainly don't want to be processing an audio stream at all times (maybe you only activate the app when you start walking with your cane). To detect events, like a home button press (or however you want to activate your code), I would take a look at RPetrich's libactivator library.