|
13 | 13 |
|
14 | 14 | import ly.count.android.sdk.Countly; |
15 | 15 | import ly.count.android.sdk.CountlyConfig; |
| 16 | +import ly.count.android.sdk.ExperimentInformation; |
16 | 17 | import ly.count.android.sdk.FeedbackRatingCallback; |
17 | 18 | import ly.count.android.sdk.ModuleFeedback.*; |
18 | 19 | import ly.count.android.sdk.DeviceIdType; |
|
63 | 64 | */ |
64 | 65 | public class CountlyFlutterPlugin implements MethodCallHandler, FlutterPlugin, ActivityAware, DefaultLifecycleObserver { |
65 | 66 | private static final String TAG = "CountlyFlutterPlugin"; |
66 | | - private final String COUNTLY_FLUTTER_SDK_VERSION_STRING = "23.8.0"; |
| 67 | + private final String COUNTLY_FLUTTER_SDK_VERSION_STRING = "23.8.1"; |
67 | 68 | private final String COUNTLY_FLUTTER_SDK_NAME = "dart-flutterb-android"; |
68 | 69 | private final String COUNTLY_FLUTTER_SDK_NAME_NO_PUSH = "dart-flutterbnp-android"; |
69 | 70 |
|
@@ -968,7 +969,41 @@ public void callback(RequestResult downloadResult, String error, boolean fullVal |
968 | 969 | }); |
969 | 970 |
|
970 | 971 | result.success(null); |
971 | | - } else if ("remoteConfigTestingEnrollIntoVariant".equals(call.method)) { |
| 972 | + } |
| 973 | + else if ("testingDownloadExperimentInformation".equals(call.method)) { |
| 974 | + int requestID = args.getInt(0); |
| 975 | + |
| 976 | + log("testingDownloadExperimentInformation", LogLevel.WARNING); |
| 977 | + |
| 978 | + Countly.sharedInstance().remoteConfig().testingDownloadExperimentInformation((rResult, error) -> { |
| 979 | + if (requestID == requestIDNoCallback) { |
| 980 | + return; |
| 981 | + } |
| 982 | + Map<String, Object> data = new HashMap<>(); |
| 983 | + data.put("error", error); |
| 984 | + data.put("requestResult", resultResponder(rResult)); |
| 985 | + data.put("id", requestID); |
| 986 | + methodChannel.invokeMethod("remoteConfigVariantCallback", data); |
| 987 | + }); |
| 988 | + |
| 989 | + result.success(null); |
| 990 | + } |
| 991 | + else if ("testingGetAllExperimentInfo".equals(call.method)) { |
| 992 | + Map<String, ExperimentInformation> experimentInfoMap = Countly.sharedInstance().remoteConfig().testingGetAllExperimentInfo(); |
| 993 | + List<Map<String, Object>> experimentInfoArray = new ArrayList<>(); |
| 994 | + for (Map.Entry<String, ExperimentInformation> entry : experimentInfoMap.entrySet()) { |
| 995 | + ExperimentInformation experimentInfo = entry.getValue(); |
| 996 | + Map<String, Object> experimentInfoValue = new HashMap<>(); |
| 997 | + experimentInfoValue.put("experimentID", experimentInfo.experimentName); |
| 998 | + experimentInfoValue.put("experimentName", experimentInfo.experimentName); |
| 999 | + experimentInfoValue.put("experimentDescription", experimentInfo.experimentDescription); |
| 1000 | + experimentInfoValue.put("currentVariant", experimentInfo.currentVariant); |
| 1001 | + experimentInfoValue.put("variants", experimentInfo.variants); |
| 1002 | + experimentInfoArray.add(experimentInfoValue); |
| 1003 | + } |
| 1004 | + result.success(experimentInfoArray); |
| 1005 | + } |
| 1006 | + else if ("remoteConfigTestingEnrollIntoVariant".equals(call.method)) { |
972 | 1007 | int requestID = args.getInt(0); |
973 | 1008 | String key = args.getString(1); |
974 | 1009 | String variant = args.getString(2); |
@@ -1530,8 +1565,12 @@ public void callback(String error) { |
1530 | 1565 | this.config.setGlobalViewSegmentation(toMap(globalViewSegmentation)); |
1531 | 1566 | } |
1532 | 1567 |
|
1533 | | - if (_config.has("enableAllConsents")) { |
| 1568 | + if (_config.has("enableAllConsents") && _config.getBoolean("enableAllConsents")) { |
1534 | 1569 | this.config.giveAllConsents(); |
1535 | 1570 | } |
| 1571 | + |
| 1572 | + if (_config.has("autoEnrollABOnDownload") && _config.getBoolean("autoEnrollABOnDownload")) { |
| 1573 | + this.config.enrollABOnRCDownload(); |
| 1574 | + } |
1536 | 1575 | } |
1537 | 1576 | } |
0 commit comments