1
1
/****************************************************************************
2
- * Copyright 2020, 2022, Optimizely, Inc. and contributors *
2
+ * Copyright 2020, 2022-2023 , Optimizely, Inc. and contributors *
3
3
* *
4
4
* Licensed under the Apache License, Version 2.0 (the "License"); *
5
5
* you may not use this file except in compliance with the License. *
@@ -90,9 +90,9 @@ static public void samplesAll(Context context) {
90
90
samplesForDoc_NotificatonListener (context );
91
91
samplesForDoc_OlderVersions (context );
92
92
samplesForDoc_ForcedDecision (context );
93
+ samplesForDoc_ODP (context );
93
94
}
94
95
95
-
96
96
static public void samplesForDecide (Context context ) {
97
97
// this default-options will be applied to all following decide calls.
98
98
List <OptimizelyDecideOption > defaultDecideOptions = Arrays .asList (OptimizelyDecideOption .DISABLE_DECISION_EVENT );
@@ -859,4 +859,16 @@ static public void samplesForDoc_ForcedDecision(Context context) {
859
859
success = user .removeAllForcedDecisions ();
860
860
}
861
861
862
- }
862
+ static public void samplesForDoc_ODP (Context context ) {
863
+ OptimizelyManager optimizelyManager = OptimizelyManager .builder ().withSDKKey ("VivZyCGPHY369D4z8T9yG" ).build (context );
864
+ optimizelyManager .initialize (context , null , (OptimizelyClient client ) -> {
865
+ OptimizelyUserContext userContext = client .createUserContext ("user_123" );
866
+ userContext .fetchQualifiedSegments ((status ) -> {
867
+ Log .d ("Optimizely" , "[ODP] segments = " + userContext .getQualifiedSegments ());
868
+ OptimizelyDecision optDecision = userContext .decide ("odp-flag-1" );
869
+ Log .d ("Optimizely" , "[ODP] decision = " + optDecision .toString ());
870
+ });
871
+ });
872
+ }
873
+
874
+ }
0 commit comments