generateRequestUrl method

Future<Uri> generateRequestUrl(
  1. Iterable<PhoneNumber> to,
  2. Message message,
  3. bool isChineseMainland
)

Generates the request url.

Implementation

Future<Uri> generateRequestUrl(
    Iterable<PhoneNumber> to, Message message, bool isChineseMainland) async {
  final queryParameters = <String, String>{
    if (isChineseMainland && projectId != null) 'g': projectId!,
    'm': to.map((e) => generatePhoneNumber(e, isChineseMainland)).join(','),
    'c': await message.toText(this),
    'u': username,
    'p': authorization,
  };
  final path = generatePath(isChineseMainland);

  // Return the request url.
  return Uri.https(endpoint, path, queryParameters);
}