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

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

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;
settings.allowAlert = true;
settings.allowBadge = true;
settings.allowSound = true;
Helper class for using linear interpolation between a begin and an end value.
Definition juce_StaticAnimationLimits.h:77
Represents an action on a notification that can be presented as a button or a text input.
Definition juce_PushNotifications.h:79
@ button
Show this action as a button.
Definition juce_PushNotifications.h:83
@ text
Show this action as a text input field (on Android API 20 or higher is required).
Definition juce_PushNotifications.h:84
Describes a category of a notification.
Definition juce_PushNotifications.h:409
Describes settings we want to use for current device.
Definition juce_PushNotifications.h:400
Notification::Action Action
Definition juce_PushNotifications.h:401
bool allowBadge
whether the app may badge its icon upon notification
Definition juce_PushNotifications.h:417
Array< Category > categories
list of categories the app wants to support
Definition juce_PushNotifications.h:418
bool allowSound
whether the app should play a sound upon notification
Definition juce_PushNotifications.h:415
bool allowAlert
whether the app should present an alert upon notification
Definition juce_PushNotifications.h:416

Member Typedef Documentation

◆ 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:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram