Recommand · October 14, 2021 0

getting A client attempted to write unauthorized attribute while using Amplify flutter on iOS ONLY

hi im getting A client attempted to write unauthorized attribute while using Amplify flutter on iOS only,
it works on android devices

here is my code

try {
      Map<String, String> userAttributes = {
        'email': email,
        "custom:accType": "User",
        "given_name": givenName,
        "custom:department": department
        // additional attributes as needed
      };
      await Amplify.Auth.signUp(
          username: data.name,
          password: data.password,
          options: CognitoSignUpOptions(userAttributes: userAttributes));}

and here is the attributes set in the user pool
and here is the attributes set in the user pool

i dont understand why it throws an error in iOS but works completely fine in android, if someone knows why please let me know. Thank you!!