Skip to content
This repository has been archived by the owner on Mar 2, 2019. It is now read-only.

Broadcasting in background does not work (iOS 7.1) #5

Closed
objectiveSee opened this issue Apr 1, 2014 · 4 comments
Closed

Broadcasting in background does not work (iOS 7.1) #5

objectiveSee opened this issue Apr 1, 2014 · 4 comments

Comments

@objectiveSee
Copy link

I am not able to broadcast in the background using this project. Once I minimize the App, the broadcast stops. Has anyone else had the background broadcast work?

@objectiveSee objectiveSee changed the title Broadcasting in Background Broadcasting in background does not work (iOS 7.1) Apr 1, 2014
@objectiveSee
Copy link
Author

- (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral error:(NSError *)error

is getting called, and peripheral.isAdvertising is YES, and error is nil, but my Mac scanner (ScanBeacon) does not detect this beacon. I don't have another device to test with. Can anyone confirm what they are seeing on iOS7.1?

@bentford
Copy link
Contributor

bentford commented Apr 1, 2014

I just tested the Vicinity app on iOS7.1 and it's still working.

It's strange that ScanBeacon is not picking it up.

It's worth mentioning that Vicinity isn't broadcasting an iBeacon signal, but rather broadcasting a low-energy bluetooth signal.

Essentially it's not broadcasting the kCBAdvDataAppleBeaconKey key. See this post for some insight into how you can broadcast a iBeacon signal: http://www.blendedcocoa.com/blog/2013/11/02/mavericks-as-an-ibeacon/

@bentford bentford closed this as completed Apr 1, 2014
@objectiveSee
Copy link
Author

Thanks ben, so....that actually clears things up for me. ScanBeacon must only be looking for the iBeacon identifier (as it's an App made by an iBeacon manufacturer that all makes sense now).

Using the Vicinity app on two phones, I can now background one app and the other will recognize it. My Application only needs to be able to range between the two phones so I don't think I need kCBAdvDataAppleBeaconKey.

Side note: I just tried extending your code to also send kCBAdvDataAppleBeaconKey. ScanBeacon will detect the broadcast, but not Vicinity.

    id value = [[self beaconAdvertisement] objectForKey:@"kCBAdvDataAppleBeaconKey"];
    NSDictionary *advertisingData = @{CBAdvertisementDataLocalNameKey:@"vicinity-peripheral",
                                      CBAdvertisementDataServiceUUIDsKey:@[identifier],
                                      @"kCBAdvDataAppleBeaconKey":value};

@bentford
Copy link
Contributor

bentford commented Apr 1, 2014

Good to know. It's been a few months since I poked around with Bluetooth stuff. Not sure why Vicinity wouldn't pick it up.

We were in the same boat and only needed to detect proximity, not necessarily use iBeacon. And I've even heard that iOS7.1 greatly improved background detection. (iOS7.0 supported background broadcasting really well).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants