
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
cordova-plugin-huawei-push
Advanced tools
华为手机推送
安装cordova-plugin-huawei-push
cordova plugin add cordova-plugin-huawei-push
在项目根目录建个文件夹 config-push
,将 agconnect-services.json
拷贝到 config-push
目录。
agconnect-services.json
文件,请从华为开发者官网配置推送后下载到本地。 华为开发者官网
调试推送需要使用签名后的apk,因此建议在 cordova
根目录建 build.json
文件,把签名信息配置一下
{
"android": {
"debug": {
"keystore": "./keys/testpush.keystore",
"alias": "testpush.keystore",
"storePassword": "123456",
"password": "123456"
},
"release": {
"keystore": "./keys/testpush.keystore",
"alias": "testpush.keystore",
"storePassword": "123456",
"password": "123456"
}
}
}
build.json
的上述配置需要改成你自已的配置信息
如需调试,需要在真实的设备,使用以下命令调试
cordova run android --device --buildConfig
使用前需注册,以获取 token
,你可以将 token
与你的app用户信息关联后上传到服务器
// 注册推送
huaweiPush.register(function(token) {
console.log(token);
}, function(err) {
console.log(err);
}, []);
// 接收token
huaweiPush.onNewToken(function(token) {
console.log(token); // 会多次接收到token
});
注册完成后,需要监听 messageReceived
事件
document.addEventListener("messageReceived", function(result) {
console.log(result);
}, false);
FAQs
Cordova Push Plugin
We found that cordova-plugin-huawei-push 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.