LSMPNBuilder Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | LSMPNBuilder.h |
Overview
Utility class that provides methods to build or parse the JSON structure used to represent the format of a push notification.
It provides properties and methods to get and set the fields of a push notification, following the format specified by Apple’s Push Notification service (APNs). This format is compatible with [LSMPNSubscription notificationFormat].
– init
Creates an empty object to be used to create a push notification format from scratch.
Use setters methods to set the value of push notification fields.
- (nonnull instancetype)initDeclared In
LSMPNBuilder.h
– initWithNotificationFormat:
Creates an object based on the specified push notification format.
Use properties and setter methods to get and set the value of push notification fields.
- (nonnull instancetype)initWithNotificationFormat:(nonnull NSString *)notificationFormatParameters
notificationFormat |
A JSON structure representing a push notification format. |
|---|
Exceptions
NSException |
if the notification is not a valid JSON structure. |
|---|
Declared In
LSMPNBuilder.h
– build
Produces the JSON structure for the push notification format specified by this object.
- (nonnull NSString *)buildDeclared In
LSMPNBuilder.h
– alert:
Sets the aps.alert field.
- (nonnull LSMPNBuilder *)alert:(nullable NSString *)alertParameters
alert |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
alert
Value of the aps.alert field.
@property (nonatomic, readonly, nullable) NSString *alertDeclared In
LSMPNBuilder.h
– badgeWithInt:
Sets the aps.alert field with an int value.
- (nonnull LSMPNBuilder *)badgeWithInt:(int)badgeParameters
badge |
An int to be used for the |
|---|
Declared In
LSMPNBuilder.h
badgeAsInt
Value of the aps.badge field as an int value.
@property (nonatomic, readonly) int badgeAsIntDeclared In
LSMPNBuilder.h
– badgeWithString:
Sets the aps.badge field with a string value.
- (nonnull LSMPNBuilder *)badgeWithString:(nullable NSString *)badgeParameters
badge |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
badgeAsString
Value of the aps.badge field as a string value.
@property (nonatomic, readonly, nullable) NSString *badgeAsStringDeclared In
LSMPNBuilder.h
– body:
Sets the aps.alert.body field.
- (nonnull LSMPNBuilder *)body:(nullable NSString *)bodyParameters
body |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
body
Value of the aps.alert.body field.
@property (nonatomic, readonly, nullable) NSString *bodyDeclared In
LSMPNBuilder.h
– bodyLocArguments:
Sets the aps.alert.loc-args field.
- (nonnull LSMPNBuilder *)bodyLocArguments:(nullable NSArray<NSString*> *)bodyLocArgumentsParameters
bodyLocArguments |
An array of strings to be used for the |
|---|
Declared In
LSMPNBuilder.h
bodyLocArguments
Value of the aps.alert.loc-args field as an array of strings.
@property (nonatomic, readonly, nullable) NSArray<NSString*> *bodyLocArgumentsDeclared In
LSMPNBuilder.h
– bodyLocKey:
Sets the aps.alert.loc-key field.
- (nonnull LSMPNBuilder *)bodyLocKey:(nullable NSString *)bodyLocKeyParameters
bodyLocKey |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
bodyLocKey
Value of the aps.alert.loc-key field.
@property (nonatomic, readonly, nullable) NSString *bodyLocKeyDeclared In
LSMPNBuilder.h
– category:
Sets the aps.category field.
- (nonnull LSMPNBuilder *)category:(nullable NSString *)categoryParameters
category |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
category
Value of the aps.category field.
@property (nonatomic, readonly, nullable) NSString *categoryDeclared In
LSMPNBuilder.h
– contentAvailableWithInt:
Sets the aps.content-available field with an int value.
- (nonnull LSMPNBuilder *)contentAvailableWithInt:(int)contentAvailableParameters
contentAvailable |
An int to be used for the |
|---|
Declared In
LSMPNBuilder.h
contentAvailableAsInt
Value of the aps.content-available field as an int value.
@property (nonatomic, readonly) int contentAvailableAsIntDeclared In
LSMPNBuilder.h
– contentAvailableWithString:
Sets the aps.content-available field with a string value.
- (nonnull LSMPNBuilder *)contentAvailableWithString:(nullable NSString *)contentAvailableParameters
contentAvailable |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
contentAvailableAsString
Value of the aps.content-available field as a string value.
@property (nonatomic, readonly, nullable) NSString *contentAvailableAsStringDeclared In
LSMPNBuilder.h
– mutableContentWithInt:
Sets the aps.mutable-content field with an int value.
- (nonnull LSMPNBuilder *)mutableContentWithInt:(int)mutableContentParameters
mutableContent |
An int to be used for the |
|---|
Declared In
LSMPNBuilder.h
mutableContentAsInt
Value of the aps.mutable-content field as an int value.
@property (nonatomic, readonly) int mutableContentAsIntDeclared In
LSMPNBuilder.h
– mutableContentWithString:
Sets the aps.mutable-content field with a string value.
- (nonnull LSMPNBuilder *)mutableContentWithString:(nullable NSString *)mutableContentParameters
mutableContent |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
mutableContentAsString
Value of the aps.mutable-content field as a string value.
@property (nonatomic, readonly, nullable) NSString *mutableContentAsStringDeclared In
LSMPNBuilder.h
– customData:
Sets fields in the root of the notification format (excluding aps).
- (nonnull LSMPNBuilder *)customData:(nullable NSDictionary<NSString*,id> *)customDataParameters
customData |
A dictionary to be used for fields in the root of the notification format (excluding |
|---|
Declared In
LSMPNBuilder.h
customData
Fields in the root of the notification format (excluding aps).
@property (nonatomic, readonly, nullable) NSDictionary<NSString*id> *customDataDeclared In
LSMPNBuilder.h
– launchImage:
Sets the aps.alert.launch-image field.
- (nonnull LSMPNBuilder *)launchImage:(nullable NSString *)launchImageParameters
launchImage |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
launchImage
Value of the aps.alert.launch-image field.
@property (nonatomic, readonly, nullable) NSString *launchImageDeclared In
LSMPNBuilder.h
– locActionKey:
Sets the aps.alert.action-loc-key field.
- (nonnull LSMPNBuilder *)locActionKey:(nullable NSString *)locActionKeyParameters
locActionKey |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
locActionKey
Value of the aps.alert.action-loc-key field.
@property (nonatomic, readonly, nullable) NSString *locActionKeyDeclared In
LSMPNBuilder.h
– sound:
Sets the aps.sound field.
- (nonnull LSMPNBuilder *)sound:(nullable NSString *)soundParameters
sound |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
sound
Value of the aps.sound field.
@property (nonatomic, readonly, nullable) NSString *soundDeclared In
LSMPNBuilder.h
– threadId:
Sets the aps.thread-id field.
- (nonnull LSMPNBuilder *)threadId:(nullable NSString *)threadIdParameters
threadId |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
threadId
Value of the aps.thread-id field.
@property (nonatomic, readonly, nullable) NSString *threadIdDeclared In
LSMPNBuilder.h
– title:
Sets the aps.alert.title field.
- (nonnull LSMPNBuilder *)title:(nullable NSString *)titleParameters
title |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
title
Value of the aps.alert.title field.
@property (nonatomic, readonly, nullable) NSString *titleDeclared In
LSMPNBuilder.h
– subtitle:
Sets the aps.alert.subtitle field.
- (nonnull LSMPNBuilder *)subtitle:(nullable NSString *)subtitleParameters
subtitle |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
subtitle
Value of the aps.alert.subtitle field.
@property (nonatomic, readonly, nullable) NSString *subtitleDeclared In
LSMPNBuilder.h
– titleLocArguments:
Sets the aps.alert.title-loc-args field.
- (nonnull LSMPNBuilder *)titleLocArguments:(nullable NSArray<NSString*> *)titleLocArgumentsParameters
titleLocArguments |
An array of strings to be used for the |
|---|
Declared In
LSMPNBuilder.h
titleLocArguments
Value of the aps.alert.title-loc-args field.
@property (nonatomic, readonly, nullable) NSArray<NSString*> *titleLocArgumentsDeclared In
LSMPNBuilder.h
– titleLocKey:
Sets the aps.alert.title-loc-key field.
- (nonnull LSMPNBuilder *)titleLocKey:(nullable NSString *)titleLocKeyParameters
titleLocKey |
A string to be used for the |
|---|
Declared In
LSMPNBuilder.h
titleLocKey
Value of the aps.alert.title-loc-key field.
@property (nonatomic, readonly, nullable) NSString *titleLocKeyDeclared In
LSMPNBuilder.h