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 | Namespaces
juce_PushNotifications.h File Reference

Go to the source code of this file.

Classes

class  juce::PushNotifications
 Singleton class responsible for push notifications functionality. More...
 
struct  juce::PushNotifications::Notification
 Represents a notification that can be sent or received. More...
 
struct  juce::PushNotifications::Notification::Action
 Represents an action on a notification that can be presented as a button or a text input. More...
 
struct  juce::PushNotifications::Notification::Progress
 Used to represent a progress of some operation. More...
 
struct  juce::PushNotifications::Notification::LedBlinkPattern
 Allows to control the time the device's led is on and off. More...
 
struct  juce::PushNotifications::Settings
 Describes settings we want to use for current device. More...
 
struct  juce::PushNotifications::Settings::Category
 Describes a category of a notification. More...
 
struct  juce::PushNotifications::Channel
 Android API level 26 or higher only: Represents notification channel through which notifications will be sent. More...
 
struct  juce::PushNotifications::ChannelGroup
 Android API level 26 or higher only: represents a channel group. More...
 
struct  juce::PushNotifications::Listener
 Register a listener (ideally on application startup) to receive information about notifications received and any callbacks to async functions called. More...
 

Namespaces

namespace  juce
 JUCE Namespace.
 

Class Documentation

◆ 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.

◆ 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::Settings

struct juce::PushNotifications::Settings

Describes settings we want to use for current device.

Note that at the moment this is only used on iOS and partially on OSX.

On OSX only allow* flags are used and they control remote notifications only. To control sound, alert and badge settings for local notifications on OSX, use Notifications settings in System Preferences.

To setup push notifications for current device, provide permissions required, as well as register categories of notifications you want to support. Each category needs to have a unique identifier and it can optionally have multiple actions. Each action also needs to have a unique identifier. The example setup may look as follows:

okAction.identifier = "okAction";
okAction.title = "OK!";
okAction.triggerInBackground = true;
cancelAction.identifier = "cancelAction";
cancelAction.title = "Cancel";
cancelAction.triggerInBackground = true;
cancelAction.destructive = true;
textAction.identifier = "textAction";
textAction.title = "Enter text";
textAction.triggerInBackground = true;
textAction.destructive = false;
textAction.textInputButtonText = "Ok";
textAction.textInputPlaceholder = "Enter text...";
okCategory.identifier = "okCategory";
okCategory.actions = { okAction };
okCancelCategory.identifier = "okCancelCategory";
Category textCategory;
textCategory.identifier = "textCategory";
textCategory.actions = { textAction };
textCategory.sendDismissAction = true;
PushNotifications::Settings settings;
settings.allowAlert = true;
settings.allowBadge = true;
settings.allowSound = true;
settings.categories = { okCategory, okCancelCategory, textCategory };
Describes a category of a notification.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88
Represents an action on a notification that can be presented as a button or a text input.
@ text
Show this action as a text input field (on Android API 20 or higher is required).
String identifier
Required: unique identifier.

Definition at line 387 of file juce_PushNotifications.h.

Class Members
typedef Action Action
Class Members
bool allowAlert whether the app should present an alert upon notification
bool allowBadge whether the app may badge its icon upon notification
bool allowSound whether the app should play a sound upon notification
Array< Category > categories list of categories the app wants to support

◆ juce::PushNotifications::Settings::Category

struct juce::PushNotifications::Settings::Category

Describes a category of a notification.

Each category has a unique identifier and a list of associated actions. Note that the OS may allow only a limited number of actions to be presented, so always present most important actions first.

Definition at line 396 of file juce_PushNotifications.h.

Class Members
Array< Action > actions optional list of actions within this category
String identifier unique identifier
bool sendDismissAction whether dismiss action will be sent to the app (from iOS 10 only)

◆ juce::PushNotifications::ChannelGroup

struct juce::PushNotifications::ChannelGroup

Android API level 26 or higher only: represents a channel group.

This allows for visual grouping of corresponding channels in notification settings presented to the user. At least one channel group has to be specified before notifications can be sent.

Definition at line 481 of file juce_PushNotifications.h.

Class Members
String identifier Required: Unique channel group identifier.
String name Required: User visible name of the channel group.