npm i --save @manojdcoder/nativescript-pedometer
- 版本:2.5.1
- GitHub: https://github.com/manojdcoder/nativescript-plugins
- NPM: https://npmjs.net.cn/package/%40manojdcoder%2Fnativescript-pedometer
- 下载量
- 昨天: 83
- 上周: 526
- 上个月: 1497
@manojdcoder/nativescript-pedometer
ns plugin add @manojdcoder/nativescript-pedometer
用法
示例
参考示例应用
Android 设置
使用前台服务以在应用处于后台或未运行或被终止时持续监控步数。webpack 配置必须调整以包含前台服务,
const webpack = require('@nativescript/webpack');
const { resolve } = require('path');
module.exports = (env) => {
// Copy the line below to your webpack.config.js
env.appComponents = (env.appComponents || []).concat([resolve(__dirname, 'node_modules/@manojdcoder/nativescript-pedometer/step-counter-broadcast-receiver.android')]);
webpack.init(env);
webpack.useConfig('typescript');
webpack.chainWebpack((config) => {
// shared demo code
config.resolve.alias.set('@demo/shared', resolve(__dirname, '..', '..', 'tools', 'demo'));
});
// Example if you need to share images across demo apps:
// webpack.Utils.addCopyRule({
// from: '../../../tools/images',
// to: 'images',
// context: webpack.Utils.project.getProjectFilePath('node_modules')
// });
return webpack.resolveConfig();
};
许可证
Apache 许可协议版本 2.0