NSubscription Class Reference

Inherits from NeuraAPIObject : NSObject
Declared in NSubscription.h

Overview

An object representing a subscription to an event.

  eventName

The name of the related Neura event.

@property (nonnull, nonatomic, readonly) NSString *eventName

Discussion

The name of the related Neura event.

Declared In

NSubscription.h

  identifier

A unique identifier for this specific subscription. Note: You can have one or more subscriptions to the same event. Each subscription must have a different unique identifier.

@property (nonnull, nonatomic, readonly) NSString *identifier

Discussion

A unique identifier for this specific subscription. Note: You can have one or more subscriptions to the same event. Each subscription must have a different unique identifier.

Declared In

NSubscription.h

  webhookId

(optional) The identifier of the related webhook.

@property (nullable, nonatomic, readonly) NSString *webhookId

Discussion

(optional) The identifier of the related webhook.

Declared In

NSubscription.h

  createdAt

The time of creation of the subscription.

@property (nonnull, nonatomic, readonly) NSString *createdAt

Discussion

The time of creation of the subscription.

Declared In

NSubscription.h

  metadata

Meta data related to the subscription.

@property (nonnull, nonatomic, readonly) NSDictionary *metadata

Discussion

Meta data related to the subscription.

Declared In

NSubscription.h

  method

The method of the subscription.

@property (nonnull, nonatomic, readonly) NSString *method

Discussion

The method of the subscription.

  • webhook: Event sent to a webhook implemented on the developer’s server. A webhook identifier must be provided.
  • push: Event sent to client using mutable-content messages (supported only by iOS 10 and up).
  • all: Event sent with both methods: to the webhook and by a mutable content message to the client.
  • braze: Neura’s server sends the Moment identified to your Braze endpoint as defined on the developer console
  • sfmc: Neura’s server sends the Moment identified to your Salesforce Marketing Cloud endpoint as defined on the developer console.

Declared In

NSubscription.h

  neuraId

The related unique Neura identifier.

@property (nullable, nonatomic, readonly) NSString *neuraId

Discussion

The related unique Neura identifier.

Declared In

NSubscription.h

  state

Enabled / disabled state.

@property (nullable, nonatomic, readonly) NSString *state

Discussion

Enabled / disabled state.

Declared In

NSubscription.h

– initWithEventName:identifier:webhookId:method:

Init subscription with provided identifier and webhook id.

- (nonnull instancetype)initWithEventName:(nonnull NSString *)eventName identifier:(nonnull NSString *)identifier webhookId:(nullable NSString *)webhookId method:(NSubscriptionMethod)method

Parameters

eventName

The name of the event the subscription is related to.

identifier

The identifier of the subscription.

webhookId

A related webhook identifier.

method

Determines where the notification will come from: Whether from the webhook or the server or both

Return Value

A new subscription object instance.

Discussion

Init subscription with provided identifier and webhook id.

Declared In

NSubscription.h

– initWithEventName:webhookId:

Init subscription with the webhook method (with provided webhook id).

- (nonnull instancetype)initWithEventName:(nonnull NSString *)eventName webhookId:(nullable NSString *)webhookId

Parameters

eventName

The name of the event the subscription is related to.

webhookId

A related webhook identifier.

Return Value

A new subscription object instance.

Discussion

Init subscription with the webhook method (with provided webhook id).

This call is equivelant to initWithEventName:identifier:webhookId:method: where the identifier is set to be the event name with an underscore as a prefix and the method is webhook.

Declared In

NSubscription.h

– initWithEvenName:forPushWithIdentifier:

Init subscription with the push method (with provided subscription id).

- (nonnull instancetype)initWithEvenName:(nonnull NSString *)eventName forPushWithIdentifier:(nonnull NSString *)identifier

Parameters

eventName

The name of the event the subscription is related to.

identifier

The identifier of the subscription.

Return Value

A new subscription object instance.

Discussion

Init subscription with the push method (with provided subscription id).

This call is equivelant to initWithEventName:identifier:webhookId:method: where the method is push and webhookId is nil.

Declared In

NSubscription.h

– params

Returns the set properties of this object as a dictionary.

- (nonnull NSDictionary *)params

Return Value

NSDictionary with the set values of this object.

Discussion

Returns the set properties of this object as a dictionary.

Declared In

NSubscription.h