Skip to content

Commit 6724439

Browse files
authored
Implemented experiment info calls for flutter (#131)
* Implemented experiment info calls for flutter -- Added android native calls for experiment info -- Added iOS native calls for experiment info -- Updated underlying SDK's * Updated changelog * iOS: renamed 'CountlyExperimentInformation' class * renamed 'ExperimentInformation' class * updated native file after renaming
1 parent 4011308 commit 6724439

30 files changed

+504
-28
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## 23.8.1
22
* Added `enrollABOnRCDownload` config method to enroll users to AB tests when downloading Remote Config values
3-
* Fixed a bug where enabling consent requirements would enable consents for all features for Android
3+
* Fixed a bug where enabling consent requirements would enable consents for all features for Android
4+
* Added `testingDownloadExperimentInformation:` in remote config interface
5+
* Added `testingGetAllExperimentInfo:` in remote config interface
6+
* Updated underlying Android SDK version to 23.8.1
7+
* Updated underlying iOS SDK version to 23.8.2
48

59
## 23.8.0
610
* ! Minor breaking change ! Manual view recording calls are now ignored if automatic view recording mode is enabled.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ android {
3434
}
3535

3636
dependencies {
37-
implementation 'ly.count.android:sdk:23.8.0'
37+
implementation 'ly.count.android:sdk:23.8.1'
3838
implementation 'com.google.firebase:firebase-messaging:20.2.1'
3939
}

android/src/main/java/ly/count/dart/countly_flutter/CountlyFlutterPlugin.java

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import ly.count.android.sdk.Countly;
1515
import ly.count.android.sdk.CountlyConfig;
16+
import ly.count.android.sdk.ExperimentInformation;
1617
import ly.count.android.sdk.FeedbackRatingCallback;
1718
import ly.count.android.sdk.ModuleFeedback.*;
1819
import ly.count.android.sdk.DeviceIdType;
@@ -981,7 +982,41 @@ public void callback(RequestResult downloadResult, String error, boolean fullVal
981982
});
982983

983984
result.success(null);
984-
} else if ("remoteConfigTestingEnrollIntoVariant".equals(call.method)) {
985+
}
986+
else if ("testingDownloadExperimentInformation".equals(call.method)) {
987+
int requestID = args.getInt(0);
988+
989+
log("testingDownloadExperimentInformation", LogLevel.WARNING);
990+
991+
Countly.sharedInstance().remoteConfig().testingDownloadExperimentInformation((rResult, error) -> {
992+
if (requestID == requestIDNoCallback) {
993+
return;
994+
}
995+
Map<String, Object> data = new HashMap<>();
996+
data.put("error", error);
997+
data.put("requestResult", resultResponder(rResult));
998+
data.put("id", requestID);
999+
methodChannel.invokeMethod("remoteConfigVariantCallback", data);
1000+
});
1001+
1002+
result.success(null);
1003+
}
1004+
else if ("testingGetAllExperimentInfo".equals(call.method)) {
1005+
Map<String, ExperimentInformation> experimentInfoMap = Countly.sharedInstance().remoteConfig().testingGetAllExperimentInfo();
1006+
List<Map<String, Object>> experimentInfoArray = new ArrayList<>();
1007+
for (Map.Entry<String, ExperimentInformation> entry : experimentInfoMap.entrySet()) {
1008+
ExperimentInformation experimentInfo = entry.getValue();
1009+
Map<String, Object> experimentInfoValue = new HashMap<>();
1010+
experimentInfoValue.put("experimentID", experimentInfo.experimentName);
1011+
experimentInfoValue.put("experimentName", experimentInfo.experimentName);
1012+
experimentInfoValue.put("experimentDescription", experimentInfo.experimentDescription);
1013+
experimentInfoValue.put("currentVariant", experimentInfo.currentVariant);
1014+
experimentInfoValue.put("variants", experimentInfo.variants);
1015+
experimentInfoArray.add(experimentInfoValue);
1016+
}
1017+
result.success(experimentInfoArray);
1018+
}
1019+
else if ("remoteConfigTestingEnrollIntoVariant".equals(call.method)) {
9851020
int requestID = args.getInt(0);
9861021
String key = args.getString(1);
9871022
String variant = args.getString(2);

example-no-push/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ dependencies {
5959
testImplementation 'junit:junit:4.12'
6060
androidTestImplementation 'com.android.support.test:runner:1.0.2'
6161
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
62-
implementation 'ly.count.android:sdk:22.09.4'
62+
implementation 'ly.count.android:sdk:23.8.1'
6363
}
6464

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dependencies {
5959
testImplementation 'junit:junit:4.12'
6060
androidTestImplementation 'com.android.support.test:runner:1.0.2'
6161
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
62-
implementation 'ly.count.android:sdk:22.09.4'
62+
implementation 'ly.count.android:sdk:23.8.1'
6363
implementation 'com.google.firebase:firebase-messaging:20.2.1'
6464
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
6565
}

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ subprojects {
2525
project.evaluationDependsOn(':app')
2626
}
2727

28-
task clean(type: Delete) {
28+
tasks.register("clean", Delete) {
2929
delete rootProject.buildDir
3030
}

example/ios/Flutter/Flutter.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# NOTE: This podspec is NOT to be published. It is only used as a local source!
3-
# This is a generated file; do not edit or check into version control.
2+
# This podspec is NOT to be published. It is only used as a local source!
3+
# This is a generated file; do not edit or check into version control.
44
#
55

66
Pod::Spec.new do |s|

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '11.0'
2+
platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- countly_flutter (23.6.0):
2+
- countly_flutter (23.8.0):
33
- Flutter
44
- Flutter (1.0.0)
55

@@ -14,9 +14,9 @@ EXTERNAL SOURCES:
1414
:path: Flutter
1515

1616
SPEC CHECKSUMS:
17-
countly_flutter: 4eeee607183664b871589250a0bd049cfd2697eb
17+
countly_flutter: f153e5547d4f3cdf24be11f6ed4df32c9a421fa3
1818
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
1919

20-
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
20+
PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d
2121

2222
COCOAPODS: 1.12.1

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,11 @@
462462
"$(PROJECT_DIR)/Flutter",
463463
);
464464
INFOPLIST_FILE = Runner/Info.plist;
465-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
465+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
466+
LD_RUNPATH_SEARCH_PATHS = (
467+
"$(inherited)",
468+
"@executable_path/Frameworks",
469+
);
466470
LIBRARY_SEARCH_PATHS = (
467471
"$(inherited)",
468472
"$(PROJECT_DIR)/Flutter",
@@ -490,7 +494,11 @@
490494
GCC_C_LANGUAGE_STANDARD = gnu11;
491495
INFOPLIST_FILE = CountlyNSE/Info.plist;
492496
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
493-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
497+
LD_RUNPATH_SEARCH_PATHS = (
498+
"$(inherited)",
499+
"@executable_path/Frameworks",
500+
"@executable_path/../../Frameworks",
501+
);
494502
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
495503
MTL_FAST_MATH = YES;
496504
PRODUCT_BUNDLE_IDENTIFIER = com.countly.demo.CountlyNSE;
@@ -514,7 +522,11 @@
514522
GCC_C_LANGUAGE_STANDARD = gnu11;
515523
INFOPLIST_FILE = CountlyNSE/Info.plist;
516524
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
517-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
525+
LD_RUNPATH_SEARCH_PATHS = (
526+
"$(inherited)",
527+
"@executable_path/Frameworks",
528+
"@executable_path/../../Frameworks",
529+
);
518530
MTL_FAST_MATH = YES;
519531
PRODUCT_BUNDLE_IDENTIFIER = com.countly.demo.CountlyNSE;
520532
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -537,7 +549,11 @@
537549
GCC_C_LANGUAGE_STANDARD = gnu11;
538550
INFOPLIST_FILE = CountlyNSE/Info.plist;
539551
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
540-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
552+
LD_RUNPATH_SEARCH_PATHS = (
553+
"$(inherited)",
554+
"@executable_path/Frameworks",
555+
"@executable_path/../../Frameworks",
556+
);
541557
MTL_FAST_MATH = YES;
542558
PRODUCT_BUNDLE_IDENTIFIER = com.countly.demo.CountlyNSE;
543559
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -666,7 +682,11 @@
666682
"$(PROJECT_DIR)/Flutter",
667683
);
668684
INFOPLIST_FILE = Runner/Info.plist;
669-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
685+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
686+
LD_RUNPATH_SEARCH_PATHS = (
687+
"$(inherited)",
688+
"@executable_path/Frameworks",
689+
);
670690
LIBRARY_SEARCH_PATHS = (
671691
"$(inherited)",
672692
"$(PROJECT_DIR)/Flutter",
@@ -696,7 +716,11 @@
696716
"$(PROJECT_DIR)/Flutter",
697717
);
698718
INFOPLIST_FILE = Runner/Info.plist;
699-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
719+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
720+
LD_RUNPATH_SEARCH_PATHS = (
721+
"$(inherited)",
722+
"@executable_path/Frameworks",
723+
);
700724
LIBRARY_SEARCH_PATHS = (
701725
"$(inherited)",
702726
"$(PROJECT_DIR)/Flutter",

0 commit comments

Comments
 (0)