Custom status bar when application is in background - ios

In iOS 7, is it possible to modify the status bar when the application enters background? I want to achieve something similar to the "in-call" phone application background mode.

I believe this is impossible. When the app is in background you can only use the BACKGROUND MODE: Audio and AirPlay, Location uodates, Voice over IP, Newstand downloads, External acessory communication, Uses Bluetooth, Acts as Bluetooth, Background fetch and Remote notifications.

Related

iOS - What does External accessory communication of Background Modes do?

I guess it is a background mode related to ExternalAccessory.framework.
But the document about External Accessory says, "If your app is suspended in the background when an accessory notification arrives, that notification is put in a queue. When your app begins running again (either in the foreground or background), notifications in the queue are delivered to your app. Notifications are also coalesced and filtered wherever possible to eliminate any irrelevant events. For example, if an accessory was connected and subsequently disconnected while your app was suspended, your app would ultimately not receive any indication that such events took place.".
This means that the external accessory communication will be just queued until the app enters foreground mode, But the other background modes like Location, Bluetooth LE are working as real-time in background mode. So I doubt that just queued is the only thing that can do. Is it really?
If your external device is "Made for iPhone/iPod/iPad" - MFi you can use this option. It's not for BLE communication.

How to come Ios App to foreground from background

I working on swift for Ios App. I want to phone user connect specific wifi. So i open iphone wifi settings by NSURL like this. After then my app go to background and i control ssid every 500ms in background by background task like this. When phone connect the specific wifi i can see this status and i stop background task. But i cant comes my app to foreground. I tried open my app use NSURL metod like this video (i add custom url my info.plist and add application function in my appdelagate) but my app has no return use this metod.
unfortunately bringing an app from background to foreground is not possible. You can however send a notification or a badge for the user to click and open the app. The user should have notifications enabled for this to work.
Happy Coding!

How to send battery updates to LE accessory from app in background when iPhone operate in peripheral mode?

I'm developing a BLE enabled App. In my App iPhone operate in peripheral mode with Bluetooth accessories. Everything works fine until I go to background Mode Because my Phone is working as peripheral so It also update accessory with battery level it doesn't work in background because app will only wakeup once accessory will send request because its already subscribe for the update I somehow have to wakeup my app in background mode and send update let's say every x minutes .
I have already enable Bluetooth LE accessory background mode.
Apparently enabling background mode only gives the 'right' to run in the background whenever there is an event triggered.
One of the method is what you already did by 'polling' from the accessories periodically by sending request to wake up the app and execute the task.
Another way is to use background refresh. The only downside of background refresh is the event will not occur at specific period. It was mentioned at about 10-15mins typically or it might tag along with other app background wake up. If the update is not very frequent or crucial, this method would probably better for your case.
You can keep your app running in background by setting the "required background modes" option in your plist. Select "App communicate with accessory".
Please see the attached image for reference

iOS background service vibrate phone

I have an app that runs in the background (location services). When the app is in the foreground it vibrates fine when I want it to, however, if its not in the foreground (in the multitasking view), the vibrate does not work anymore. Is this not allowed? Is there some way for my background app to give a vibrate alert? If not that what about a beeping sound?
Right now I am just doing something like this:
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
While importing:
#import <AudioToolbox/AudioServices.h>
If you enable background audio modes (as documented by Apple at https://developer.apple.com/library/prerelease/ios//qa/qa1668/_index.html) then vibration will happen when the app is in the background state. I just verified that adding the "App plays audio or streams audio/video using AirPlay" entry under the "Required background modes" property in the target's properties allows the vibration to work when the app is not in the foreground.
I found that checking 'Audio,AirPlay and Picture in Picture' within the 'Background Modes' of your apps Capabilities worked:
If you're trying to provide the user with a notification of something while your app is running in the background, consider delivering that information using a Local Notification (see UILocalNotification.)
Forcing the phone to vibrate is not a great user experience for a few reasons:
Some users (including myself) disable vibrate while in silent mode
iPads and iPod Touches do not vibrate
Users may not know what caused the vibration or sound and may not realize to open your app
Local notifications appear to the user in a manner that they can control and will recognize.
If your intention is something besides notifying the user, add that to your question & I'll try to help.
I'm pretty sure that you aren't able to vibrate the phone while it is in the background state. I've actually never seen an app do this.

IOS corebluetooth Background mode notification

Currently am working with the project using core bluetooth. In which am using background mode communication, am able to receive the notification when ever app running in background but we have only one service and one characteristics for data communication based on frame type we are able to identify the frames which is received.
For background mode i used this code
[centralManager connectPeripheral:activePeripheral options:#{CBConnectPeripheralOptionNotifyOnConnectionKey: #YES,
CBConnectPeripheralOptionNotifyOnDisconnectionKey: #YES,
CBConnectPeripheralOptionNotifyOnNotificationKey: #YES}];
its working fine for both event and session background.
Event background alert shows for every notification is there any way to hide the alert for every notification show only needed.
Thanks
In event mode the alerts are generated by the system and as long as your app is not activated, it can't do anything about them.
In session mode the app stays responsible for handling all these events. It receives all the callbacks just as in the foreground. If you want to minimize the disturbance of the user, you should take over the alert generation with this mode.

Resources