Skip to content

Commit

Permalink
ranging event reports array of beacons with proximities
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeuckm committed Oct 26, 2013
1 parent 2c7abd9 commit a94982e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tmp
bin
build
*.zip

4 changes: 4 additions & 0 deletions .gitignore~
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tmp
bin
build
*.zip
19 changes: 14 additions & 5 deletions Classes/OrgBeuckmanTibeaconsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,17 @@ - (void)locationManager:(CLLocationManager *)manager
}

NSString *count = [NSString stringWithFormat:@"%lu", (unsigned long)[filteredBeacons count]];

NSMutableArray *eventBeacons = [[NSMutableArray alloc] init];
for (id beacon in filteredBeacons) {
// do something with object
[eventBeacons addObject:[self detailsForBeacon:beacon]];
}

NSDictionary *event = [[NSDictionary alloc] initWithObjectsAndKeys:count, @"count", nil];
NSDictionary *event = [[NSDictionary alloc] initWithObjectsAndKeys:
count, @"count",
eventBeacons, @"beacons",
nil];

[self fireEvent:@"beaconRanges" withObject:event];

Expand Down Expand Up @@ -337,11 +346,11 @@ - (NSDictionary *)detailsForBeacon:(CLBeacon *)beacon
}

return [[NSDictionary alloc] initWithObjectsAndKeys:
beacon.major, @"major",
beacon.minor, @"minor",
// beacon.major, @"major",
// beacon.minor, @"minor",
proximity, @"proximity",
beacon.accuracy, @"accuracy",
beacon.rssi, @"rssi",
// beacon.accuracy, @"accuracy",
// beacon.rssi, @"rssi",
nil
];
}
Expand Down
Binary file not shown.
Binary file added org.beuckman.tibeacons-iphone-0.1.zip
Binary file not shown.

0 comments on commit a94982e

Please sign in to comment.