Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ data class RNSPPreferencesConsent(
val channels: List<Channel>,
val changed: Boolean?,
val dateConsented: String?,
val subType: String?
val subType: String?,
val versionId: String?
): RNMappable {
data class Channel(val id: Int, val status: Boolean): RNMappable {
override fun toRN(): ReadableMap = createMap().apply {
Expand All @@ -31,6 +32,7 @@ data class RNSPPreferencesConsent(
changed?.let { putBoolean("changed", it) }
putString("dateConsented", dateConsented)
putString("subType", subType)
putString("versionId", versionId)
}
}

Expand All @@ -45,7 +47,8 @@ data class RNSPPreferencesConsent(
} ?: emptyList(),
changed = status.changed,
dateConsented = status.dateConsented?.toString(),
subType = status.subType?.toString()
subType = status.subType?.toString(),
versionId = status.versionId
)
} ?: emptyList(),
rejectedStatus = preferences.rejectedStatus?.map { status ->
Expand All @@ -56,7 +59,8 @@ data class RNSPPreferencesConsent(
} ?: emptyList(),
changed = status.changed,
dateConsented = status.dateConsented?.toString(),
subType = status.subType?.toString()
subType = status.subType?.toString(),
versionId = status.versionId
)
} ?: emptyList()
)
Expand Down
2 changes: 2 additions & 0 deletions ios/RNSPUserData/RNSPPreferencesConsent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ struct RNSPPreferencesConsent: Encodable {
let changed: Bool?
let dateConsented: SPDate?
let subType: SubType?
let versionId: String?
}

struct Channel: Encodable {
Expand Down Expand Up @@ -42,6 +43,7 @@ extension RNSPPreferencesConsent.Status {
changed = status.changed
dateConsented = status.dateConsented
subType = status.subType.flatMap { RNSPPreferencesConsent.SubType(from: $0) }
versionId = status.versionId
}
}

Expand Down
1 change: 1 addition & 0 deletions src/NativeReactNativeCmp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export type PreferencesStatus = {
changed?: boolean;
dateConsented?: string;
subType?: PreferencesSubType;
versionId?: string;
};

export type PreferencesConsent = {
Expand Down
Loading