hook in background mode cordova plugin