Skip to content

Commit

Permalink
Merge pull request #79 from qonversion/feature/sc-35316/tenjin
Browse files Browse the repository at this point in the history
Tenjin integration
  • Loading branch information
SpertsyanKM authored Oct 16, 2024
2 parents 3ef223e + f539386 commit 7b3bbae
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sdk/src/UserPropertiesBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ export class UserPropertiesBuilder {
return this;
}

/**
* Set Tenjin analytics installation id.
* @param id Tenjin analytics installation id
* @return builder instance for chain calls
*/
setTenjinAnalyticsInstallationId(id: string): UserPropertiesBuilder {
this.properties[UserPropertyKey.TenjinAnalyticsInstallationId] = id;
return this;
}

/**
* Set a user property with a custom key different from defined ones.
*
Expand Down
12 changes: 12 additions & 0 deletions sdk/src/__tests__/UserPropertiesBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ describe('UserPropertiesBuilder tests', () => {
expect(builder['properties']).toStrictEqual(expProperties);
});

test('set Tenjin analytics installation id', () => {
// given
const id = "test Tenjin analytics installation id";
const expProperties = {'_q_tenjin_aiid': id};

// when
builder.setTenjinAnalyticsInstallationId(id);

// then
expect(builder['properties']).toStrictEqual(expProperties);
});

test('set custom user property', () => {
// given
const key = "test key";
Expand Down
1 change: 1 addition & 0 deletions sdk/src/dto/UserPropertyKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export enum UserPropertyKey {
AppMetricaUserProfileId = "_q_appmetrica_user_profile_id",
PushWooshHwId = "_q_pushwoosh_hwid",
PushWooshUserId = "_q_pushwoosh_user_id",
TenjinAnalyticsInstallationId = "_q_tenjin_aiid",
Custom = "",
}

0 comments on commit 7b3bbae

Please sign in to comment.