setDeliverForThisRoom function

Future setDeliverForThisRoom(
  1. String roomId,
  2. String token
)

Implementation

@pragma('vm:entry-point')
Future setDeliverForThisRoom(String roomId, String token) async {
  final baseUrl = VAppPref.getStringOrNullKey("vBaseUrl");
  final res = await patch(
    Uri.parse(
      "$baseUrl/channel/$roomId/deliver",
    ),
    headers: {
      'authorization': "Bearer $token",
      "clint-version": "2.0.0",
      "Accept-Language": "en"
    },
  );
  if (res.statusCode != 200) {
    throw "cant deliver the message status in background for ${VPlatforms.currentPlatform}";
  }
}