TokBox iOS - App Background process singal not working - ios

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.

Related

Can I make a purely voice driven app in Expo?

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.

iOS background service using BLE after reboot

I'm new to mobile development, before eventually deciding where to develop (android/ iOS) a specific application I have a question (I'd prefer using an iPhone):
So the background is that I have a BLE device frequently sending data to the phone and let the phone app sync the data to the cloud. Now, it is really important that if for some reason the phone has to restart, it will automatically proceed receiving the BLE data.
Is it possible at all in iOS to start a background process (handling BLE packets) after reboot automatically. Thus e.g. when the respective BLE device pairs to the phone after a reboot, that the background process starts automatically, without the user having to start the app manually?
Doing some research I came up with mixed results regarding this scenario and would be grateful if someone with iOS experience could clarify.
(BTW: It does not have to be an Apple App Store Application)
A Few days ago I was working on BLE devices Beacons we supposed to make mobile application and start monitoring these beacons and send date monitoring to API.
This works fine in background, even the user was not running the application in foreground or reboot his iPhone.
All we should do is put the monitoring code at the appDelegate of the application to work in the background.

iOS: run app as a service in background

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.

iOS Core Bluetooth app used like a Central doesn't work in background

I've an app that uses Core Bluetooth in foreground, everything is working fine. Now I'm trying to enable the background usage, I checked the correct options in Capabilities like the documentation says but the sync doesn't happen, only when I call the app to foreground again. Someone had this problem also? Should I implement more things like "State Preservation and Restoration"?
Just to be more clear, I'm using a specific UUID.

iOS refresh bluetooth characteristics

I have created an iOS app that interacts with a bootloader on some custom hardware/firmware to update the application on the hardware. In order to accomplish this, the hardware/firmware has a bootloader application and a regular application. First, I connect my iOS app to the bootloader application and update the regular application. At which point the regular application starts to run and I would like to connect to it with my iOS app.
If I search for peripherals with an Android application it correctly sees my hardware broadcasting as the bootloader application and then switch to broadcasting as the regular application after the update has been completed. However, for some reason, the equivalent iOS app only sees it being broadcast as the bootloader application. I have found that if I restart the iOS device or if I turn the iOS device's bluetooth off and back on after a few seconds it will finally recognize that the regular application is broadcasting.
It seems as though the iOS device is caching the peripheral information. Does anyone know if there is a way to clear the cache or refresh to get the current/valid status of the device?
I have exactly the same issue here, unfortunately this is indeed due to iOS. There are a lot of other threads about this topic but after looking for a while I would recommend this answer :
https://stackoverflow.com/a/25930825
Best of luck, I haven't finished yet and this won't be easy...

Resources