Porting to latest Cordova API