File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
main/java/com/iterable/iterableapi
test/java/com/iterable/iterableapi Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ public static void setContext(Context context) {
312
312
313
313
static void loadLastSavedConfiguration (Context context ) {
314
314
SharedPreferences sharedPref = context .getSharedPreferences (IterableConstants .SHARED_PREFS_SAVED_CONFIGURATION , Context .MODE_PRIVATE );
315
- boolean offlineMode = sharedPref .getBoolean (IterableConstants .SHARED_PREFS_OFFLINE_MODE_BETA_KEY , false );
315
+ boolean offlineMode = sharedPref .getBoolean (IterableConstants .SHARED_PREFS_OFFLINE_MODE_KEY , false );
316
316
sharedInstance .apiClient .setOfflineProcessingEnabled (offlineMode );
317
317
}
318
318
@@ -326,11 +326,11 @@ public void execute(@Nullable String data) {
326
326
}
327
327
try {
328
328
JSONObject jsonData = new JSONObject (data );
329
- boolean offlineConfiguration = jsonData .getBoolean (IterableConstants .SHARED_PREFS_OFFLINE_MODE_BETA_KEY );
329
+ boolean offlineConfiguration = jsonData .getBoolean (IterableConstants .KEY_OFFLINE_MODE );
330
330
sharedInstance .apiClient .setOfflineProcessingEnabled (offlineConfiguration );
331
331
SharedPreferences sharedPref = sharedInstance .getMainActivityContext ().getSharedPreferences (IterableConstants .SHARED_PREFS_SAVED_CONFIGURATION , Context .MODE_PRIVATE );
332
332
SharedPreferences .Editor editor = sharedPref .edit ();
333
- editor .putBoolean (IterableConstants .SHARED_PREFS_OFFLINE_MODE_BETA_KEY , offlineConfiguration );
333
+ editor .putBoolean (IterableConstants .SHARED_PREFS_OFFLINE_MODE_KEY , offlineConfiguration );
334
334
editor .apply ();
335
335
} catch (JSONException e ) {
336
336
IterableLogger .e (TAG , "Failed to read remote configuration" );
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ public final class IterableConstants {
53
53
public static final String KEY_USER = "user" ;
54
54
public static final String KEY_USER_TEXT = "userText" ;
55
55
public static final String KEY_INBOX_SESSION_ID = "inboxSessionId" ;
56
+ public static final String KEY_OFFLINE_MODE = "offlineMode" ;
56
57
57
58
//API Endpoint Key Constants
58
59
public static final String ENDPOINT_DISABLE_DEVICE = "users/disableDevice" ;
@@ -110,8 +111,7 @@ public final class IterableConstants {
110
111
public static final int SHARED_PREFS_ATTRIBUTION_INFO_EXPIRATION_HOURS = 24 ;
111
112
public static final String SHARED_PREFS_FCM_MIGRATION_DONE_KEY = "itbl_fcm_migration_done" ;
112
113
public static final String SHARED_PREFS_SAVED_CONFIGURATION = "itbl_saved_configuration" ;
113
- public static final String SHARED_PREFS_OFFLINE_MODE_BETA_KEY = "offlineModeBeta" ;
114
- public static final String SHARED_PREFS_OFFLINE_MODE_KEY = "offlineMode" ;
114
+ public static final String SHARED_PREFS_OFFLINE_MODE_KEY = "itbl_offline_mode" ;
115
115
116
116
//Action buttons
117
117
public static final String ITBL_BUTTON_IDENTIFIER = "identifier" ;
Original file line number Diff line number Diff line change @@ -675,7 +675,7 @@ public void testFetchRemoteConfigurationCalledWhenInForeground() throws Exceptio
675
675
676
676
server .enqueue (new MockResponse ().setResponseCode (200 ).setBody ("{\n " +
677
677
" \" offlineMode\" : false,\n " +
678
- " \" " + IterableConstants .SHARED_PREFS_OFFLINE_MODE_BETA_KEY + "\" : true,\n " +
678
+ " \" " + IterableConstants .KEY_OFFLINE_MODE + "\" : true,\n " +
679
679
" \" someOtherKey1\" : \" someOtherValue1\" \n " +
680
680
" }" ));
681
681
IterableActivityMonitor .getInstance ().unregisterLifecycleCallbacks (getContext ());
You can’t perform that action at this time.
0 commit comments