<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Background ble operations with ios</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22138/background-ble-operations-with-ios</link><description>HI, i&amp;#39;m trying to perform the following operations with the Core Bluetooth Framework of iOS: 
 
 
 Connection to peripheral 
 
 
 Services Discovery 
 
 
 Characteristics Discovery 
 
 
 Start Notify on a particular characteristic 
 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 May 2017 07:09:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22138/background-ble-operations-with-ios" /><item><title>RE: Background ble operations with ios</title><link>https://devzone.nordicsemi.com/thread/86998?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 07:09:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a751e7f1-8521-4eb3-bc6d-d9a0c1e88aaa</guid><dc:creator>Mostafa Berg</dc:creator><description>&lt;p&gt;Hi @Johnny_h, no worries :), ok it&amp;#39;s good that you know that there is minor risks involved in using this trick, i had to note it out in case you didn&amp;#39;t know, to answer your other question, unfortunately no, the app is not awaked if killed by the user in this case,it will only be awakened if iOS kills the app while in background mode due to memory warnings, to save resources etc ...&lt;/p&gt;
&lt;p&gt;It&amp;#39;s almost like the music app on iOS, once you quit the app the music stops immediately, but if you put it in the background it resumes working as intended, if iOS has to kill it, it&amp;#39;ll automatically restart and resume playing music so it&amp;#39;s almost like you can put 100% faith that your app will continue to work seamlessly if the user doesn&amp;#39;t force close it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Background ble operations with ios</title><link>https://devzone.nordicsemi.com/thread/86997?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 15:43:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:320ab1e8-43ba-4bf1-bca4-893abc1abd0e</guid><dc:creator>Johnny_8</dc:creator><description>&lt;p&gt;Thank you for your clear response. I&amp;#39;m actually trying to do what you have guessed: awake the app with the core location framework (which seems not limited by force quit by the user) and then use core bluetooth in order to reconnect peripheral. I&amp;#39;m aware that Apple approval process can not be passed by using this method but, at the moment, I&amp;#39;m just trying to understand if it&amp;#39;s faisable. Just another question: is an app (which acts as a BLE peripheral) awaked from killed state (with force quit of the user) if it receives command from a connected central?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Background ble operations with ios</title><link>https://devzone.nordicsemi.com/thread/86996?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 12:56:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddb43ac6-e4d6-497b-9975-cba8f39f9d0a</guid><dc:creator>Mostafa Berg</dc:creator><description>&lt;p&gt;This is the correct behaviour, if the user kills the app then it will never be woken up automatically again.&lt;/p&gt;
&lt;p&gt;However, if the app is killed by iOS due to memory warnings, etc.. it will be restored and you can resume your background operations.&lt;/p&gt;
&lt;p&gt;The only thing you can do is let the users know that they shouldn&amp;#39;t kill the app.&lt;/p&gt;
&lt;p&gt;You may see the reference &lt;a href="https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Specifically this line:&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In most cases, the system does not relaunch apps after they are force quit by the user. One exception is location apps, which in iOS 8 and later are relaunched after being force quit by the user. In other cases, though, the user must launch the app explicitly or reboot the device before the app can be launched automatically into the background by the system. When password protection is enabled on the device, the system does not launch an app in the background before the user first unlocks the device.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;
To be more specific, what you are doing (ONLY if you are only using location to wake up the phone) is wrong, and probably your app will not make it through the approval process even if it eventually worked.&lt;/p&gt;
&lt;p&gt;When CoreLocation wakes up the phone, it&amp;#39;s limited to CoreLocation functionality, not all BLE features will properly work, the only reason you are getting ability to connect to a peripheral is because it&amp;#39;s probably has already been connected before and is cached. but you will not be able to start scanning and discovering services, etc... as expected.&lt;/p&gt;
&lt;p&gt;The only reason iOS will wake your phone up when it comes to a BLE context is the following events only:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An app acting in the central role receives data from a connected peripheral.&lt;/li&gt;
&lt;li&gt;An app acting in the peripheral role receives commands from a connected central.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hope this answers your question?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>