Skip to content

Commit b3c2a16

Browse files
authored
Merge pull request #793 from immutable/feat/sdk-489-lock-audience-library-version
fix(audience): lock context.libraryVersion to the SDK version
2 parents e5e9ec6 + 770e22d commit b3c2a16

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

examples/audience/Assets/SampleApp/Scripts/AudienceSample.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ private static Dictionary<string, object> BuildConfigEcho(AudienceConfig config)
368368
["enableMobileAttribution"] = config.EnableMobileAttribution,
369369
["flushIntervalSeconds"] = config.FlushIntervalSeconds,
370370
["flushSize"] = config.FlushSize,
371-
["packageVersion"] = config.PackageVersion,
372371
["shutdownFlushTimeoutMs"] = config.ShutdownFlushTimeoutMs,
373372
};
374373
if (!string.IsNullOrEmpty(config.PublishableKey))

src/Packages/Audience/Runtime/AudienceConfig.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ public class AudienceConfig
116116
/// </summary>
117117
public string? PersistentDataPath { get; set; }
118118

119-
/// <summary>
120-
/// Library version sent on every message.
121-
/// </summary>
122-
public string PackageVersion { get; set; } = Constants.LibraryVersion;
123-
124119
/// <summary>
125120
/// Maximum time <see cref="ImmutableAudience.Shutdown"/> waits for
126121
/// the final flush, in milliseconds.

src/Packages/Audience/Runtime/ImmutableAudience.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public static void Track(IEvent evt)
330330
var anonymousId = Identity.GetOrCreate(config.PersistentDataPath!, state.Level);
331331
// ToProperties returns a fresh dict per call, so no snapshot needed.
332332
var userId = state.Level == ConsentLevel.Full ? state.UserId : null;
333-
var msg = MessageBuilder.Track(eventName, anonymousId, userId, config.PackageVersion, properties, config.TestMode);
333+
var msg = MessageBuilder.Track(eventName, anonymousId, userId, Constants.LibraryVersion, properties, config.TestMode);
334334
EnqueueTrack(msg);
335335
}
336336

@@ -356,7 +356,7 @@ public static void Track(string eventName, Dictionary<string, object>? propertie
356356

357357
var anonymousId = Identity.GetOrCreate(config.PersistentDataPath!, state.Level);
358358
var userId = state.Level == ConsentLevel.Full ? state.UserId : null;
359-
var msg = MessageBuilder.Track(eventName, anonymousId, userId, config.PackageVersion,
359+
var msg = MessageBuilder.Track(eventName, anonymousId, userId, Constants.LibraryVersion,
360360
SnapshotCallerDict(properties), config.TestMode);
361361
EnqueueTrack(msg);
362362
}
@@ -403,7 +403,7 @@ public static void Identify(string userId, IdentityType identityType, Dictionary
403403

404404
var anonymousId = Identity.GetOrCreate(config.PersistentDataPath!, level);
405405
var msg = MessageBuilder.Identify(anonymousId, userId, identityType.ToLowercaseString(),
406-
config.PackageVersion, SnapshotCallerDict(traits), config.TestMode);
406+
Constants.LibraryVersion, SnapshotCallerDict(traits), config.TestMode);
407407
EnqueueIdentity(msg);
408408
}
409409

@@ -434,7 +434,7 @@ public static void Alias(string fromId, IdentityType fromType, string toId, Iden
434434
if (config == null) return;
435435

436436
var msg = MessageBuilder.Alias(fromId, fromType.ToLowercaseString(), toId, toType.ToLowercaseString(),
437-
config.PackageVersion, config.TestMode);
437+
Constants.LibraryVersion, config.TestMode);
438438
EnqueueIdentity(msg);
439439
}
440440

0 commit comments

Comments
 (0)