JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Classes | Public Types | Public Attributes | List of all members
PushNotifications::Settings Struct Reference
juce_gui_extra » misc

Describes settings we want to use for current device. More...

`#include <juce_PushNotifications.h>`

## Classes
struct | Category
| Describes a category of a notification. More...

## Public Types
using | Action = Notification::Action

## Public Attributes
bool | allowSound = false
| whether the app should play a sound upon notification
bool | allowAlert = false
| whether the app should present an alert upon notification
bool | allowBadge = false
| whether the app may badge its icon upon notification
Array< Category > | categories
| list of categories the app wants to support

## 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:

using Action = PushNotifications::Settings::Action;
using Category = PushNotifications::Settings::Category;
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 };
PushNotifications::Notification::Action
Represents an action on a notification that can be presented as a button or a text input.
Definition juce_PushNotifications.h:68
PushNotifications::Notification::Action::identifier
String identifier
Required: unique identifier.
Definition juce_PushNotifications.h:87
PushNotifications::Notification::Action::style
Style style
Definition juce_PushNotifications.h:78
PushNotifications::Notification::Action::title
String title
Required.
Definition juce_PushNotifications.h:79
PushNotifications::Notification::Action::button
@ button
Show this action as a button.
Definition juce_PushNotifications.h:72
PushNotifications::Notification::Action::text
@ text
Show this action as a text input field (on Android API 20 or higher is required).
Definition juce_PushNotifications.h:73
PushNotifications::Notification::Action::triggerInBackground
bool triggerInBackground
Whether the app can process the action in background.
Definition juce_PushNotifications.h:89
PushNotifications::Notification::Action::destructive
bool destructive
Whether to display the action as destructive.
Definition juce_PushNotifications.h:90
PushNotifications::Notification::Action::textInputPlaceholder
String textInputPlaceholder
Optional: placeholder text for text input notification.
Definition juce_PushNotifications.h:80
PushNotifications::Notification::Action::textInputButtonText
String textInputButtonText
Optional: Text displayed on text input notification button (from iOS 10 only).
Definition juce_PushNotifications.h:91
PushNotifications::Settings::Category
Describes a category of a notification.
Definition juce_PushNotifications.h:398
PushNotifications::Settings::Category::identifier
juce::String identifier
unique identifier
Definition juce_PushNotifications.h:399
PushNotifications::Settings::Category::actions
juce::Array< Action > actions
optional list of actions within this category
Definition juce_PushNotifications.h:400
PushNotifications::Settings
Describes settings we want to use for current device.
Definition juce_PushNotifications.h:389
PushNotifications::Settings::Action
Notification::Action Action
Definition juce_PushNotifications.h:390
PushNotifications::Settings::allowBadge
bool allowBadge
whether the app may badge its icon upon notification
Definition juce_PushNotifications.h:406
PushNotifications::Settings::categories
Array< Category > categories
list of categories the app wants to support
Definition juce_PushNotifications.h:407
PushNotifications::Settings::allowSound
bool allowSound
whether the app should play a sound upon notification
Definition juce_PushNotifications.h:404
PushNotifications::Settings::allowAlert
bool allowAlert
whether the app should present an alert upon notification
Definition juce_PushNotifications.h:405

## Member Typedef Documentation

## ◆ Action

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

## Member Data Documentation

## ◆ allowSound

bool PushNotifications::Settings::allowSound = false

whether the app should play a sound upon notification

## ◆ allowAlert

bool PushNotifications::Settings::allowAlert = false

whether the app should present an alert upon notification

## ◆ allowBadge

bool PushNotifications::Settings::allowBadge = false

whether the app may badge its icon upon notification

## ◆ categories

Array<Category> PushNotifications::Settings::categories

list of categories the app wants to support

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

- juce_PushNotifications.h