Hey Everyone,
Let me say first how much I appreciate everyone's response. I didn't expect to get this much feedback.
There seems to be some confusion about Silent Notifications so I've written out the work flow below with an explanation of how this could work.
Silent Notifications are the same as remote notifications, except that in the Remote Push notification payload you remove the alert. Below is an example of how to structure both a Remote Notification and a Silent Remote Notification payload.
Normal Remote Push Notification Payload { "aps": { "content-available": 1, "alert": {...} }, "serviceUUID": E621E1F8-C36C-495A-93FC-0C247A3E6E5F }
Silent Remote Push Notification Payload { "aps": { "content-available": 1, // The alert was removed. }, "serviceUUID": E621E1F8-C36C-495A-93FC-0C247A3E6E5F }
If the app is in the background when the phone receives the notification, in the AppDelegate it will call:
- application: didReceiveRemoteNotification: fetchCompletionHandler: { // convert serviceUUID into CBUUID // begin a background scan for BLE Service completionHandler(UIBackgroundFetchResultNewData); }
When the user receives a Silent Remote Push Notification, they will not be notified of the notification. The app will simply update in the background. So the user will never know that you have initiated a new scan in the background. That's where things get tricky because there could be possible privacy or user trust issues that come from this.
- Dave
On Nov 12, 2013, at 11:12 PM, Stephen Jablonski < email@hidden> wrote: “If your app uses push notifications to notify the user of the availability of new content, you can use those push notifications to trigger the download of that content in iOS 7 and later. You enable support for remote notifications from the Background modes section of the Capabilities tab in your Xcode project. (You can also enable this support by including the UIBackgroundModes key with the remote-notification value in your app’s Info.plist file.) When this value is present and a push notification arrives on a device, the system sends the notification to your app (launching it if needed) and gives it a few moments to process the notification before displaying anything to the user. You can use those few moments to download content related to the push notification and be ready to display it to the user."
|