Skip to content

Commit 89bbc6d

Browse files
[FSSDK-12247] fix: exclude CMAB decision from UPS (#96)
* chore: update native SDK versions to exclude CMAB updates - Update Android SDK to 5.1.1 - Update iOS SDK to 5.2.1 - Update iOS app delegate to use @main annotation - Add UIApplicationSupportsIndirectInputEvents support Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * clean up * Remove travis stuff --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent aa41968 commit 89bbc6d

6 files changed

Lines changed: 15 additions & 23 deletions

File tree

.github/workflows/flutter.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
with:
4444
# You should create a personal access token and store it in your repository
4545
token: ${{ secrets.CI_USER_TOKEN }}
46-
repository: 'optimizely/travisci-tools'
47-
path: 'home/runner/travisci-tools'
46+
repository: 'optimizely/ci-helper-tools'
47+
path: 'home/runner/ci-helper-tools'
4848
ref: 'master'
4949
- name: set SDK Branch if PR
5050
env:
@@ -76,7 +76,7 @@ jobs:
7676
EVENT_MESSAGE: ${{ github.event.message }}
7777
HOME: 'home/runner'
7878
run: |
79-
home/runner/travisci-tools/trigger-script-with-status-update.sh
79+
home/runner/ci-helper-tools/trigger-script-with-status-update.sh
8080
8181
integration_ios_tests:
8282
runs-on: ubuntu-latest
@@ -85,8 +85,8 @@ jobs:
8585
with:
8686
# You should create a personal access token and store it in your repository
8787
token: ${{ secrets.CI_USER_TOKEN }}
88-
repository: 'optimizely/travisci-tools'
89-
path: 'home/runner/travisci-tools'
88+
repository: 'optimizely/ci-helper-tools'
89+
path: 'home/runner/ci-helper-tools'
9090
ref: 'master'
9191
- name: set SDK Branch if PR
9292
env:
@@ -118,7 +118,7 @@ jobs:
118118
EVENT_MESSAGE: ${{ github.event.message }}
119119
HOME: 'home/runner'
120120
run: |
121-
home/runner/travisci-tools/trigger-script-with-status-update.sh
121+
home/runner/ci-helper-tools/trigger-script-with-status-update.sh
122122
123123
build_test_android:
124124
runs-on: ubuntu-latest

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ dependencies {
6969
implementation 'org.slf4j:slf4j-api:2.0.7'
7070

7171
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.0"
72-
implementation "com.optimizely.ab:android-sdk:5.1.0"
72+
implementation "com.optimizely.ab:android-sdk:5.1.1"
7373
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
7474
implementation ('com.google.guava:guava:19.0') {
7575
exclude group:'com.google.guava', module:'listenablefuture'

example/ios/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22
import Flutter
33

4-
@UIApplicationMain
4+
@main
55
@objc class AppDelegate: FlutterAppDelegate {
66
override func application(
77
_ application: UIApplication,

example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,7 @@
4545
<false/>
4646
<key>CADisableMinimumFrameDurationOnPhone</key>
4747
<true/>
48+
<key>UIApplicationSupportsIndirectInputEvents</key>
49+
<true/>
4850
</dict>
4951
</plist>

example/lib/sample_api.dart

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class CmabSampleApi {
7878
print('\nMaking async decision for flag: $CMAB_FLAG_KEY');
7979
var decision = await userContext.decideAsync(
8080
CMAB_FLAG_KEY,
81-
{OptimizelyDecideOption.ignoreUserProfileService},
8281
);
8382

8483
// Access decision results
@@ -127,7 +126,6 @@ class CmabSampleApi {
127126
CMAB_FLAG_KEY,
128127
{
129128
OptimizelyDecideOption.ignoreCmabCache,
130-
OptimizelyDecideOption.ignoreUserProfileService,
131129
},
132130
);
133131
print(' ✓ Fresh decision from CMAB service (cache bypassed)');
@@ -140,8 +138,7 @@ class CmabSampleApi {
140138
var decision2 = await userContext.decideAsync(
141139
CMAB_FLAG_KEY,
142140
{
143-
OptimizelyDecideOption.resetCmabCache,
144-
OptimizelyDecideOption.ignoreUserProfileService,
141+
OptimizelyDecideOption.resetCmabCache
145142
},
146143
);
147144
print(' ✓ Entire CMAB cache cleared, new decision fetched');
@@ -154,8 +151,7 @@ class CmabSampleApi {
154151
var decision3 = await userContext.decideAsync(
155152
CMAB_FLAG_KEY,
156153
{
157-
OptimizelyDecideOption.invalidateUserCmabCache,
158-
OptimizelyDecideOption.ignoreUserProfileService,
154+
OptimizelyDecideOption.invalidateUserCmabCache
159155
},
160156
);
161157
print(' ✓ User-specific cache cleared, new decision fetched');
@@ -164,8 +160,7 @@ class CmabSampleApi {
164160
// Regular cached decision (for comparison)
165161
print('\n4. Regular decision (uses cache if available):');
166162
var decision4 = await userContext.decideAsync(
167-
CMAB_FLAG_KEY,
168-
{OptimizelyDecideOption.ignoreUserProfileService},
163+
CMAB_FLAG_KEY
169164
);
170165
print(' ✓ Decision returned (may be from cache)');
171166
print(' - Variation: ${decision4.decision?.variationKey}');
@@ -211,8 +206,7 @@ class CmabSampleApi {
211206

212207
// Make decision with custom config
213208
var decision = await userContext.decideAsync(
214-
CMAB_FLAG_KEY,
215-
{OptimizelyDecideOption.ignoreUserProfileService},
209+
CMAB_FLAG_KEY
216210
);
217211

218212
print('\n✓ Decision made with custom cache settings:');
@@ -314,15 +308,13 @@ class CmabSampleApi {
314308
await user1Context.decideAsync(
315309
CMAB_FLAG_KEY,
316310
{
317-
OptimizelyDecideOption.ignoreUserProfileService,
318311
OptimizelyDecideOption.includeReasons,
319312
},
320313
);
321314

322315
await user2Context.decideAsync(
323316
CMAB_FLAG_KEY,
324317
{
325-
OptimizelyDecideOption.ignoreUserProfileService,
326318
OptimizelyDecideOption.includeReasons,
327319
},
328320
);
@@ -331,7 +323,6 @@ class CmabSampleApi {
331323
await user1Context.decideAsync(
332324
CMAB_FLAG_KEY,
333325
{
334-
OptimizelyDecideOption.ignoreUserProfileService,
335326
OptimizelyDecideOption.includeReasons,
336327
OptimizelyDecideOption.invalidateUserCmabCache,
337328
},
@@ -341,7 +332,6 @@ class CmabSampleApi {
341332
await user2Context.decideAsync(
342333
CMAB_FLAG_KEY,
343334
{
344-
OptimizelyDecideOption.ignoreUserProfileService,
345335
OptimizelyDecideOption.includeReasons,
346336
},
347337
);

ios/optimizely_flutter_sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.source = { :path => '.' }
1414
s.source_files = 'Classes/**/*'
1515
s.dependency 'Flutter'
16-
s.dependency 'OptimizelySwiftSDK', '5.2.0'
16+
s.dependency 'OptimizelySwiftSDK', '5.2.1'
1717
s.platform = :ios, '10.0'
1818
# Flutter.framework does not contain a i386 slice.
1919
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }

0 commit comments

Comments
 (0)