Search code examples
restlyncucwaskype-for-business

Correct workflow for presence subcription for day/night


In my app, I get Lync Presence of our employees through UCWA. It works fine, but I need to knock to Lync with reportMyActivity every 3-4 minute. I don't need to get presence info at night when employees are not at work, so I stop reportingMyActivity at the end of the working day and resume at it's beginning. Then trying to extend presence subscription, and if I get 404, I create new presence subscription. But no presence updates after those manipulations.

Is it designed to work this way? How could I avoid reportingMyActivity at night?


Solution

  • If you don't do reportMyActivity your Application will be drained, because assumed inactive. I think you only have two options then:

    1. Keep doing reportMyActivity regurarly also at night, you'll just stop extending presence subscription. Very likely you'll have to manage access token expiration too, which is normally 8 hours valid
    2. You let the App shut down, and a complete new token acquisition, Application creation, presence subscription flow will start next morning