Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update config for data pipelines support #157

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

mrehan27
Copy link
Contributor

@mrehan27 mrehan27 commented Nov 5, 2024

closes: MBL-619

Changes

  • Updated CustomerIOConfig to align with Data Pipelines requirements
  • Made all non-required values nullable, allowing optional configuration when constructing CustomerIOConfig
  • Separated module configurations into individual files
  • Re-exported configurations using same old path for compatibility
  • Fixed SDK source and version in CustomerIOConfig, removing redundant code
  • Adjusted sample app to compile, further updates will be handled in other tickets
  • Added tests for CustomerIOConfig
  • Resolved test failures caused by these changes

Code Changes

Before

import 'package:customer_io/customer_io_config.dart';

CustomerIOConfig(
  siteId: 'siteId',
  apiKey: 'apiKey',
  enableInApp: true,
  region: Region.us,
  trackingApiUrl: 'https://tracking.url.io/',
  autoTrackDeviceAttributes: true,
  autoTrackPushEvents: true,
  backgroundQueueMinNumberOfTasks: 10,
  backgroundQueueSecondsDelay: 30.0,
  logLevel: CioLogLevel.debug,
  pushClickBehaviorAndroid: PushClickBehaviorAndroid.activityPreventRestart,
);

After

import 'package:customer_io/customer_io_config.dart';

CustomerIOConfig(
  cdpApiKey: 'cdpApiKey',
  migrationSiteId: 'migrationSiteId',
  region: Region.us,
  logLevel: CioLogLevel.debug,
  autoTrackDeviceAttributes: true,
  apiHost: 'https://www.api.host.io/',
  cdnHost: 'https://www.cdn.host.io/',
  flushAt: 10,
  flushInterval: 30,
  inAppConfig: InAppConfig(siteId: 'siteId'),
  pushConfig: PushConfig(
    android: PushConfigAndroid(
      pushClickBehavior: PushClickBehaviorAndroid.activityPreventRestart,
    ),
  ),
);

@mrehan27 mrehan27 self-assigned this Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • amiapp_flutter: 157.1.0 (28846588)

@mrehan27 mrehan27 requested a review from Shahroz16 November 5, 2024 08:28
Copy link
Collaborator

@Shahroz16 Shahroz16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, few comments

final InAppConfig? inAppConfig;
final PushConfig pushConfig;

CustomerIOConfig({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think trackApplicationLifecycleEvents is not here as its part of another ticket, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I focused mainly on Dart file changes here. native SDK implementation and testing will be handled in the other ticket you mentioned.

this.cdnHost,
this.flushAt,
this.flushInterval,
this.inAppConfig,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking our load, if a user has provided migrationSiteId and not InAppConfig should we automatically handle it for them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially thought the same, but doing it that way would mean losing flexibility in two scenarios:

  • Disabling in-app messaging wouldn't be possible if migrationSiteId is provided
  • If a user creates a new siteId, it could cause issues since migrationSiteId is supposed to remain the same, while in-app feature would require the new siteId

Keeping them separate gives us better control in these cases.

@mrehan27 mrehan27 merged commit 0ed2485 into feature/data-pipelines-support Nov 5, 2024
6 checks passed
@mrehan27 mrehan27 deleted the rehan/mbl-619-sdk-config branch November 5, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants