Domanda

Is it possible to notify an app (inactive OR active but in background) when screen is locked / unlocked?

Something like: https://stackoverflow.com/a/3617552/1011125

È stato utile?

Soluzione

When the screen is locked, your app gets these delegate messages:

  • applicationWillResignActive:

  • applicationDidEnterBackground:

However, you cannot distinguish this situation from any other situation in which you might get those messages (e.g., the user clicked the Home button to suspend your app).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top