Skip to content

Commit 7422543

Browse files
check for alpha and call it a sdk key if it has any alpha characters. (#208)
* check for alpha and call it a sdk key if it has any alpha characters. * cleanup the file. remove imports and fix tabbing.
1 parent bcaebb4 commit 7422543

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

datafile-handler/src/main/java/com/optimizely/ab/android/datafile_handler/BackgroundWatchersCache.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ List<DatafileConfig> getWatchingDatafileConfigs() {
127127
final String projectKey = iterator.next();
128128
if (backgroundWatchers.getBoolean(projectKey)) {
129129
DatafileConfig datafileConfig = null;
130-
if (projectKey.contains("-")) {
130+
boolean sdkKey = projectKey.matches(".*[A-Za-z].*");
131+
//TODO: This should be changed to store a jsonized datafile config.
132+
if (sdkKey) {
131133
datafileConfig = new DatafileConfig(null, projectKey);
132134
}
133135
else {

test-app/src/main/java/com/optimizely/ab/android/test_app/MyApplication.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ public void onCreate() {
7171
// This app is built against a real Optimizely project with real experiments set. Automated
7272
// espresso tests are run against this project id. Changing it will make the Optimizely
7373
// must match the project id of the compiled in Optimizely data file in rest/raw/data_file.json.
74-
OptimizelyManager.Builder builder = OptimizelyManager.builder(PROJECT_ID);
74+
75+
OptimizelyManager.Builder builder = OptimizelyManager.builder();
7576
optimizelyManager = builder.withEventDispatchInterval(60L * 10L)
76-
.withDatafileDownloadInterval(60L * 10L)
77-
.build(getApplicationContext());
77+
.withDatafileDownloadInterval(60L * 10L)
78+
.withSDKKey("6hmwpgZcRFp36wH5QLK8Sb")
79+
.build(getApplicationContext());
7880
}
7981
}

0 commit comments

Comments
 (0)