HBTSNotification

@interface HBTSNotification : NSObject

HBTSNotification represents a notification for TypeStatus to display. To post the notification to be displayed, pass it to -[HBTSProvider showNotification:].

  • Initialises and returns an HBTSNotification with the type, sender, and icon name already set.

    See

    statusBarIconName

    Declaration

    Objective-C

    - (nonnull instancetype)initWithType:(HBTSMessageType)type
                                  sender:(nonnull NSString *)sender
                                iconName:(nonnull NSString *)iconName;

    Swift

    init(type: HBTSMessageType, sender: String, iconName: String)

    Parameters

    type

    The type of notification. This is used to determine the content string to use.

    sender

    The name of the sending person.

    iconName

    The icon to display in the status bar. Refer to statusBarIconName.

    Return Value

    A configured instance of HBTSNotification.

  • Initialises and returns an HBTSNotification with the provided serialized notification dictionary.

    Used by TypeStatus when internally deserializing a notification to be displayed.

    See

    dictionaryRepresentation

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDictionary:
        (nonnull NSDictionary<NSString *, id> *)dictionary;

    Swift

    init(dictionary: [String : Any])

    Parameters

    dictionary

    The serialized notification dictionary.

    Return Value

    An instance of HBTSNotification populated with the deserialized parameters.

  • Serializes the notification into a dictionary.

    Used by TypeStatus Plus internally to prepare the notification to be sent to other processes.

    See

    initWithDictionary:

    Declaration

    Objective-C

    - (nonnull NSDictionary<NSString *, id> *)dictionaryRepresentation;

    Swift

    func dictionaryRepresentation() -> [String : Any]
  • The bundle identifier of the app this notification originates from, or nil to have this property automatically determined by TypeStatus based on the provider’s matching app identifier.

    See

    -[HBTSProvider appIdentifier]

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *sourceBundleID;

    Swift

    var sourceBundleID: String? { get set }
  • The content of the notification, to be displayed to the user.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *content;

    Swift

    var content: String? { get set }
  • The portion of the content that should be displayed in bold font. This is usually the name of the sending person.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSRange boldRange;

    Swift

    var boldRange: NSRange { get set }
  • The date the notification originated. Displayed in Notification Center bulletins.

    The default value is the timestamp of when the HBTSNotification was initialised. Notifications with a date more than a minute in the past will be ignored to avoid confusing the user, and to prevent many old notifications appearing at once when the device regains an internet connection.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSDate *_Nonnull date;

    Swift

    var date: Date { get set }
  • The icon to display in the status bar, or nil to not display an icon.

    The icon must be installed to /System/Library/Frameworks/UIKit.framework.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *statusBarIconName;

    Swift

    var statusBarIconName: String? { get set }
  • A URL to open when the user taps the notification, or nil to launch the app indicated by the sourceBundleID property.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSURL *actionURL;

    Swift

    var actionURL: URL? { get set }