Skip to content

Instantly share code, notes, and snippets.

@brisbanewebdeveloper
Last active September 18, 2015 08:34
Show Gist options
  • Save brisbanewebdeveloper/2b6d1d174dbb13f9ea3d to your computer and use it in GitHub Desktop.
Save brisbanewebdeveloper/2b6d1d174dbb13f9ea3d to your computer and use it in GitHub Desktop.
How to send a notification to Mac OSX computer from iOS device via Workflow and Pushover

Requirements

Steps

  1. Create Pushover Account at the website.

  2. Install Pullover from "Installation / Download" Section at GitHub Page.

  3. Create a new folder with random charactors like "push-fYwodM7Ro193j2" at your web server (You do not just use that example). The folder must be able to access from the browser on your iOS device.

  4. Put the PHP file "index.php" in the folder.

  5. Login at Pushover Site.

  6. Copy your user key and replace the text "YOUR_PUSHOVER_USER_KEY" in the PHP file.

  7. Register a new Pushover Application at Pushover Site.

  8. Copy "API Token/Key" for the above Application and replace the text "YOUR_PUSHOVER_APP_TOKEN" in the PHP file.

  9. Copy the device name your want to send the notification and replace the text "YOUR_DEFAULT_PUSHOVER_DEVICE" in the PHP file.

  10. Save the PHP file.

  11. Open this linke on your iOS device.

  12. Click "GET WORKFLOW". Workflow App should be opened and create a new workflow.

  13. Scroll down in the new workflow untill you see the action "Text".

  14. Replace the text "my.website.com" to your website in the action.

  15. Replace the text "my-secret-folder" to the folder name you created at Step 2.

  16. Click "Done" at upper right.

How to push a notification to your Mac

  1. Open a website on a browser with your iOS Device.

  2. Tap the activity "Run Workflow" (If you don't see it, click "More", enable "Run Workflow" and tap "Done").

  3. Tap "Push to my Mac".

  4. If Pushover received the data, you should see the result in JSON saying like '{"status":1,"request"...'.

Wait, that does not let my Mac read the message!

You have a keen observation.

There are Pushover Client Programs.

You can use one of them.

If you did not like any of them and fine to use Command Line, you can try readmypo.

Reference

<?php
$fields = array(
'token' => 'YOUR_PUSHOVER_APP_TOKEN',
'user' => 'YOUR_PUSHOVER_USER_KEY',
);
$fields['device'] = empty($_GET['dev']) ? 'YOUR_DEFAULT_PUSHOVER_DEVICE' : $_GET['dev'];
$fields['url'] = empty($_GET['url']) ? '' : $_GET['url'];
$fields['message'] = empty($_GET['msg']) ? '' : $_GET['msg'];
curl_setopt_array($ch = curl_init(), array(
CURLOPT_URL => 'https://api.pushover.net/1/messages.json',
CURLOPT_POSTFIELDS => $fields,
CURLOPT_SAFE_UPLOAD => true,
CURLOPT_RETURNTRANSFER => true,
));
$result = curl_exec($ch);
curl_close($ch);
echo $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment