add method 'sendToJavaWithPromise'