requestApplicationWake closes after 2 minutes of inactivity

Hi everyone,
I'm currently developing a companion app with ios and android, and i want to send a message from the phone app, then it should open a pop up on the watch to start a timer for max 22 minutes. i'm currently using Background.requestApplicationWake(), it works but somehow the watch app closes after 2 minutes due to inactivity i suppose. I want to know there is any tips to persist this ? Thank you guys :) (Actually i tested on Forerunner 255s , it closes after 2 minutes of inactivity and on Fenix 6, it doesn't close at all)

  • if you have it, try commenting out the getGlanceView function in your AppBase, so it's just a normal device app.

  • Thanks for the reply :)

    The App.mc code looks like this, i don't actually use the getGlanceView but getInitialView, i don't know how to bypass this inactivity timeout ..

    import Toybox.Application;
    using Toybox.System;
    using Toybox.Background;
    using Toybox.WatchUi as Ui;
    using Toybox.Application.Storage;
    
    (:background)
    class App extends Application.AppBase {
      function initialize() {
        AppBase.initialize();
      }
    
      // onStart() is called on application start up
      function onStart(state) {
        if (Background has :registerForPhoneAppMessageEvent) {
          Background.registerForPhoneAppMessageEvent();
        }
      }
    
      // onStop() is called when your application is exiting
      // send on close message to app
      function onStop(state) {
        var isPhoneConnected = Storage.getValue("phoneConnected");
        if (isPhoneConnected && BackgroundServiceDelegate.getCanSendMessage()) {
          TimerDelegate.sendCloseMessage();
        }
      }
    
      // Return the initial view of your application here
      function getInitialView() {
        return [new TimerView(), new TimerDelegate()];
      }
    
      function getServiceDelegate() {
        return [new BackgroundServiceDelegate()];
      }
    
      function onBackgroundData(data) {
        BackgroundServiceDelegate.setCanSendMessage(true);
        TimerDelegate.populateProtoData(data);
        Ui.requestUpdate();
      }
    }
    
    function getApp() {
      return Application.getApp();
    }
    

  • In the manifest, do you have widget or watch-app as the app type?  Try watch-app if that's not the case..

  • Yes, I do have the watch-app type..