JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
juce::PushNotifications::Notification Struct Reference

Represents a notification that can be sent or received. More...

#include "juce_PushNotifications.h"

Classes

struct  Action
 Represents an action on a notification that can be presented as a button or a text input. More...
 
struct  LedBlinkPattern
 Allows to control the time the device's led is on and off. More...
 
struct  Progress
 Used to represent a progress of some operation. More...
 

Public Member Functions

 Notification (const Notification &other)
 
bool isValid () const noexcept
 Checks whether a given notification is correctly configured for a given OS.
 

Public Attributes

Common fields
String identifier
 Required: unique id that can be used to later dismiss the notification (on iOS available from version 10).
 
String title
 Required: the title of the notification, usually displayed in the first row.
 
String body
 Required: the content of the notification, usually displayed in the second row.
 
String subtitle
 Optional: additional text, that may be displayed e.g.
 
String groupId
 Optional: allows the OS to visually group, collapse, and expand a set of notifications, note that OS may automatically group notifications if no groupId is specified.
 
int badgeNumber
 Optional: on platforms that support it, can set a number this notification represents.
 
URL soundToPlay
 Optional: empty when the notification should be silent.
 
var properties
 Optional: collection of additional properties that may be passed as a dictionary.
 
iOS only fields
String category
 Required: determines set of actions that will appear (as per setup done in requestPermissionsWithSettings()).
 
double triggerIntervalSec
 Optional: specifies number of seconds before the notification should trigger.
 
bool repeat
 Optional: allows the notification to continuously retrigger after triggerIntervalSec seconds.
 

Android only fields

enum  Type {
  unspecified , alarm , call , email ,
  error , event , message , taskProgress ,
  promo , recommendation , reminder , service ,
  social , status , system , transport
}
 Metadata that can be used by the OS to better handle the notification, depending on its priority. More...
 
enum  Priority {
  veryLow , low , medium , high ,
  veryHigh
}
 Metadata used as a hint to the OS about the priority of the notification. More...
 
enum  LockScreenAppearance { dontShow , showPartially , showCompletely }
 Describes how to show the notification when the screen is locked. More...
 
enum  TimestampVisibility { off , normal , chronometer , countDownChronometer }
 Controls timestamp visibility and format. More...
 
enum  BadgeIconType { none , small , large }
 Controls badge icon type to use if a notification is shown as a badge. More...
 
enum  GroupAlertBehaviour { alertAll , AlertSummary , AlertChildren }
 Controls sound and vibration behaviour for group notifications. More...
 
String icon
 Required: name of an icon file (without an extension) to be used for this notification.
 
String channelId
 Required for Android API level 26 or above: specifies notification channel id.
 
Image largeIcon
 Optional: an additional large icon displayed in the notification content view.
 
String tickerText
 Optional: ticker text used for accessibility services.
 
Array< Actionactions
 Optional: actions associated with the notification.
 
Progress progress
 Optional: set to default (0, 0, false), to disable progress display.
 
String person
 Optional: additional metadata used as a hint to OS that a notification is related to a specific person.
 
Type type
 Optional.
 
Priority priority
 Optional.
 
LockScreenAppearance lockScreenAppearance
 Optional.
 
std::unique_ptr< NotificationpublicVersion
 Optional: if you set lockScreenAppearance to showPartially, then you can provide "public version" of your notification that will be displayed on the lock screen.
 
String groupSortKey
 Optional: Used to order notifications within the same group.
 
bool groupSummary
 Optional: if true, then this notification will be a group summary of the group set with groupId.
 
Colour accentColour
 Optional: sets accent colour.
 
Colour ledColour
 Optional: Sets the led colour.
 
LedBlinkPattern ledBlinkPattern
 Optional.
 
Array< intvibrationPattern
 Optional: sets the vibration pattern in milliseconds.
 
bool shouldAutoCancel
 Optional: If true, the notification will be automatically cancelled when a user clicks it in the panel.
 
bool localOnly
 Optional: whether or not the notification should bridge to other devices.
 
bool ongoing
 Optional: If true, then it cannot be dismissed by the user and it must be dismissed manually.
 
bool alertOnlyOnce
 Optional: Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing.
 
TimestampVisibility timestampVisibility
 Optional.
 
BadgeIconType badgeIconType
 
GroupAlertBehaviour groupAlertBehaviour
 
int timeoutAfterMs
 specifies a duration in milliseconds, after which the notification should be cancelled, if it is not already cancelled.
 

Detailed Description

Represents a notification that can be sent or received.

Definition at line 54 of file juce_PushNotifications.h.


Class Documentation

◆ juce::PushNotifications::Notification::LedBlinkPattern

struct juce::PushNotifications::Notification::LedBlinkPattern

Allows to control the time the device's led is on and off.

Definition at line 258 of file juce_PushNotifications.h.

Class Members
int msToBeOff The led will be off for the given number of milliseconds, after which it will turn on.
int msToBeOn The led will be on for the given number of milliseconds, after which it will turn off.

◆ juce::PushNotifications::Notification::Progress

struct juce::PushNotifications::Notification::Progress

Used to represent a progress of some operation.

Definition at line 184 of file juce_PushNotifications.h.

Class Members
int current Current progress value, should be from 0 to max.
bool indeterminate If true, then the progress represents a continuing activity indicator with ongoing animation and no numeric value.
int max Max possible value of a progress.

A typical usecase is to set max to 100 and increment current's value as percentage complete.

Member Enumeration Documentation

◆ BadgeIconType

Controls badge icon type to use if a notification is shown as a badge.

Available from Android API 26 or above.

Definition at line 298 of file juce_PushNotifications.h.

◆ GroupAlertBehaviour

Controls sound and vibration behaviour for group notifications.

Available from Android API 26 or above.

Enumerator
alertAll 

both child notifications and group notifications should produce sound and vibration.

AlertSummary 

all child notifications in the group should have no sound nor vibration, even if corresponding notification channel has sounds and vibrations enabled.

AlertChildren 

summary notifications in the group should have no sound nor vibration, even if corresponding notification channel has sounds and vibrations enabled.

Definition at line 308 of file juce_PushNotifications.h.

◆ LockScreenAppearance

Describes how to show the notification when the screen is locked.

Available from Android API 21 or above.

Enumerator
dontShow 

The notification is not allowed on the lock screen.

showPartially 

Only some information is allowed on the lock screen.

showCompletely 

The entire notification is allowed on the lock screen.

Definition at line 234 of file juce_PushNotifications.h.

◆ Priority

Metadata used as a hint to the OS about the priority of the notification.

Definition at line 217 of file juce_PushNotifications.h.

◆ TimestampVisibility

Controls timestamp visibility and format.

Enumerator
off 

Do not show timestamp.

normal 

Show normal timestamp.

chronometer 

Show chronometer as a stopwatch.

Available from Android API 16 or above.

countDownChronometer 

Set the chronometer to count down instead of counting up.

Available from Android API 24 or above.

Definition at line 287 of file juce_PushNotifications.h.

◆ Type

Metadata that can be used by the OS to better handle the notification, depending on its priority.

Enumerator
unspecified 

Category not set.

alarm 

Alarm or timer.

call 

Incoming voice/video call or similar.

email 

Async message like email.

error 

Error in background operation or authentication status.

event 

Calendar event.

message 

Incoming message (sms, instant message etc.).

taskProgress 

Progress for a long-running background operation.

promo 

Promotion or advertisement.

recommendation 

Specific, single thing related recommendation.

reminder 

User-scheduled reminder.

service 

Running background service.

social 

Social network or sharing update.

status 

Ongoing information about device or contextual status.

system 

System or device status update.

transport 

Media transport control for playback.

Definition at line 196 of file juce_PushNotifications.h.

Constructor & Destructor Documentation

◆ Notification()

juce::PushNotifications::Notification::Notification ( const Notification other)

Definition at line 34 of file juce_PushNotifications.cpp.

Member Function Documentation

◆ isValid()

bool juce::PushNotifications::Notification::isValid ( ) const
noexcept

Checks whether a given notification is correctly configured for a given OS.

Definition at line 31 of file juce_PushNotifications.cpp.

Member Data Documentation

◆ accentColour

Colour juce::PushNotifications::Notification::accentColour

Optional: sets accent colour.

The default colour will be used if accentColour is not set. Available from Android API 21 or above.

Definition at line 252 of file juce_PushNotifications.h.

◆ actions

Array<Action> juce::PushNotifications::Notification::actions

Optional: actions associated with the notification.

Note that the OS may allow only a limited number of actions to be presented, so always present most important actions first. Available from Android API 16 or above.

Definition at line 179 of file juce_PushNotifications.h.

◆ alertOnlyOnce

bool juce::PushNotifications::Notification::alertOnlyOnce

Optional: Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing.

Definition at line 283 of file juce_PushNotifications.h.

◆ badgeIconType

BadgeIconType juce::PushNotifications::Notification::badgeIconType

Definition at line 305 of file juce_PushNotifications.h.

◆ badgeNumber

int juce::PushNotifications::Notification::badgeNumber

Optional: on platforms that support it, can set a number this notification represents.

Definition at line 127 of file juce_PushNotifications.h.

◆ body

String juce::PushNotifications::Notification::body

Required: the content of the notification, usually displayed in the second row.

Definition at line 117 of file juce_PushNotifications.h.

◆ category

String juce::PushNotifications::Notification::category

Required: determines set of actions that will appear (as per setup done in requestPermissionsWithSettings()).

Definition at line 155 of file juce_PushNotifications.h.

◆ channelId

String juce::PushNotifications::Notification::channelId

Required for Android API level 26 or above: specifies notification channel id.

Refer to setupChannels(). Ignored on earlier Android versions.

Definition at line 172 of file juce_PushNotifications.h.

◆ groupAlertBehaviour

GroupAlertBehaviour juce::PushNotifications::Notification::groupAlertBehaviour

Definition at line 317 of file juce_PushNotifications.h.

◆ groupId

String juce::PushNotifications::Notification::groupId

Optional: allows the OS to visually group, collapse, and expand a set of notifications, note that OS may automatically group notifications if no groupId is specified.

Available on Android API 20 or above and iOS 10 or above.

Definition at line 123 of file juce_PushNotifications.h.

◆ groupSortKey

String juce::PushNotifications::Notification::groupSortKey

Optional: Used to order notifications within the same group.

Available from Android API 20 or above.

Definition at line 248 of file juce_PushNotifications.h.

◆ groupSummary

bool juce::PushNotifications::Notification::groupSummary

Optional: if true, then this notification will be a group summary of the group set with groupId.

Available from Android API 20 or above.

Definition at line 249 of file juce_PushNotifications.h.

◆ icon

String juce::PushNotifications::Notification::icon

Required: name of an icon file (without an extension) to be used for this notification.

This must be the name of one of the image files included into resources when exporting an Android project (see "Extra Android Raw Resources" setting in Projucer).

Definition at line 167 of file juce_PushNotifications.h.

◆ identifier

String juce::PushNotifications::Notification::identifier

Required: unique id that can be used to later dismiss the notification (on iOS available from version 10).

Definition at line 113 of file juce_PushNotifications.h.

◆ largeIcon

Image juce::PushNotifications::Notification::largeIcon

Optional: an additional large icon displayed in the notification content view.

Definition at line 175 of file juce_PushNotifications.h.

◆ ledBlinkPattern

LedBlinkPattern juce::PushNotifications::Notification::ledBlinkPattern

Optional.

Definition at line 264 of file juce_PushNotifications.h.

◆ ledColour

Colour juce::PushNotifications::Notification::ledColour

Optional: Sets the led colour.

The hardware will do its best to approximate the colour. The default colour will be used if ledColour is not set.

Definition at line 254 of file juce_PushNotifications.h.

◆ localOnly

bool juce::PushNotifications::Notification::localOnly

Optional: whether or not the notification should bridge to other devices.

Available from Android API 20 or above.

Definition at line 275 of file juce_PushNotifications.h.

◆ lockScreenAppearance

LockScreenAppearance juce::PushNotifications::Notification::lockScreenAppearance

Optional.

Definition at line 241 of file juce_PushNotifications.h.

◆ ongoing

bool juce::PushNotifications::Notification::ongoing

Optional: If true, then it cannot be dismissed by the user and it must be dismissed manually.

Typically used for ongoing background tasks that the user is actively engaged with. To dismiss such notification, you need to call removeDeliveredNotification() or removeAllDeliveredNotifications().

Definition at line 278 of file juce_PushNotifications.h.

◆ person

String juce::PushNotifications::Notification::person

Optional: additional metadata used as a hint to OS that a notification is related to a specific person.

Can be useful for instance messaging apps. Available from Android API 21 or above.

Definition at line 226 of file juce_PushNotifications.h.

◆ priority

Priority juce::PushNotifications::Notification::priority

Optional.

Available from Android API 16 or above.

Definition at line 231 of file juce_PushNotifications.h.

◆ progress

Progress juce::PushNotifications::Notification::progress

Optional: set to default (0, 0, false), to disable progress display.

Definition at line 193 of file juce_PushNotifications.h.

◆ properties

var juce::PushNotifications::Notification::properties

Optional: collection of additional properties that may be passed as a dictionary.

Definition at line 147 of file juce_PushNotifications.h.

◆ publicVersion

std::unique_ptr<Notification> juce::PushNotifications::Notification::publicVersion

Optional: if you set lockScreenAppearance to showPartially, then you can provide "public version" of your notification that will be displayed on the lock screen.

This way you can control what information is visible when the screen is locked.

Definition at line 243 of file juce_PushNotifications.h.

◆ repeat

bool juce::PushNotifications::Notification::repeat

Optional: allows the notification to continuously retrigger after triggerIntervalSec seconds.

Available from iOS 10.

Definition at line 158 of file juce_PushNotifications.h.

◆ shouldAutoCancel

bool juce::PushNotifications::Notification::shouldAutoCancel

Optional: If true, the notification will be automatically cancelled when a user clicks it in the panel.

Definition at line 273 of file juce_PushNotifications.h.

◆ soundToPlay

URL juce::PushNotifications::Notification::soundToPlay

Optional: empty when the notification should be silent.

When the name is set to "default_os_sound", then a default sound will be used.

For a custom sound on OSX, set the URL to the name of a sound file (preferably without an extension) and place the sound file directly in bundle's "Resources" directory (you can use "Xcode Resource" tickbox in Projucer to achieve that), i.e. it cannot be in a subdirectory of "Resources" like "Resources/sound". Alternatively, if a sound file cannot be found in bundle's "Resources" directory, the OS may look for the sound in the following paths: "~/Library/Sounds", "/Library/Sounds", "/Network/Library/Sounds", "/System/Library/Sounds".

For a custom sound on iOS, set the URL to a relative path within your bundle, including file extension. For instance, if your bundle contains "sounds" folder with "my_sound.caf" file, then the URL should be "sounds/my_sound.caf".

For a custom sound on Android, set URL to the name of a raw resource file (without an extension) that was included when exporting an Android project in Projucer (see "Extra Android Raw Resources" setting).

Definition at line 128 of file juce_PushNotifications.h.

◆ subtitle

String juce::PushNotifications::Notification::subtitle

Optional: additional text, that may be displayed e.g.

in the third row or in the header area. Note that on Android, depending on OS version, this may fight for space with other components of the notification, so use this field judiciously. On iOS available from version 10. On Android available from API 16.

Definition at line 118 of file juce_PushNotifications.h.

◆ tickerText

String juce::PushNotifications::Notification::tickerText

Optional: ticker text used for accessibility services.

Definition at line 177 of file juce_PushNotifications.h.

◆ timeoutAfterMs

int juce::PushNotifications::Notification::timeoutAfterMs

specifies a duration in milliseconds, after which the notification should be cancelled, if it is not already cancelled.

Available from Android API 26 or above.

Definition at line 319 of file juce_PushNotifications.h.

◆ timestampVisibility

TimestampVisibility juce::PushNotifications::Notification::timestampVisibility

Optional.

Definition at line 295 of file juce_PushNotifications.h.

◆ title

String juce::PushNotifications::Notification::title

Required: the title of the notification, usually displayed in the first row.

Definition at line 116 of file juce_PushNotifications.h.

◆ triggerIntervalSec

double juce::PushNotifications::Notification::triggerIntervalSec

Optional: specifies number of seconds before the notification should trigger.

Definition at line 157 of file juce_PushNotifications.h.

◆ type

Type juce::PushNotifications::Notification::type

Optional.

Available from Android API 21 or above.

Definition at line 230 of file juce_PushNotifications.h.

◆ vibrationPattern

Array<int> juce::PushNotifications::Notification::vibrationPattern

Optional: sets the vibration pattern in milliseconds.

The first value indicates how long to wait until vibration starts. The second value indicates how long to vibrate. The third value will say how long to not vibrate and so on. For instance, if the pattern is: 1000, 2000, 3000, 4000 - then one second after receiving a notification the device will vibrate for two seconds, followed by 3 seconds of no vibration and finally, 4 seconds of vibration.

Definition at line 266 of file juce_PushNotifications.h.


The documentation for this struct was generated from the following files: