Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
capacitor-holy-pipe
Advanced tools
Holy pipe - Provide a flexible way to send signal/call Android function from JS side. (IOS not supported yet)
npm install capacitor-holy-pipe
npx cap sync
import { HolyPipe } from 'capacitor-holy-pipe';
const login = (username, password, rememberPassword) => HolyPipe.echo({
action: 'login',
params: { username, password, rememberPassword }
}, (resp) => {
const loginResult = resp.value.loginResult
console.log('loginResult', loginResult)
});
import com.sfbl.capacitor.holypipe.HolyPipePlugin;
public class MainActivity extends BridgeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
HolyPipePlugin.actions.put("login", call -> {
JSObject params = call.getObject("params");
String username = params.getString("username");
String password = params.getString("password");
Boolean rememberPassword = params.getBool("rememberPassword");
Boolean result = this.login(username, password, rememberPassword);
JSObject resp = new JSObject();
resp.put("loginResult", result);
call.resolve(resp);
});
}
protected void login(String username, String password, Boolean rememberPassword) {
// ...
return false;
}
}
Param | Type |
---|---|
options | { action: string, params: any } |
Returns: Promise<{ value: any; }>
HolyPipe.on('android-to-js', (params, callback) => { /* do something */ })
HolyPipe.emit('js-to-android', param1, param2, param3, ..., (response) => {});
HolyPipePlugin.emit('android-to-js', param1, param2, ..., (response) -> {});
HolyPipePlugin.on('js-to-android', (param1, param2, ..., callback) -> { /* ... do something */ });
FAQs
Define android handler for specified JS function call
We found that capacitor-holy-pipe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.