createPostbox
API with a valid unique identifier. This unique identifier should be saved in consuming apps, as it is required for all other relay API methods. ownershipProofToken
must be provided to the API, this can be obtained via the SudoProfiles getOwnershipProof API using an audience of sudoplatform.relay.postbox
.createPostbox(withConnectionId:ownershipProofToken:)
.withConnectionId
is non-optional and expects a valid v4 UUID. ownershipProofToken
is a token attesting the ownership of the Sudo by the user.createPostbox
does not return anything, but an error will be thrown if the postbox creation was unsuccessful. If an error occurs, the error.localizedDescription
can be presented to the user to notify them as to what caused the error.createPostbox
method as shown below:createPostbox
does not return anything, but an exception will be thrown if the postbox creation was unsuccessful. If an exception occurs, the e.localizedMessage
can be presented to the user to notify them as to what caused the exception.deletePostbox
API.deletePostbox(withConnectionId:)
.deletePostbox
method as shown below:deletePostbox
does not return anything, but an exception will be thrown if the postbox deletion was unsuccessful. If an exception occurs, the e.localizedMessage
can be presented to the user to notify them as to what caused the exception.subscribeToPostboxDeleted(withConnectionId:)
.subscribeToRelayEvents
method. You must pass an identifier of the subscription and an instance of a class that implements the DIRelayEventSubscriber
interface. This class will be notified of incoming messages, postbox deletion request updates, and any changes in the status of the subscription.subscribeToRelayEvents
method as so:DIRelayEventSubscriber
interface.unsubscribeToRelayEvents
or unsubscribeAll
method. For example:listPostboxesForSudoId
or listPostboxes
API can be used.listPostboxes(withSudoId:)
.listPostboxesForSudoId
method as shown below: