Table of Contents

DeleteObjectAsync

Methods
public StorageOperation DeleteObjectAsync(StorageObjectId objectId, CancellationToken cancellationToken = default)

Deletes a storage object from cloud storage.

Parameters
Type Name Description
StorageObjectId objectId

Identifier of the storage object to delete.

CancellationToken cancellationToken

Used to cancel the operation.

Returns
Type Description
StorageOperation

The status of the asynchronous operation.

Remarks

If no storage object with the specified identifier exists, the returned StorageOperation's IsCompletedSuccessfully is set to true, but no storage object will be modified.

Examples
using Coherence.Toolkit;
using UnityEngine;

class CloudStorageDelete : MonoBehaviour
{
    public CoherenceBridge bridge = null!;

    void Start()
    {
        var cloudStorage = bridge.CloudService.GameServices.CloudStorage;
        cloudStorage.DeleteObjectAsync(("type", "id"))
            .OnFail(Debug.LogWarning)
            .OnSuccess(() => Debug.Log("Deleted"));
    }
}
Exceptions
Type Condition
StorageException

When not logged in, StorageErrorType is set to NotLoggedIn.