LMMS
Loading...
Searching...
No Matches
juce::PushNotifications::Settings Struct Reference

#include <juce_PushNotifications.h>

Classes

struct  Category

Public Types

using Action = Notification::Action

Public Attributes

bool allowSound = false
bool allowAlert = false
bool allowBadge = false
Array< Categorycategories

Detailed Description

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:

Action okAction;
okAction.identifier = "okAction";
okAction.title = "OK!";
okAction.style = Action::button;
okAction.triggerInBackground = true;
Action cancelAction;
cancelAction.identifier = "cancelAction";
cancelAction.title = "Cancel";
cancelAction.style = Action::button;
cancelAction.triggerInBackground = true;
cancelAction.destructive = true;
Action textAction;
textAction.identifier = "textAction";
textAction.title = "Enter text";
textAction.style = Action::text;
textAction.triggerInBackground = true;
textAction.destructive = false;
textAction.textInputButtonText = "Ok";
textAction.textInputPlaceholder = "Enter text...";
Category okCategory;
okCategory.identifier = "okCategory";
okCategory.actions = { okAction };
Category okCancelCategory;
okCancelCategory.identifier = "okCancelCategory";
okCancelCategory.actions = { okAction, cancelAction };
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 };
bool triggerInBackground
Definition juce_PushNotifications.h:88
String textInputPlaceholder
Definition juce_PushNotifications.h:79
@ button
Definition juce_PushNotifications.h:71
@ text
Definition juce_PushNotifications.h:72
String title
Definition juce_PushNotifications.h:78
String identifier
Definition juce_PushNotifications.h:86
Style style
Definition juce_PushNotifications.h:77
bool destructive
Definition juce_PushNotifications.h:89
String textInputButtonText
Definition juce_PushNotifications.h:90
Definition juce_PushNotifications.h:397
juce::Array< Action > actions
Definition juce_PushNotifications.h:399
juce::String identifier
Definition juce_PushNotifications.h:398
Notification::Action Action
Definition juce_PushNotifications.h:389

Member Typedef Documentation

◆ Action

using juce::PushNotifications::Settings::Action = Notification::Action

Member Data Documentation

◆ allowAlert

bool juce::PushNotifications::Settings::allowAlert = false

whether the app should present an alert upon notification

◆ allowBadge

bool juce::PushNotifications::Settings::allowBadge = false

whether the app may badge its icon upon notification

◆ allowSound

bool juce::PushNotifications::Settings::allowSound = false

whether the app should play a sound upon notification

◆ categories

Array<Category> juce::PushNotifications::Settings::categories

list of categories the app wants to support


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