Skip to content

Commit

Permalink
removes update handler from config and manager constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Greer committed Nov 14, 2023
1 parent fedc2dd commit 3c2e238
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 23 deletions.
2 changes: 0 additions & 2 deletions iterableapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ dependencies {
testImplementation 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.2.2'
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
testImplementation project(path: ':iterableapi')
testImplementation project(path: ':app')

androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,7 @@ public static void initialize(@NonNull Context context, @NonNull String apiKey,

if (sharedInstance.embeddedManager == null) {
sharedInstance.embeddedManager = new IterableEmbeddedManager(
sharedInstance,
sharedInstance.config.embeddedUpdateHandler
sharedInstance
);
}

Expand Down Expand Up @@ -588,12 +587,6 @@ public static void setContext(Context context) {
this.inAppManager = inAppManager;
}

@VisibleForTesting
IterableApi(IterableEmbeddedManager embeddedManager) {
config = new IterableConfig.Builder().build();
this.embeddedManager = embeddedManager;
}

@VisibleForTesting
IterableApi(IterableInAppManager inAppManager, IterableEmbeddedManager embeddedManager) {
config = new IterableConfig.Builder().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public class IterableConfig {
*/
final IterableAuthHandler authHandler;

final IterableEmbeddedUpdateHandler embeddedUpdateHandler;

/**
* Duration prior to an auth expiration that a new auth token should be requested.
*/
Expand Down Expand Up @@ -94,7 +92,6 @@ private IterableConfig(Builder builder) {
inAppHandler = builder.inAppHandler;
inAppDisplayInterval = builder.inAppDisplayInterval;
authHandler = builder.authHandler;
embeddedUpdateHandler = builder.embeddedUpdateHandler;
expiringAuthTokenRefreshPeriod = builder.expiringAuthTokenRefreshPeriod;
allowedProtocols = builder.allowedProtocols;
dataRegion = builder.dataRegion;
Expand All @@ -111,7 +108,6 @@ public static class Builder {
private IterableInAppHandler inAppHandler = new IterableDefaultInAppHandler();
private double inAppDisplayInterval = 30.0;
private IterableAuthHandler authHandler;
private IterableEmbeddedUpdateHandler embeddedUpdateHandler;
private long expiringAuthTokenRefreshPeriod = 60000L;
private String[] allowedProtocols = new String[0];
private IterableDataRegion dataRegion = IterableDataRegion.US;
Expand Down Expand Up @@ -258,11 +254,6 @@ public Builder setUseInMemoryStorageForInApps(boolean useInMemoryStorageForInApp
return this;
}

Builder setEmbeddedUpdateHandler(@NonNull IterableEmbeddedUpdateHandler embeddedUpdateHandler) {
this.embeddedUpdateHandler = embeddedUpdateHandler;
return this;
}

@NonNull
public IterableConfig build() {
return new IterableConfig(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class IterableEmbeddedManager : IterableActivityMonitor.AppStateCallback

private var embeddedSessionManager = EmbeddedSessionManager()

private var updateHandler: IterableEmbeddedUpdateHandler? = null
private var activityMonitor: IterableActivityMonitor? = null

// endregion
Expand All @@ -28,11 +27,9 @@ public class IterableEmbeddedManager : IterableActivityMonitor.AppStateCallback

//Constructor of this class with actionHandler and updateHandler
public constructor(
iterableApi: IterableApi,
updateHandler: IterableEmbeddedUpdateHandler?
iterableApi: IterableApi
) {
this.iterableApi = iterableApi
this.updateHandler = updateHandler
this.context = iterableApi.mainActivityContext
activityMonitor = IterableActivityMonitor.getInstance()
activityMonitor?.addCallback(this)
Expand Down

0 comments on commit 3c2e238

Please sign in to comment.