GetDutchie / datadog_flutter

**This community package has been deprecated in favor of Datadog's official SDK**
https://github.com/DataDog/dd-sdk-flutter
MIT License
24 stars 24 forks source link

`setUserInfo` `extraInfo` is not working on iOS. #84

Closed dominic-cot closed 2 years ago

dominic-cot commented 2 years ago

We are using extraInfo to provide information such as region to datadog, to be available for all logs.

This is working fine on Android, but on iOS the information is not appearing in the log.

id is working, it is just the information in extraInfo that is missing.

Our code looks something like this:

  await DatadogFlutter.setUserInfo(
      id: identity.id.toString(),
      extraInfo: {
        'property`': value1,
        'property2': value2.toString(),
        'property3': value3.name
      });

Update

Looked into this a bit more, and have found the issue.

     case "setUserInfo":
        let attributes = encodeAttributes(args?["attributes"] as? String)
        Datadog.setUserInfo(
          id: args?["id"] as? String,
          name: args?["name"] as? String,
          email: args?["email"] as? String,
          extraInfo: attributes ?? [AttributeKey : AttributeValue]()
        )
        result(true)

Trying to get the extraInfo argument using the attributes key. Happy to create a PR to fix this if it would help?

tshedor commented 2 years ago

@dominic-cot a PR would be great, thanks

dominic-cot commented 2 years ago

@tshedor - https://github.com/GetDutchie/datadog_flutter/pull/86

tshedor commented 2 years ago

Released in 1.7.0; thanks @dominic-cot