From 05174958b220430756c48a2de785dc647fbb2c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Sun, 30 Jun 2019 21:46:15 +0200 Subject: [PATCH] Added php example --- android/.idea/assetWizardSettings.xml | 85 --------------------------- examples/scn_send.php | 35 +++++++++++ 2 files changed, 35 insertions(+), 85 deletions(-) delete mode 100644 android/.idea/assetWizardSettings.xml create mode 100644 examples/scn_send.php diff --git a/android/.idea/assetWizardSettings.xml b/android/.idea/assetWizardSettings.xml deleted file mode 100644 index 84ee715..0000000 --- a/android/.idea/assetWizardSettings.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/scn_send.php b/examples/scn_send.php new file mode 100644 index 0000000..a881a04 --- /dev/null +++ b/examples/scn_send.php @@ -0,0 +1,35 @@ + '', //TODO set your userid + 'user_key' => '', //TODO set your userkey + 'title' => $title, + 'content' => $content, + 'priority' => $priority, + ]; + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, "https://simplecloudnotifier.blackforestbytes.com/send.php"); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + $result = curl_exec($ch); + + curl_close($ch); + if ($result === false) return false; + + $json = json_decode($result, true); + return $json['success']; +} \ No newline at end of file