Skip to content

Commit 78c86de

Browse files
committed
fix: code review comments
- Updated `getSession` to return a string instead of SessionInfo. - Made `attributes` a required parameter in the Rokt class method. - Removed unused RoktConfigBuilder from exports and sample app.
1 parent 565837f commit 78c86de

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

js/index.d.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ export interface AttributionResult {
2323
[key: string]: any;
2424
}
2525

26-
export interface SessionInfo {
27-
sessionId: string;
28-
sessionUuid: string;
29-
sessionStartTime: number;
30-
}
31-
3226
export type CompletionCallback<T> = (result: T) => void;
3327
export type ErrorCallback = (error: MParticleError | null) => void;
3428
export type IdentityCallback = (
@@ -164,7 +158,7 @@ export declare const logPushRegistration: (
164158
registrationField2: string
165159
) => void;
166160
export declare const getSession: (
167-
completion: CompletionCallback<SessionInfo>
161+
completion: CompletionCallback<string>
168162
) => void;
169163
export declare const setLocation: (latitude: number, longitude: number) => void;
170164

@@ -192,6 +186,9 @@ export declare class IdentityRequest {
192186
setEmail(email: string): this;
193187
setCustomerID(customerId: string): this;
194188
setUserIdentity(userIdentity: string, identityType: number): this;
189+
/**
190+
* @deprecated This method is deprecated and will be removed in a future version.
191+
*/
195192
setOnUserAlias(onUserAlias: any): void;
196193
}
197194

js/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
import { NativeModules } from 'react-native';
4-
import { Rokt, RoktConfigBuilder, CacheConfig } from './rokt/rokt';
4+
import { Rokt, CacheConfig } from './rokt/rokt';
55
import RoktLayoutView from './rokt/rokt-layout-view';
66

77
// ******** Constants ********
@@ -701,7 +701,6 @@ const MParticle = {
701701
GDPRConsent,
702702
CCPAConsent,
703703
Rokt,
704-
RoktConfigBuilder,
705704
CacheConfig,
706705
RoktLayoutView,
707706

js/rokt/rokt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { NativeModules } from 'react-native';
22

33
export abstract class Rokt {
44
/**
5-
* Selects placements with a [identifier], optional [attributes], optional [placeholders], optional [roktConfig], and optional [fontFilePathMap].
5+
* Selects placements with a [identifier], [attributes], optional [placeholders], optional [roktConfig], and optional [fontFilePathMap].
66
*
77
* @param {string} identifier - The page identifier for the placement.
8-
* @param {Record<string, string>} [attributes] - Optional attributes to be associated with the placement.
8+
* @param {Record<string, string>} attributes - Attributes to be associated with the placement.
99
* @param {Record<string, number | null>} [placeholders] - Optional placeholders for dynamic content.
1010
* @param {IRoktConfig} [roktConfig] - Optional configuration settings for Rokt.
1111
* @param {Record<string, string>} [fontFilesMap] - Optional mapping of font files.

sample/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from 'react-native';
1616
import MParticle from 'react-native-mparticle';
1717

18-
const { RoktConfigBuilder, RoktLayoutView } = MParticle;
18+
const { RoktLayoutView } = MParticle;
1919

2020
export default class MParticleSample extends Component {
2121
constructor(props) {

0 commit comments

Comments
 (0)