Account Management APIs

更新时间:
复制 MD 格式

This document describes how to use the account management APIs to bind accounts to and unbind them from devices.

Bind an account

Bind an in-app account to a push device. This lets you send messages to the device by targeting the account.

Note
  • The account name can be up to 64 bytes long.

  • A device can be bound to only one account. An account can be bound to multiple devices.

  • To change the account bound to a device, simply call the bind API. The new account automatically overwrites the previous one. You do not need to unbind the previous account first. This prevents concurrency issues that can arise from frequent operations.

API definition

+ (void)bindAccount:(NSString *)account
       withCallback:(CallbackHandler)callback;

Parameters

Parameter

Type

Required

Description

account

NSString

Yes

The name of the account to bind.

callback

Block

No

The callback after the operation is complete.

Unbind an account

Unbind an account to remove its association with the push channel.

API definition

+ (void)unbindAccount:(CallbackHandler)callback;

Parameters

Parameter

Type

Required

Description

callback

Block

No

The callback after the operation is complete.