Skip to content

Commit c888b4d

Browse files
authored
refactor: Update selectPlacements parameter from placementId to identifier (#55)
1 parent c1e8164 commit c888b4d

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

example/lib/rokt_layouts_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class _RoktLayoutsScreenState extends State<RoktLayoutsScreen> {
144144
.identify(identityRequest: identityRequest);
145145

146146
widget.mpInstance?.rokt.selectPlacements(
147-
placementId: _placementIdController.text,
147+
identifier: _placementIdController.text,
148148
attributes: _getAttributesForPlatform());
149149
print('${_getPlatform()} Rokt selectPlacements called');
150150
} catch (e) {

lib/mparticle_flutter_sdk.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,20 +306,20 @@ class Rokt {
306306
static const MethodChannel _channel =
307307
const MethodChannel('mparticle_flutter_sdk');
308308

309-
/// Selects placements with a [placementId], optional [attributes], optional [roktConfig], and optional [fontFilePathMap].
309+
/// Selects placements with a [identifier], optional [attributes], optional [roktConfig], and optional [fontFilePathMap].
310310
///
311311
/// This method calls the Rokt selectPlacements API on each platform:
312312
/// - Web: mParticle.Rokt.selectPlacements()
313313
/// - Android: MParticle.getInstance()?.Rokt().selectPlacements()
314314
/// - iOS: MParticle.sharedInstance().rokt.selectPlacements()
315315
Future<void> selectPlacements({
316-
required String placementId,
316+
required String identifier,
317317
Map<String, dynamic>? attributes,
318318
RoktConfig? roktConfig,
319319
Map<String, String>? fontFilePathMap,
320320
}) async {
321321
var params = {
322-
'placementId': placementId,
322+
'placementId': identifier,
323323
'attributes': attributes,
324324
'config': _roktConfigToMap(config: roktConfig),
325325
'fontFilePathMap': fontFilePathMap,

test/mparticle_flutter_sdk_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void main() {
305305
cacheDurationInSeconds: 100,
306306
cacheAttributes: {'key1': 'value1'}));
307307
await mp.rokt.selectPlacements(
308-
placementId: 'placement1',
308+
identifier: 'placement1',
309309
attributes: {'attr1': 'val1'},
310310
roktConfig: roktConfig,
311311
fontFilePathMap: {'font1': 'path1'});
@@ -329,7 +329,7 @@ void main() {
329329
test('rokt select placements with placeholders', () async {
330330
mp.attachPlaceholder(id: 1, name: "placeholder1");
331331
await mp.rokt.selectPlacements(
332-
placementId: 'placement1',
332+
identifier: 'placement1',
333333
);
334334

335335
expect(

0 commit comments

Comments
 (0)