Skip to content

Commit

Permalink
Merge pull request #569 from sf-insuretech/bug/fix-nil-service-data
Browse files Browse the repository at this point in the history
Fixed nil service data when broadcast by device
  • Loading branch information
marcosinigaglia authored Dec 26, 2019
2 parents 1ff4e9b + d3edb15 commit 1d2546a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ios/CBPeripheral+Extensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ - (NSDictionary *) serializableAdvertisementData: (NSDictionary *) advertisement
NSLog(@"%@", serviceData);

for (CBUUID *key in [serviceData allKeys]) {
[serviceData setObject:dataToArrayBuffer([serviceData objectForKey:key]) forKey:[key UUIDString]];
[serviceData removeObjectForKey:key];
if ([serviceData objectForKey:key]) {
[serviceData setObject:dataToArrayBuffer([serviceData objectForKey:key]) forKey:[key UUIDString]];
[serviceData removeObjectForKey:key];
}
}

// replace the Service Data object
Expand Down

0 comments on commit 1d2546a

Please sign in to comment.