Skip to content

Commit

Permalink
chore: cleanup files and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed Dec 10, 2024
1 parent 1fcc010 commit f29a417
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 52 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/build.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.customer.sdk.core.util.Logger
import io.customer.sdk.data.model.Region
import io.customer.sdk.events.Metric
import io.customer.sdk.events.TrackMetric
import io.customer.sdk.events.serializedName
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
Expand Down Expand Up @@ -125,7 +126,8 @@ class CustomerIOPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
throw IllegalArgumentException("Missing required parameters")
}

val event = Metric.valueOf(eventName)
val event = Metric.values().find { it.serializedName.equals(eventName, true) }
?: throw IllegalArgumentException("Invalid metric event name")

CustomerIO.instance().trackMetric(
event = TrackMetric.Push(
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/res/values/customer_io_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
This will be updated by update-version script with Flutter package version
whenever new version of Flutter package is released
-->
<string name="customer_io_wrapper_sdk_client_version">1.5.2</string>
<string name="customer_io_wrapper_sdk_client_version">2.0.0</string>
</resources>
4 changes: 2 additions & 2 deletions lib/customer_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class CustomerIO {

/// Access push messaging functionality
static CustomerIOMessagingPushPlatform get pushMessaging {
return instance._pushMessaging;
return _instance?._pushMessaging ?? CustomerIOMessagingPushPlatform.instance;
}

/// Access in-app messaging functionality
static CustomerIOMessagingInAppPlatform get inAppMessaging {
return instance._inAppMessaging;
return _instance?._inAppMessaging ?? CustomerIOMessagingInAppPlatform.instance;
}

/// To initialize the plugin
Expand Down
2 changes: 1 addition & 1 deletion lib/customer_io_plugin_version.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Don't modify this line - it's automatically updated
const version = "1.5.2";
const version = "2.0.0";
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: customer_io
description: An official flutter plugin for Customer.io, an automated messaging platform for tech-savvy marketers.
version: 1.5.2
version: 2.0.0
homepage: https://customer.io
repository: https://github.com/customerio/customerio-flutter

Expand Down

0 comments on commit f29a417

Please sign in to comment.