【发布时间】:2017-08-25 00:20:46
【问题描述】:
我已经安装了 backgroundMode、backgroundGeolocation 和 insomnia,但我仍然在敲我的脑袋。
- 后台模式似乎可以正常工作
- 40 秒后手机进入睡眠状态,backgroundGeolocation 停止工作
- 其他一切似乎都可以正常工作,例如:网络连接、BLE 按钮点击,只是背景地理定位不行。
我越来越绝望,也很乐意花钱请人帮忙。
请各位高手帮帮我,哈哈
home.ts
constructor(public navCtrl: NavController,
public navParams: NavParams,
public member:Member,
public journey: Journey,
public backgroundMode: BackgroundMode,
public insomnia: Insomnia,
platform: Platform) {
platform.ready().then(() => {
this.backgroundMode.enable();
this.insomnia.keepAwake()
.then(
() => console.log('success'),
() => console.log('error')
);
});
this.member.onLoggedIn.subscribe(
(data) => {
this.memberLoggedIn();
}
);
this.member.onLoggedOut.subscribe(
(data) => {
this.memberLoggedOut();
}
);
}
【问题讨论】:
-
它不是一直保持清醒吗?
标签: background ionic2 gps sleep