【问题标题】:Ionic2 sleep mode backgroundMode and background geolocationIonic2 睡眠模式 backgroundMode 和背景地理位置
【发布时间】:2017-08-25 00:20:46
【问题描述】:

我已经安装了 backgroundMode、backgroundGeolocation 和 insomnia,但我仍然在敲我的脑袋。

  1. 后台模式似乎可以正常工作
  2. 40 秒后手机进入睡眠状态,backgroundGeolocation 停止工作
  3. 其他一切似乎都可以正常工作,例如:网络连接、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


【解决方案1】:

我设法解决此问题的唯一方法是关闭手机上的省电模式:(

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-31
    相关资源
    最近更新 更多