gonzaloaune / GCMPushPlugin

Push notifications for Cordova (GCM & Native support)
MIT License
37 stars 20 forks source link

use boolValue to set usesGCM and gcmSandbox #5

Closed maeldur closed 9 years ago

maeldur commented 9 years ago

When testing push notifications in a production ad-hoc build on iOS, i noticed that the gcmSandbox option was being set to YES even though the javascript was passing false.

Upon debugging it looks like the return values were NSStrings @"1" or @"0" for true and false, both of which when casted directly to BOOL return YES (since they are both non-nil). Using boolValue seems to set the value correctly.

i.e.

(BOOL) @"1" = YES
(BOOL) @"0" = YES

[@"1" boolValue] = YES
[@"0" boolValue] = NO
gonzaloaune commented 9 years ago

That seems to be correct, good catch @maeldur. Thanks.