Question

I am a beginning programmer but I was wondering how I could keep track of a user's actions. For example, hypothetically, the goal of my application is to keep track of how many times the user presses the home button (or opens the internet, etc). Would it be possible to increment a counter each time the user pressed the home button (even though that would exit my app, and other apps)?

Was it helpful?

Solution

iOS is sandboxed, meaning that you can only keep tack of user actions that are targeted to your running app. Your app can not monitor the home button or the running of other apps such as Safari.

OTHER TIPS

I can't tell for sure but maybe what your looking for is for your application to run in background which would prevent the home button for closing it. Then i guess the counter logic would be your best shot. You can find here if this idea suites your need.

Hope it helps and good luck for your app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top