Lightstreamer iOS Client
1.4.5
Native iOS Client library for Lightstreamer
|
The LSMPNInfo class contains the table and format specification of mobile push notifications (MPN) to be sent on the update of an MPN subscription. More...
#import <LSMPNInfo.h>
Class Methods | |
(LSMPNInfo *) | + mpnInfoWithTableInfo:sound:badge:format: |
Creates and returns an LSMPNInfo object with the specified parameters. More... | |
(LSMPNInfo *) | + mpnInfoWithTableInfo:sound:badge:localizedFormatKey:arguments: |
Creates and returns an LSMPNInfo object with the specified parameters. More... | |
(LSMPNInfo *) | + mpnInfoWithTableInfo:sound:badge:localizedActionKey:localizedFormatKey:arguments: |
Creates and returns an LSMPNInfo object with the specified parameters. More... | |
(LSMPNInfo *) | + mpnInfoWithTableInfo:sound:badge:localizedActionKey:category:localizedFormatKey:arguments: |
Creates and returns an LSMPNInfo object with the specified parameters. More... | |
Properties | |
LSTableInfo * | tableInfo |
Contains the specification of the table to be subscribed. More... | |
NSString * | sound |
Specifies the sound to be used with the mobile push notification (for example: "Default"). More... | |
NSString * | badge |
Specifies the badge to be used with the mobile push notification (for example: "1"). More... | |
NSString * | contentAvailable |
Specifies the flag to signal the availability of new content to a Newsstand application (for example: "1"). More... | |
NSString * | launchImage |
Specifies the launch image to be shown when opening the mobile push notification (for example: "Default@2x.png"). More... | |
NSString * | localizedActionKey |
Specifies the key of a localized string to be used as the action button of the mobile push notification (for example: "OPEN" or "VIEW"). More... | |
NSString * | category |
Specifies the category of the mobile push notification, to be used by the receiving application to present appropriate action buttons (for example: "MAIL_MESSAGE"). More... | |
NSString * | format |
Specifies the text to be used with the mobile push notification (for example: "You have new mail", or "Stock value of $[1] is now $[2]", or even "Latest news: ${title} of ${time}"). More... | |
NSString * | localizedFormatKey |
localizedFormatKey Specifies the key of a localized string to be used as the text of the mobile push notification (for example: "YOU_HAVE_NEW_MAIL"). More... | |
NSArray * | arguments |
Specifies the list of arguments to be used to format the localized format string obtained from localizedFormatKey, in case it contains formatting elements. More... | |
NSDictionary * | customData |
Specifies a set of additional key-value pairs to be added to the mobile push notification, for interpretation by the application's code. More... | |
NSString * | triggerExpression |
Specifies a boolean expression that, when set, will be evaluated against each table update and will act as a trigger to deliver the mobile push notification. More... | |
The LSMPNInfo class contains the table and format specification of mobile push notifications (MPN) to be sent on the update of an MPN subscription.
The only required parameter is tableInfo, other parameters are optional and may be left to nil. Common Apple's APNS Services restrictions apply, such as maximum total length of 2 Kbytes.
Every parameter value may include references to table update fields by position, e.g.:
If the Metadata Adapter to which the table belongs is a subclass of LiteralBasedProvider (or of an equivalent class), the value may also include field references by name, e.g.:
In this case common metadata rules apply: field names are checked against the Metadata Adapter and as such they must be consistent with the schema and group specified on the LSTableInfo corresponding to the MPN subscription.
A Server-managed special value may also be referenced:
Field and special value references will be expanded to their corresponding content before mobile push notification delivery, so that the user will actually receive a human-readable notification (e.g. "Stock
value of Apple Inc. is now 100").
Objects of this class may be created and passed to LSClient on calls like activateMPN:coalescing: (LSClient), but may also be returned as part of an LSMPNSubscription by calls like inquireMPNsWithStatus: (LSClient). In this case some properties may not be restored to the value they had when the LSMPNInfo objects have been originally submitted. In particular field references may have all been transformed in positional format (e.g. "$[2]" instead of "${last_price}").
Note that instances of this class may be made unmodifiable when stored inside another object (e.g. an LSMPNSubscription instance). In this case, trying to change one of the properties causes an LSPushClientException to be raised.
For more information on the meaning and use of each parameter please refer to Apple's Local and Push Notification Programming Guide.
+ (LSMPNInfo *) mpnInfoWithTableInfo: | (LSTableInfo *) | tableInfo | |
sound: | (NSString *) | sound | |
badge: | (NSString *) | badge | |
format: | (NSString *) | format | |
Creates and returns an LSMPNInfo object with the specified parameters.
tableInfo | Contains the specification of the table to be subscribed. A copy of the object is stored internally. |
sound | Specifies the sound to be used with the mobile push notification (e.g. "Default"). |
badge | Specifies the badge to be used with the mobile push notification (e.g. "1"). If the special value "AUTO" is used, the badge will be assigned automatically (see the badge property for details). |
format | Specifies the text to be used with the mobile push notification (e.g. "You have new mail", or "Stock value of $[1] is now $[2]", or even "Latest news: ${title} of ${time}"). |
+ (LSMPNInfo *) mpnInfoWithTableInfo: | (LSTableInfo *) | tableInfo | |
sound: | (NSString *) | sound | |
badge: | (NSString *) | badge | |
localizedActionKey: | (NSString *) | localizedActionKey | |
category: | (NSString *) | category | |
localizedFormatKey: | (NSString *) | localizedFormatKey | |
arguments: | (NSArray *) | arguments | |
Creates and returns an LSMPNInfo object with the specified parameters.
tableInfo | Contains the specification of the table to be subscribed. A copy of the object is stored internally. |
sound | Specifies the sound to be used with the mobile push notification (e.g. "Default"). |
badge | Specifies the badge to be used with the mobile push notification (e.g. "1"). If the special value "AUTO" is used, the badge will be assigned automatically (see the badge property for details). |
localizedActionKey | Specifies the key of a localized string to be used as the action button of the mobile push notification (e.g. "OPEN" or "VIEW"). |
category | Specifies the category of the mobile push notification, to be used by the receiving application to present appropriate action buttons (e.g. "MAIL_MESSAGE"). Used only by devices with iOS 8 and greater. |
localizedFormatKey | Specifies the key of a localized string to be used as the text of the mobile push notification (e.g. "YOU_HAVE_NEW_MAIL"). |
arguments | Specifies the list of arguments to be used to format the localized format key, in case it contains formatting elements (e.g. "${title}" and "${time}"). |
+ (LSMPNInfo *) mpnInfoWithTableInfo: | (LSTableInfo *) | tableInfo | |
sound: | (NSString *) | sound | |
badge: | (NSString *) | badge | |
localizedActionKey: | (NSString *) | localizedActionKey | |
localizedFormatKey: | (NSString *) | localizedFormatKey | |
arguments: | (NSArray *) | arguments | |
Creates and returns an LSMPNInfo object with the specified parameters.
tableInfo | Contains the specification of the table to be subscribed. A copy of the object is stored internally. |
sound | Specifies the sound to be used with the mobile push notification (e.g. "Default"). |
badge | Specifies the badge to be used with the mobile push notification (e.g. "1"). If the special value "AUTO" is used, the badge will be assigned automatically (see the badge property for details). |
localizedActionKey | Specifies the key of a localized string to be used as the action button of the mobile push notification (e.g. "OPEN" or "VIEW"). |
localizedFormatKey | Specifies the key of a localized string to be used as the text of the mobile push notification (e.g. "YOU_HAVE_NEW_MAIL"). |
arguments | Specifies the list of arguments to be used to format the localized format key, in case it contains formatting elements (e.g. "${title}" and "${time}"). |
+ (LSMPNInfo *) mpnInfoWithTableInfo: | (LSTableInfo *) | tableInfo | |
sound: | (NSString *) | sound | |
badge: | (NSString *) | badge | |
localizedFormatKey: | (NSString *) | localizedFormatKey | |
arguments: | (NSArray *) | arguments | |
Creates and returns an LSMPNInfo object with the specified parameters.
tableInfo | Contains the specification of the table to be subscribed. A copy of the object is stored internally. |
sound | Specifies the sound to be used with the mobile push notification (e.g. "Default"). |
badge | Specifies the badge to be used with the mobile push notification (e.g. "1"). If the special value "AUTO" is used, the badge will be assigned automatically (see the badge property for details). |
localizedFormatKey | Specifies the key of a localized string to be used as the text of the mobile push notification (e.g. "YOU_HAVE_NEW_MAIL"). |
arguments | Specifies the list of arguments to be used to format the localized format key, in case it contains formatting elements (e.g. "${title}" and "${time}"). |
|
readwritenonatomiccopy |
Specifies the list of arguments to be used to format the localized format string obtained from localizedFormatKey, in case it contains formatting elements.
For example, if the localized string is "Latest news: %@ of %@", arguments could be: @[ "${title}", @"${time}" ]
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies the badge to be used with the mobile push notification (for example: "1").
If the special value "AUTO" is used, the badge will be assigned automatically as a progressive counter of all notifications originated by all MPN subscriptions with the "AUTO" value, on a per-device and per-application basis. The counter can also be reset at any time by invoking applicationMPNBadgeReset (LSClient):.
Note that the badge parameter is per-subscription, like other parameters, so an uncoordinated use between multiple MPN subscriptions may lead to conflicting numbers on the application's icon. On the other hand, using "AUTO" for all subscriptions ensures that no such conflicts may arise.
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies the category of the mobile push notification, to be used by the receiving application to present appropriate action buttons (for example: "MAIL_MESSAGE").
Note: only devices with iOS 8 or greater can make use of this property. For compatibility with devices with iOS up to 7.x use localizedActionKey. Both properties may be used at the same time.
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies the flag to signal the availability of new content to a Newsstand application (for example: "1").
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies a set of additional key-value pairs to be added to the mobile push notification, for interpretation by the application's code.
For example: @{ "channelName" : @"WorldNews1", @"subscriptionId" : @"${LS_MPN_subscription_ID}" }
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies the text to be used with the mobile push notification (for example: "You have new mail", or "Stock value of $[1] is now $[2]", or even "Latest news: ${title} of ${time}").
Cannot be used if localizedFormatKey has been supplied.
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies the launch image to be shown when opening the mobile push notification (for example: "Default@2x.png").
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies the key of a localized string to be used as the action button of the mobile push notification (for example: "OPEN" or "VIEW").
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
localizedFormatKey Specifies the key of a localized string to be used as the text of the mobile push notification (for example: "YOU_HAVE_NEW_MAIL").
Cannot be used if format has been supplied.
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies the sound to be used with the mobile push notification (for example: "Default").
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Contains the specification of the table to be subscribed.
May be an LSTableInfo or LSExtendedTableInfo.
This parameter is mandatory and must be set.
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |
|
readwritenonatomiccopy |
Specifies a boolean expression that, when set, will be evaluated against each table update and will act as a trigger to deliver the mobile push notification.
The expression must be strictly in Java syntax (not Objective-C, not Javascript, not everything else) with the addition of field references. At time of evaluation, the value of referenced fields (e.g. "${last_price}") is included as String
variables, and as such appropriate type conversion must be considered (e.g. "Double.parseDouble(${last_price}) > 500.0"). The names of these variables are composed by the prefix "LS_MPN_field" followed by an index. Thus, variable names like "LS_MPN_field1" should be considered reserved and their use avoided in the expression.
Consider potential impact on Server performance when writing trigger expressions. Since Java code may use classes and methods of the JDK, a trigger may cause CPU hogging or memory exhaustion if not well considered. For this reason, a Server-side filter may be applied to refuse poorly written (or even maliciously crafted) trigger expressions. See the Server's MPN notifier configuration file for more information.
If NO expression is set, each table update will result in a mobile push notification. If an expression IS set, a mobile push notification will result only if the expression evaluates to true
and no other successive push notifications will be sent.
The content of this property may be subject to length restrictions (see the Server's MPN database configuration for more information).
LSPushClientException | Thrown when trying to change the property if the instance has been made unmodifiable. |