changed return types (1 or 0) to be consistent with iOS version of plugin