Process a pushed timer

Unlock premium in the appstore, and be able to connect the Timer app to a webserver.

When a timer is paused, and a client is selected, a "push" button will appear. When clicked, the information of the timer will be POSTed to your webserver.

After checking the username and password (supplied depening on the method chosen), you should process the POST parameter action. For processing a timer that is pushed from the app, the action is called push_timer.

The complete POST variables will be:

    action=push_timer
    seconds=1550
    client_id=17
    description=22-01 Worked hours
    price=85

This will be for a timer that has ran for 25 minutes and 50 seconds (00:25:50), for client 17 with a price of 85 per hour. You can further process all the data on your server as you like; for example round the 1550 seconds to quarters or minutes however you like.

The app expects to receive a JSON encoded result. For example:

{"success":"Define a custom message here"}

The text "Define a custom message here" can be supplied to display a 'success' notification in the app. We recommend to use a short message, for example "Saved successfully":

{"success":"Saved successfully"}

If something went wrong, you can supply an error result with a short message:

{"error":"Invalid client selected"}

This will be shown in app. Until a success parameter is returned, the timer will remain 'unpushed' meaning it can be started again. When a success parameter is returned, the timer can only be deleted or archived (meaning the data can be displayed in the charts section).

All your client information will be stored in iCloud, so the privacy of you and your clients is safe. No data is sent to our webservers, the only communication is between the app and your server, or between the app and your private iCloud.

Other instructions:
Step 1: Login methods explanation
Step 2: Load a list of clients
Step 3: Process a pushed timer