Giter Club home page Giter Club logo

Comments (4)

x401om avatar x401om commented on May 29, 2024

Hi, @otopba! As I understood the issue right, you are making something like this:

  1. Adding ten custom attributes:
        var builder = ProfileParameterBuilder()
        builder = builder.withCustomAttributes(
            [
                "key_1": "value_1",
                "key_2": "value_2",
                "key_3": "value_3",
                "key_4": "value_4",
                "key_5": "value_5",
                "key_6": "value_6",
                "key_7": "value_7",
                "key_8": "value_8",
                "key_9": "value_9",
                "key_10": "value_10",
            ]
        )

        Adapty.updateProfile(params: builder)
  1. Trying to update one of them:
var builder = ProfileParameterBuilder()
        builder = builder.withCustomAttributes(
            [
                "key_1": "value_1001",
            ]
        )

        Adapty.updateProfile(params: builder)
  1. Getting the error:
Error Domain=com.adapty.AdaptySDK Code=400 "Status: invalid. Details: Maximum of 10 attributes for the profile" UserInfo={NSLocalizedDescription=Status: invalid. Details: Maximum of 10 attributes for the profile}

I tested this with my environment and actually everything is fine. The value for the key_1 was overwritten without any error. But if you already have ten custom attributes, trying to add one more will cause the mentioned issue.
If the issue is exactly as I described in the above steps, could you please enable verbose logging provide all the logs from the Adapty SDK?

from adaptysdk-flutter.

otopba avatar otopba commented on May 29, 2024

@x401om
Hi!
Almost like this, I do the following:

        var builder = ProfileParameterBuilder()
        builder = builder.withCustomAttributes(
            [
                "key_1": "value_1",
                "key_2": "value_2",
                "key_3": "value_3",
                "key_4": "value_4",
                "key_5": "value_5",
                "key_6": "value_6",
                "key_7": "value_7",
                "key_8": "value_8",
                "key_9": "value_9",
                "key_10": "value_10",
            ]
        )

        Adapty.updateProfile(params: builder)

Trying to update like this:

        var builder = ProfileParameterBuilder()
        builder = builder.withCustomAttributes(
            [
                "key_1": "value_1",
                "key_2": "value_2",
                "key_3": "value_3",
                "key_4": "value_4",
                "key_5": "value_5",
                "key_6": "value_6",
                "key_7": "value_7",
                "key_8": "value_8",
                "key_9": "value_9",
                "key_11": "value_11",
            ]
        )

        Adapty.updateProfile(params: builder)

Note the last value

from adaptysdk-flutter.

x401om avatar x401om commented on May 29, 2024

@otopba
I see what the problem is. You are trying to create a new key_11, but nothing happens to the old key_10, so the system thinks you have reached the attribute limit. At the moment we don't have a special method for removing attributes, but you can pass an empty string instead of the value of the attribute you want to remove. Hope this helps.

We'll think about how to make it clearer to remove custom attributes.

from adaptysdk-flutter.

otopba avatar otopba commented on May 29, 2024

@x401om

Yes, I understand. But it looks like a problem. It turns out I need to know which keys I'll ever use. And to clear all of them. That's very inconvenient.

I think it is enough to make a method not to update the keys, but to overwrite the keys

from adaptysdk-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.