android-branch-deep-linking-attribution icon indicating copy to clipboard operation
android-branch-deep-linking-attribution copied to clipboard

addCustomMetadata accepts only strings, but on iOS you can add any serializable there

Open vdugnist opened this issue 6 years ago • 3 comments

I have a production iOS app with branch SKD which has this data format:

  "user": {
    "name": "Alice",
    "id": "386d129e-1c7f-4f81-abf0-78da2e6963cb",
    "gender": "FEMALE"
  }

Builder looks like:

let buo = BranchUniversalObject(title: inviteText)
buo.contentMetadata.customMetadata["user"] = CurrentProfile.shared.partner!.toJSON()

.toJSON() method returns [Stirng: Any].

With Android SDK you can only set string to customMetadata object, which makes supporting working iOS app impossible.

public ContentMetadata addCustomMetadata(String key, String value) {
    customMetadata.put(key, value);
    return this;
}

I can publish an update to iOS app which will convert user JSON to string before setting it to customMetadata, but can you please add consistency to this API between iOS and Android?

vdugnist avatar Sep 09 '19 15:09 vdugnist

Investigating.

apeterson-branch avatar Oct 14 '19 16:10 apeterson-branch

Logged Ticket #SDK-583

Note that this may not be working as you expect on iOS. Could you confirm that the JSON data is making it to the dashboard?

apeterson-branch avatar Oct 14 '19 19:10 apeterson-branch

Sure. Where can I check it? On iOS I received "user" as a dictionary, so it works as I expected.

vdugnist avatar Oct 16 '19 10:10 vdugnist