acspushmod
acspushmod copied to clipboard
Android bug?
This module is used in our project, but I haven't been using it myself so not so familiar with it. I did just notice a dodgy line in the Android options: Line 84 CloudPush.singleCallback = androidOptions.singleCallback || true; If androidOptions.singleCallback is false, CloudPush.singleCallback will be assigned the value true which is not the intended value I believe. Have to be careful when checking for the existence of object values that are of type Boolean (same applies to the other options assignments).
Yeah you're right using Underscore.js awesomeness would be good:
CloudPush.singleCallback = _.has(androidOptions, "singleCallback") ? androidOptions.singleCallback : true;
or
_.defaults(androidOptions, { singleCallback: true });
Yes I like the _.has method because it "does what it says on the tin" :)
Have a look at 1.0.4.
Great