createUID2ExtraMap method

Map? createUID2ExtraMap({
  1. String? subscriptionID,
  2. String? serverPublicKey,
  3. String? email,
  4. String? emailHash,
  5. String? phone,
  6. String? phoneHash,
  7. String? appName,
  8. String? customURLString,
  9. bool isTestMode = false,
})

Implementation

Map? createUID2ExtraMap({
  String? subscriptionID,
  String? serverPublicKey,
  String? email,
  String? emailHash,
  String? phone,
  String? phoneHash,
  String? appName,
  String? customURLString,
  bool isTestMode = false,
}) {
  Map extraMap = {};
  if (subscriptionID != null)
  {
    extraMap['subscriptionID'] = subscriptionID;
  }
  else
  {
    print("---UID2ExtraMap.subscriptionID can not be null ---");
    return null;
  }
  if (serverPublicKey != null)
  {
    extraMap['serverPublicKey'] = serverPublicKey;
  }
  else
  {
    print("---UID2ExtraMap.serverPublicKey can not be null ---");
    return null;
  }
  if(email == null && emailHash == null && phone == null && phoneHash == null)
  {
    print("---UID2ExtraMap email,emailHash,phone,phoneHash set at least one---");
    return null;
  }
  if (email != null)
  {
    extraMap['email'] = email;
  }
  if (emailHash != null)
  {
    extraMap['emailHash'] = emailHash;
  }
  if (phone != null)
  {
    extraMap['phone'] = phone;
  }
  if (phoneHash != null)
  {
    extraMap['phoneHash'] = phoneHash;
  }
  if (appName != null)
  {
    extraMap['appName'] = appName;
  }
  extraMap['isTestMode'] = isTestMode;
  if (customURLString != null)
  {
    extraMap['customURLString'] = customURLString;
  }
  return extraMap;
}