SendingNetwork
  • OVERVIEW
    • Getting Started
    • FAQs
  • Network Instructional Articles
    • Basics
      • Introducing the Edge, WatchDog, and Guardian Nodes
      • Overview
      • Messaging Solution
      • Privacy Solution
      • Rich Communication Solution
      • Multi-Platform Solution
      • Decentralized Identity
      • Multiple Chat Modes
      • How It Works
      • Token Utility
      • The Team
    • Key Concepts
      • Decentralized Identity
      • Social Graphs
      • Edge Node
  • SDK Documentation
    • Glossary
    • JavaScript client SDK
      • DID
      • User
      • Message
      • Room
      • Contact
      • Social Graph
    • iOS client SDK
      • Push
      • DID
      • User
      • Message
      • Room
      • Contact
    • Android client SDK
      • User
      • Room
    • Java SDK
      • DID
      • Room
      • Message
    • Node.js SDK
      • DID
      • Room
      • Message
    • Unreal SDK
      • DID
      • User
      • Message
      • Room
    • Unity SDK
      • DID
      • Room
      • Message
    • Website chat widget SDK
      • Customization
      • DID
      • User
      • Room
      • Message
      • Other
    • Bot SDKs
      • Golang Bot SDK
        • DID
        • User
        • Room
        • Message
    • Extensible Message Interface
    • Push Notifications
    • Flutter SDK
      • DID
      • User
      • Message
      • Room
    • PHP SDK
      • DID
      • Room
      • User
    • Developer Key
  • Acquisition Kit
    • Social Boost Development Instructions
  • WatchDog Agent
    • WatchDog Agent Guide
    • WatchDog Agent Deployment Tutorial
      • Linux Deployment Tutorial
    • One-Click Deployment
  • Edge Node
    • Edge Node Deployment Tutorial
    • VPS Setup Guide
      • Google Cloud Platform (GCP)
      • Amazon Web Services (AWS)
      • Contabo
    • Check Node Stats with Auto-Reply Bot in SendingMe App
    • Alpha-3 Testnet FAQs
  • delegation node
    • Delegation Node Deployment Tutorial
  • Private Delegation Node
  • Use Cases
    • Wallet-to-Wallet Messaging
    • Dapp Notifications
    • Identity Verification
    • Gamer Acquisition
    • Cross-platform Trading
Powered by GitBook
On this page
  • Update the pusher for this device on the SDN node.
  • Update the pusher for this device on the node
  • Get all currently active pushers for the authenticated user
  • Get all push notifications rules
  • Enable/Disable a push notification rule
  • Remove a push notification rule
  • Create a new push rule
  • Update push rule actions
  1. SDK Documentation
  2. iOS client SDK

Push

Update the pusher for this device on the SDN node.

- (MXHTTPOperation*)setPusherWithPushkey:(NSString *)pushkey
                                    kind:(NSObject *)kind
                                   appId:(NSString *)appId
                          appDisplayName:(NSString *)appDisplayName
                       deviceDisplayName:(NSString *)deviceDisplayName
                              profileTag:(NSString *)profileTag
                                    lang:(NSString *)lang
                                    data:(NSDictionary *)data
                                  append:(BOOL)append
                                 success:(void (^)(void))success
                                 failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters:

Name
Type
Description
Required

pushkey

NSString

The pushkey for this pusher. This should be the APNS token formatted as required for your push gateway (base64 is the recommended formatting).

True

kind

NSString

The kind of pusher your push gateway requires. Generally 'http', or an NSNull to disable the pusher.

false

appId

NSString

The app ID of this application as required by your push gateway.

True

appDisplayName

NSString

A human readable display name for this app.

True

deviceDisplayName

NSString

A human readable display name for this device.

True

profileTag

NSString

The profile tag for this device. Identifies this device in push rules.

True

lang

NSString

The user's preferred language for push, eg. 'en' or 'en-US'

True

data

NSDictionary

Dictionary of data as required by your push gateway (generally the notification URI and aps-environment for APNS).

True

append

BOOL

If true, the node should add another pusher with the given pushkey and App ID in addition to any others with different user IDs.

True

Output Parameters:

Name
Type
Description
Required

success

block

A block object called when the operation succeeds. It provides credentials to use to create a MXRestClient.

true

failure

block

A block object called when the operation fails.

true

Update the pusher for this device on the node

- (MXHTTPOperation*)setPusherWithPushkey:(NSString *)pushkey
                                    kind:(NSObject *)kind
                                   appId:(NSString *)appId
                          appDisplayName:(NSString *)appDisplayName
                       deviceDisplayName:(NSString *)deviceDisplayName
                              profileTag:(NSString *)profileTag
                                    lang:(NSString *)lang
                                    data:(NSDictionary *)data
                                  append:(BOOL)append
                                 enabled:(BOOL)enabled
                                 success:(void (^)(void))success
                                 failure:(void (^)(NSError *))failure NS_REFINED_FOR_SWIFT;

Input Parameters:

Name
Type
Description
Required

pushkey

NSString

The pushkey for this pusher. This should be the APNS token formatted as required for your push gateway (base64 is the recommended formatting).

True

kind

NSString

The kind of pusher your push gateway requires. Generally 'http', or an NSNull to disable the pusher.

false

appId

NSString

The app ID of this application as required by your push gateway.

True

appDisplayName

NSString

A human readable display name for this app.

True

deviceDisplayName

NSString

A human readable display name for this device.

True

profileTag

NSString

The profile tag for this device. Identifies this device in push rules.

True

lang

NSString

The user's preferred language for push, eg. 'en' or 'en-US'

True

data

NSDictionary

Dictionary of data as required by your push gateway (generally the notification URI and aps-environment for APNS).

True

append

BOOL

If true, the node should add another pusher with the given pushkey and App ID in addition to any others with different user IDs.

True

enabled

BOOL

Whether the pusher should actively create push notifications

True

Output Parameters:

Name
Type
Description
Required

success

block

A block object called when the operation succeeds. It provides credentials to use to create a MXRestClient.

true

failure

block

A block object called when the operation fails.

true

Get all currently active pushers for the authenticated user

- (MXHTTPOperation*)pushers:(void (^)(NSArray<MXPusher *> *pushers))success
                    failure:(void (^)(NSError *))failure NS_REFINED_FOR_SWIFT;

Input Parameters:None

Output Parameters:

Name
Type
Description
Required

success

block

A block object called when the operation succeeds

true

failure

block

A block object called when the operation fails.

true

Get all push notifications rules

- (MXHTTPOperation*)pushRules:(void (^)(MXPushRulesResponse *pushRules))success
                      failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters: None

Output Parameters:

Name
Type
Description
Required

success

NSString

A block object called when the operation succeeds

true

failure

NSString

A block object called when the operation fails.

true

Enable/Disable a push notification rule

- (MXHTTPOperation *)enablePushRule:(NSString*)ruleId
                              scope:(NSString*)scope
                               kind:(MXPushRuleKind)kind
                             enable:(BOOL)enable
                            success:(void (^)(void))success
                            failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters:

Name
Type
Description
Required

ruleId

NSString

The identifier for the rule.

True

scope

NSString

Either 'global' or 'device/<profile_tag>' to specify global rules or device rules for the given profile_tag.

false

kind

MXPushRuleKind

The kind of rule, ie. 'override', 'underride', 'sender', 'room', 'content' (see MXPushRuleKind).

True

enable

NSString

YES to enable

True

/**
 Push rules kind.
 
 Push rules are separated into different kinds of rules. These categories have a priority order: verride rules
 have the highest priority.
 Some category may define implicit conditions.
 */
typedef enum : NSUInteger
{
    MXPushRuleKindOverride,
    MXPushRuleKindContent,
    MXPushRuleKindRoom,
    MXPushRuleKindSender,
    MXPushRuleKindUnderride
} MXPushRuleKind NS_REFINED_FOR_SWIFT;

Output Parameters:

Name
Type
Description
Required

success

block

A block object called when the operation succeeds

true

failure

block

A block object called when the operation fails.

true

Remove a push notification rule

- (MXHTTPOperation *)removePushRule:(NSString*)ruleId
                              scope:(NSString*)scope
                               kind:(MXPushRuleKind)kind
                            success:(void (^)(void))success
                            failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters:

Name
Type
Description
Required

ruleId

NSString

The identifier for the rule.

True

scope

NSString

Either 'global' or 'device/<profile_tag>' to specify global rules or device rules for the given profile_tag.

false

kind

MXPushRuleKind

The kind of rule, ie. 'override', 'underride', 'sender', 'room', 'content' (see MXPushRuleKind).

True

Output Parameters:

Name
Type
Description
Required

success

block

A block object called when the operation succeeds

true

failure

block

A block object called when the operation fails.

true

Create a new push rule

- (MXHTTPOperation *)addPushRule:(NSString*)ruleId
                           scope:(NSString*)scope
                            kind:(MXPushRuleKind)kind
                         actions:(NSArray*)actions
                         pattern:(NSString*)pattern
                      conditions:(NSArray<NSDictionary *> *)conditions
                         success:(void (^)(void))success
                         failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters:

Name
Type
Description
Required

ruleId

NSString

The identifier for the rule (it depends on rule kind: user id for sender rule, room id for room rule...).

True

scope

NSString

Either 'global' or 'device/<profile_tag>' to specify global rules or device rules for the given profile_tag.

false

kind

MXPushRuleKind

The kind of rule, ie. 'sender', 'room' or 'content' (see MXPushRuleKind).

True

actions

NSArray

The rule actions: notify, don't notify, set tweak...

True

pattern

NSString

The pattern relevant for content rule.

True

conditions

NSArray

The conditions relevant for override and underride rule.

True

Output Parameters:

Name
Type
Description
Required

success

block

A block object called when the operation succeeds

true

failure

block

A block object called when the operation fails.

true

Update push rule actions

- (MXHTTPOperation *)updateActionsForPushRule:(NSString*)ruleId
                                        scope:(NSString*)scope
                                         kind:(MXPushRuleKind)kind
                                      actions:(NSArray*)actions
                                      success:(void (^)(void))success
                                      failure:(void (^)(NSError *error))failure;

Input Parameters:

Name
Type
Description
Required

ruleId

NSString

The identifier for the rule (it depends on rule kind: user id for sender rule, room id for room rule...).

True

scope

NSString

Either 'global' or 'device/<profile_tag>' to specify global rules or device rules for the given profile_tag.

false

kind

MXPushRuleKind

The kind of rule, ie. 'sender', 'room' or 'content' (see MXPushRuleKind).

True

actions

NSArray

The rule actions: notify, don't notify, set tweak...

True

Output Parameters:

Name
Type
Description
Required

success

block

A block object called when the operation succeeds

true

failure

block

A block object called when the operation fails.

true

PreviousiOS client SDKNextDID

Last updated 1 year ago