createToken method

Future<bool> createToken(
  1. DeviceNotificationToken deviceNotificationToken
)

Creates a notification token for the device.

Parameters:

Returns:

  • A Future that resolves to a boolean indicating the success of the operation.

Implementation

Future<bool> createToken(
  DeviceNotificationToken deviceNotificationToken,
) async {
  return dio
      .post(
        "/create-token",
        data: deviceNotificationToken.toJSON(),
      )
      .then(
        (response) => response.data,
      );
}