Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
741c09b1e4
|
|||
0c0d7d181f
|
|||
9304da9422
|
|||
![]() |
d7afdd00f2 | ||
b780ccea1c
|
|||
![]() |
5d8e871871 | ||
4655d688c9
|
|||
8263c0ad95
|
|||
a701afd09b
|
|||
![]() |
1e02d8c01f | ||
e4651375aa
|
|||
![]() |
afce4c6391 |
22
README.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
SimpleCloudNotifier [](https://play.google.com/store/apps/details?id=com.blackforestbytes.simplecloudnotifier)
|
||||||
|
===================
|
||||||
|
|
||||||
|
> SimpleCloudNotifier is an app to display messages that you can send to your phone with simple POST requests.
|
||||||
|
>
|
||||||
|
> After you start the app it generates a UserID and a UserSecret.
|
||||||
|
> Now you can send your message to https://simplecloudnotifier.blackforestbytes.com/send.php and a notification will be pushed to your phone.
|
||||||
|
> (see https://simplecloudnotifier.blackforestbytes.com/ for an example with curl)
|
||||||
|
>
|
||||||
|
>
|
||||||
|
> Use it to
|
||||||
|
> - send yourself automated messages from cron jobs
|
||||||
|
> - notify yourself when long-running scripts finish
|
||||||
|
> - send server error messages directly to your phone
|
||||||
|
> - integrate with other online services
|
||||||
|
>
|
||||||
|
> The possibilities are endless*
|
||||||
|
>
|
||||||
|
> \* Disclaimer: Developer does not actually guarantee endless possibilities
|
||||||
|
|
||||||
|
|
||||||
|
  
|
@@ -98,5 +98,3 @@ public class SCNApp extends Application implements LifecycleObserver
|
|||||||
isBackground = false;
|
isBackground = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO TabLayout indicator does not corretly animate when directly clicking on tabs
|
|
@@ -163,10 +163,12 @@ public class SCNSettings
|
|||||||
return user_id>=0 && user_key != null && !user_key.isEmpty();
|
return user_id>=0 && user_key != null && !user_key.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String createOnlineURL()
|
public String createOnlineURL(boolean longurl)
|
||||||
{
|
{
|
||||||
if (!isConnected()) return ServerCommunication.BASE_URL + "index.php";
|
String base = longurl ? ServerCommunication.PAGE_URL_LONG : ServerCommunication.PAGE_URL_SHORT;
|
||||||
return ServerCommunication.BASE_URL + "index.php?preset_user_id="+user_id+"&preset_user_key="+user_key;
|
|
||||||
|
if (!isConnected()) return base;
|
||||||
|
return base + "index.php?preset_user_id="+user_id+"&preset_user_key="+user_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setServerToken(String token, View loader)
|
public void setServerToken(String token, View loader)
|
||||||
|
@@ -27,7 +27,9 @@ import okhttp3.ResponseBody;
|
|||||||
|
|
||||||
public class ServerCommunication
|
public class ServerCommunication
|
||||||
{
|
{
|
||||||
public static final String BASE_URL = /*SCNApp.LOCAL_DEBUG ? "http://localhost:1010/" : */"https://scn.blackforestbytes.com/api/";
|
public static final String PAGE_URL_LONG = "https://simplecloudnotifier.blackforestbytes.com/";
|
||||||
|
public static final String PAGE_URL_SHORT = "https://scn.blackforestbytes.com/";
|
||||||
|
public static final String BASE_URL = "https://scn.blackforestbytes.com/api/";
|
||||||
|
|
||||||
private static final OkHttpClient client = new OkHttpClient();
|
private static final OkHttpClient client = new OkHttpClient();
|
||||||
|
|
||||||
|
@@ -65,7 +65,8 @@ public class NotificationService
|
|||||||
channel0.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
|
channel0.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
|
||||||
channel0.setSound(null, null);
|
channel0.setSound(null, null);
|
||||||
channel0.setVibrationPattern(null);
|
channel0.setVibrationPattern(null);
|
||||||
channel0.setLightColor(Color.BLUE);
|
channel0.setLightColor(Color.CYAN);
|
||||||
|
channel0.enableLights(true);
|
||||||
notifman.createNotificationChannel(channel0);
|
notifman.createNotificationChannel(channel0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,7 +78,8 @@ public class NotificationService
|
|||||||
channel1.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
|
channel1.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
|
||||||
channel1.setSound(null, null);
|
channel1.setSound(null, null);
|
||||||
channel1.setVibrationPattern(null);
|
channel1.setVibrationPattern(null);
|
||||||
channel1.setLightColor(Color.BLUE);
|
channel1.setLightColor(Color.CYAN);
|
||||||
|
channel1.enableLights(true);
|
||||||
notifman.createNotificationChannel(channel1);
|
notifman.createNotificationChannel(channel1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,11 +87,13 @@ public class NotificationService
|
|||||||
NotificationChannel channel2 = notifman.getNotificationChannel(CHANNEL_P2_ID);
|
NotificationChannel channel2 = notifman.getNotificationChannel(CHANNEL_P2_ID);
|
||||||
if (channel2 == null)
|
if (channel2 == null)
|
||||||
{
|
{
|
||||||
channel2 = new NotificationChannel(CHANNEL_P1_ID, "Push notifications (high priority)", NotificationManager.IMPORTANCE_DEFAULT);
|
channel2 = new NotificationChannel(CHANNEL_P2_ID, "Push notifications (high priority)", NotificationManager.IMPORTANCE_DEFAULT);
|
||||||
channel2.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
|
channel2.setDescription("Push notifications from the server with low priority.\nGo to the in-app settings to configure ringtone, volume and vibrations");
|
||||||
channel2.setSound(null, null);
|
channel2.setSound(null, null);
|
||||||
channel2.setVibrationPattern(null);
|
channel2.setVibrationPattern(null);
|
||||||
channel2.setLightColor(Color.BLUE);
|
channel2.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||||
|
channel2.setLightColor(Color.CYAN);
|
||||||
|
channel2.enableLights(true);
|
||||||
notifman.createNotificationChannel(channel2);
|
notifman.createNotificationChannel(channel2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,9 +119,9 @@ public class NotificationService
|
|||||||
{
|
{
|
||||||
Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
v.vibrate(VibrationEffect.createOneShot(1500, VibrationEffect.DEFAULT_AMPLITUDE));
|
v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));
|
||||||
} else {
|
} else {
|
||||||
v.vibrate(1500);
|
v.vibrate(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,7 +258,7 @@ public class NotificationService
|
|||||||
if (ns.EnableVibration)
|
if (ns.EnableVibration)
|
||||||
{
|
{
|
||||||
Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
v.vibrate(VibrationEffect.createOneShot(1500, VibrationEffect.DEFAULT_AMPLITUDE));
|
v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (ns.EnableLED) { } // no LED in Android-O -- configure via Channel
|
//if (ns.EnableLED) { } // no LED in Android-O -- configure via Channel
|
||||||
|
@@ -105,7 +105,7 @@ public class AccountFragment extends Fragment
|
|||||||
|
|
||||||
v.findViewById(R.id.btnQR).setOnClickListener(cv ->
|
v.findViewById(R.id.btnQR).setOnClickListener(cv ->
|
||||||
{
|
{
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(SCNSettings.inst().createOnlineURL()));
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(SCNSettings.inst().createOnlineURL(true)));
|
||||||
startActivity(browserIntent);
|
startActivity(browserIntent);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ public class AccountFragment extends Fragment
|
|||||||
tvUserID.setText(String.valueOf(s.user_id));
|
tvUserID.setText(String.valueOf(s.user_id));
|
||||||
tvUserKey.setText(s.user_key);
|
tvUserKey.setText(s.user_key);
|
||||||
tvQuota.setText(String.format("%d / %d", s.quota_curr, s.quota_max));
|
tvQuota.setText(String.format("%d / %d", s.quota_curr, s.quota_max));
|
||||||
btnQR.setImageBitmap(QRCode.from(s.createOnlineURL()).to(ImageType.PNG).withSize(512, 512).bitmap());
|
btnQR.setImageBitmap(QRCode.from(s.createOnlineURL(false)).to(ImageType.PNG).withSize(512, 512).bitmap());
|
||||||
ivQuota.setColorFilter(s.quota_curr>=s.quota_max ? Color.rgb(200, 0, 0) : Color.rgb(128, 128, 128));
|
ivQuota.setColorFilter(s.quota_curr>=s.quota_max ? Color.rgb(200, 0, 0) : Color.rgb(128, 128, 128));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -77,4 +77,9 @@ public class NotificationsFragment extends Fragment implements MessageAdapterTou
|
|||||||
snackbar.show();
|
snackbar.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateDeleteSwipeEnabled()
|
||||||
|
{
|
||||||
|
if (touchHelper != null) touchHelper.updateEnabled();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -150,9 +150,13 @@ public class SettingsFragment extends Fragment implements MusicPickerListener
|
|||||||
prefMsgHighLedColor_value = v.findViewById(R.id.prefMsgHighLedColor_value);
|
prefMsgHighLedColor_value = v.findViewById(R.id.prefMsgHighLedColor_value);
|
||||||
prefMsgHighLedColor_container = v.findViewById(R.id.prefMsgHighLedColor_container);
|
prefMsgHighLedColor_container = v.findViewById(R.id.prefMsgHighLedColor_container);
|
||||||
prefMsgHighEnableVibrations = v.findViewById(R.id.prefMsgHighEnableVibrations);
|
prefMsgHighEnableVibrations = v.findViewById(R.id.prefMsgHighEnableVibrations);
|
||||||
prefMsgHighForceVolume = v.findViewById(R.id.prefMsgHighForceVolume);
|
prefMsgHighForceVolume = v.findViewById(R.id.prefMsgHighForceVolume);
|
||||||
prefMsgHighVolume = v.findViewById(R.id.prefMsgHighVolume);
|
prefMsgHighVolume = v.findViewById(R.id.prefMsgHighVolume);
|
||||||
prefMsgHighVolumeTest = v.findViewById(R.id.btnHighVolumeTest);
|
prefMsgHighVolumeTest = v.findViewById(R.id.btnHighVolumeTest);
|
||||||
|
|
||||||
|
ArrayAdapter<Integer> plcsa = new ArrayAdapter<>(v.getContext(), android.R.layout.simple_spinner_item, SCNSettings.CHOOSABLE_CACHE_SIZES);
|
||||||
|
plcsa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
prefLocalCacheSize.setAdapter(plcsa);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateUI()
|
private void updateUI()
|
||||||
@@ -168,10 +172,7 @@ public class SettingsFragment extends Fragment implements MusicPickerListener
|
|||||||
prefUpgradeAccount_info.setVisibility(SCNSettings.inst().promode_local ? View.GONE : View.VISIBLE);
|
prefUpgradeAccount_info.setVisibility(SCNSettings.inst().promode_local ? View.GONE : View.VISIBLE);
|
||||||
prefUpgradeAccount_msg.setVisibility( SCNSettings.inst().promode_local ? View.VISIBLE : View.GONE );
|
prefUpgradeAccount_msg.setVisibility( SCNSettings.inst().promode_local ? View.VISIBLE : View.GONE );
|
||||||
|
|
||||||
ArrayAdapter<Integer> plcsa = new ArrayAdapter<>(c, android.R.layout.simple_spinner_item, SCNSettings.CHOOSABLE_CACHE_SIZES);
|
if (prefLocalCacheSize.getSelectedItemPosition() != getCacheSizeIndex(s.LocalCacheSize)) prefLocalCacheSize.setSelection(getCacheSizeIndex(s.LocalCacheSize));
|
||||||
plcsa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
prefLocalCacheSize.setAdapter(plcsa);
|
|
||||||
prefLocalCacheSize.setSelection(getCacheSizeIndex(s.LocalCacheSize));
|
|
||||||
|
|
||||||
if (prefMsgLowEnableSound.isChecked() != s.PriorityLow.EnableSound) prefMsgLowEnableSound.setChecked(s.PriorityLow.EnableSound);
|
if (prefMsgLowEnableSound.isChecked() != s.PriorityLow.EnableSound) prefMsgLowEnableSound.setChecked(s.PriorityLow.EnableSound);
|
||||||
if (!prefMsgLowRingtone_value.getText().equals(s.PriorityLow.SoundName)) prefMsgLowRingtone_value.setText(s.PriorityLow.SoundName);
|
if (!prefMsgLowRingtone_value.getText().equals(s.PriorityLow.SoundName)) prefMsgLowRingtone_value.setText(s.PriorityLow.SoundName);
|
||||||
@@ -341,7 +342,7 @@ public class SettingsFragment extends Fragment implements MusicPickerListener
|
|||||||
{
|
{
|
||||||
SCNSettings.inst().save();
|
SCNSettings.inst().save();
|
||||||
updateUI();
|
updateUI();
|
||||||
SCNApp.getMainActivity().adpTabs.tab1.touchHelper.updateEnabled();
|
SCNApp.getMainActivity().adpTabs.tab1.updateDeleteSwipeEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onUpgradeAccount()
|
private void onUpgradeAccount()
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
#Sat Nov 17 18:59:44 CET 2018
|
#Mon Nov 19 18:43:09 CET 2018
|
||||||
VERSION_NAME=0.0.11
|
VERSION_NAME=1.1.0
|
||||||
VERSION_CODE=11
|
VERSION_CODE=15
|
||||||
|
BIN
data/README/badge_amazon.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
data/README/badge_apple.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
data/README/badge_apple_2.png
Normal file
After Width: | Height: | Size: 729 B |
BIN
data/README/badge_google.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
data/README/badge_google_2.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
data/README/badge_microsoft.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
data/phone.pdn
Normal file
BIN
data/phone.png
Normal file
After Width: | Height: | Size: 1.0 MiB |
@@ -1,13 +1,13 @@
|
|||||||
SimpleCloudNotifier is a app to display messages that you can send to your phone with a simple POST request to the right URL.
|
SimpleCloudNotifier is a app to display messages that you can send to your phone with a simple POST request to the right URL.
|
||||||
|
|
||||||
After you start the app it generates a userID and a private key.
|
After you start the app it generates a UserID and a UserSecret.
|
||||||
Now you can send your message to https://simplecloudnotifier.blackforestbytes.com/send.php and a notification will be pushed to your phone.
|
Now you can send your message to https://simplecloudnotifier.blackforestbytes.com/send.php and a notification will be pushed to your phone.
|
||||||
(see https://simplecloudnotifier.blackforestbytes.com/ for an example with curl)
|
(see https://simplecloudnotifier.blackforestbytes.com/ for an example with curl)
|
||||||
|
|
||||||
|
|
||||||
Use it to
|
Use it to
|
||||||
- send yourself automated messages from cron jobs
|
- send yourself automated messages from cron jobs
|
||||||
- notify youreself when long-running scripts finish
|
- notify yourself when long-running scripts finish
|
||||||
- send server error messages directly to your phone
|
- send server error messages directly to your phone
|
||||||
- integrate with other online services
|
- integrate with other online services
|
||||||
|
|
||||||
|
10
web/api.php
@@ -1,5 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<?php
|
||||||
|
if (file_exists('/var/www/openwebanalytics/owa_php.php'))
|
||||||
|
{
|
||||||
|
require_once('/var/www/openwebanalytics/owa_php.php');
|
||||||
|
$owa = new owa_php();
|
||||||
|
$owa->setSiteId('6386b0efc00d2e84ef642525345e1207');
|
||||||
|
$owa->setPageTitle('API (Short)');
|
||||||
|
$owa->trackPageView();
|
||||||
|
}
|
||||||
|
?>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<link rel="stylesheet" href="/css/mini-default.min.css"> <!-- https://minicss.org/docs -->
|
<link rel="stylesheet" href="/css/mini-default.min.css"> <!-- https://minicss.org/docs -->
|
||||||
|
@@ -1,5 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<?php
|
||||||
|
if (file_exists('/var/www/openwebanalytics/owa_php.php'))
|
||||||
|
{
|
||||||
|
require_once('/var/www/openwebanalytics/owa_php.php');
|
||||||
|
$owa = new owa_php();
|
||||||
|
$owa->setSiteId('6386b0efc00d2e84ef642525345e1207');
|
||||||
|
$owa->setPageTitle('API (Long)');
|
||||||
|
$owa->trackPageView();
|
||||||
|
}
|
||||||
|
?>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<link rel="stylesheet" href="/css/mini-default.min.css"> <!-- https://minicss.org/docs -->
|
<link rel="stylesheet" href="/css/mini-default.min.css"> <!-- https://minicss.org/docs -->
|
||||||
|
@@ -1,5 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<?php
|
||||||
|
if (file_exists('/var/www/openwebanalytics/owa_php.php'))
|
||||||
|
{
|
||||||
|
require_once('/var/www/openwebanalytics/owa_php.php');
|
||||||
|
$owa = new owa_php();
|
||||||
|
$owa->setSiteId('6386b0efc00d2e84ef642525345e1207');
|
||||||
|
$owa->setPageTitle('Index');
|
||||||
|
$owa->trackPageView();
|
||||||
|
}
|
||||||
|
?>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Simple Cloud Notifications</title>
|
<title>Simple Cloud Notifications</title>
|
||||||
|