Skip to content

Commit

Permalink
Merge pull request #114 from Microsoft/fix/setCustomProperties-bug
Browse files Browse the repository at this point in the history
Fix a bug in setCustomProperties where boolean property is always set to true
  • Loading branch information
guperrot authored Sep 13, 2017
2 parents 9906d92 + b807db7 commit 455a4e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions TestApp/MobileCenterScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default class MobileCenterScreen extends React.Component {
.clear('old')
.set('color', 'blue')
.set('optin', true)
.set('optout', false)
.set('score', 7)
.set('now', new Date());
await MobileCenter.setCustomProperties(properties);
Expand Down
3 changes: 2 additions & 1 deletion mobile-center/ios/RNMobileCenter/RNMobileCenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ + (void)register
[customProperties setNumber:value forKey:key];
}
else if ([typeString isEqualToString:@"boolean"]) {
[customProperties setBool:value forKey:key];
NSNumber *num = value;
[customProperties setBool:[num boolValue] forKey:key];
}
else if ([typeString isEqualToString:@"date-time"]) {
NSDate *date = [RCTConvert NSDate:value];
Expand Down

0 comments on commit 455a4e3

Please sign in to comment.