New improved Notification Extension


#1

Update
19/11/18

  • API 26 compatible
    Previous
    Added Property SetStyle , value 1 normal notificaton (default), 2 Big Text style to show more lines in a single notification.
    Now the notification shows your app icon.
    25/04/18
    fixed bug in fixed day interval
    (old examples of aia and apk files suppressed, I will reload them again but I’m thinking about adding new features before)

This extension send a notification in a future time, even if the app is closed and , with a little programming, even if the device was rebooted.
Four types of delay are available, with some properties to adapt them to your current needs.
The notification itself has been kept quite basic, at present, with a title, a message and a standard icon.
A start value can be set and then handled to the app if restarted.
At device reboot, a notification can be launched as a reminder for the user.
The restart of alarms, to be fired after the system reboot,
is easily done if you save them, e.g. in a file or DB, with the data retrieved with the event block and reuse them, when needed, with RestartAlarm block.
Please, be adviced that all alarms are set with setInexactRepeating method. Check the android documentation to understand the reason for this choice and practical consequences (they are not suitable, for example, to program a precise alarm clock).

.
Methods
CancelAnEvent Cancel an event
(idNumber) event identification number

NotifyAtRestart send a notification after device reboot with a fixed text as a reminder,
(notify) true/false

ExecuteOnce Send a notification once, at a certain date
(various params) time and message parameters
(idNumber) event identification number

ExecuteAfterDelay Set a delay in minutes and can repeat the notification
(various params) time and message parameters
(repeat) true/false
(minutesToNextAlarm) time of delay

ExecuteInFixedDay Send a notification once a week, at fixed hour/minutes and repeat it after a week
(various params) time and message parameters
(repeat) true/false
(dayOfWeek) the day of notification: 0 today, 1 Sunday…7 saturday (default is today)

ExecuteFromStartTime Send a notification at a certain hour/minute and can repeat
(various params) time and message parameters
(repeat) true/false
(minutesToNextAlarm) time of delay

RestartAlarm Set again an alarm previously saved, e.g. after a reboot, with the same characteristic of original alarm (this restart is not possible for ExecuteAfterDelay)
(resetAlarm) a list with an alarm data retrieved with AlarmSet

Events
AlarmSet return a list with data of an alarm just set, which could be reused later
(setAlarm) a list with last set alarm data

Properties
MinimumDelay Set the minimum delay between notifications
NotificationPriority Set the priority of notification from 1 to 5 (1 top…5 minimum)
NotificationVisibility Set the visibility of notification from 1 to 3 (1 min…3 maximum)
ShowToast Show an alert when an alarm is set
Sound Set sound on/off for notification
PersistentAlarm Set alarm to wake-up the device and send notification even if the app is closed
SetStyle Set style 1 for simple notification, 2 for multi-rows messages (BigText style), default is 1


#2

An .aia file is possible please?
Seems very nice extension for notifications, well done…


#3

+1


#4

tiziano se funziona davvero ti faccio santo


#5

Check the aia file in appybuilder community, in an equivalent topic. I devoleped there the app and some components are not common to other platforms, so you must substitute or adjust them if you want to work on that file , which is only a demo, though


#6

Ciao Tiziano ho settato la notifica per una data specifica ma non va dove sbaglio?


#7

The notification seems set for today, but I cannot see the startHour param, so I suppose it is already expired. NotificationPriority and NotificationVisibility must be set at high level, PersistentAlarm should be true. If the device is powered off and rebooted, the alarm must be restarted with RestartAlarm. Let me know …


#8

+1


#9

Hi, I set up as you told me but no notification was started at the set time.


#10

Could I ask you a working example? Please…
Thank you :pray:


#11

You can find a compiled app in first post above and an .aia example in the appybuilder community, provided that some components are not in common with different platform, if you want to use it in thunkable, some blocks, like switches, should be changed. The example you show should work, check the app has notification in the status bar permission, which Api version is your device up to?


#12

Please, see my previous post


#13

my mean working aia file


#14

The device on which I perform the tests has APIs of level 22


#15

It works , have you tried it? It is the file on which the demo app was built …


#16

There shouldn’t be any problem about that. If the aia is not too big or if you could separate the notifications blocks from ininfluent parts of the project, you could upload it here , to check it.


#17

I have a doubt but to test the extension the application should I compile it? Because until now I have tested via usb.
P.S. I can not separate the blocks.


#18

It was as I thought, I had to generate the Apk to get notifications.
Last thing how do you set the restart in case the device is restarted?


#19

You can retrieve the alarm you are going to reply with the event block AlarmSet ,which reports all data pertaining to a just launched alarm, save those data in a tinyDB and after reboot reset the value with ResetAlarm which takes as param. those saved data


#20

Updated extension, see links in first post