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) {
312312
313313 static void loadLastSavedConfiguration (Context context ) {
314314 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 );
316316 sharedInstance .apiClient .setOfflineProcessingEnabled (offlineMode );
317317 }
318318
@@ -326,11 +326,11 @@ public void execute(@Nullable String data) {
326326 }
327327 try {
328328 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 );
330330 sharedInstance .apiClient .setOfflineProcessingEnabled (offlineConfiguration );
331331 SharedPreferences sharedPref = sharedInstance .getMainActivityContext ().getSharedPreferences (IterableConstants .SHARED_PREFS_SAVED_CONFIGURATION , Context .MODE_PRIVATE );
332332 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 );
334334 editor .apply ();
335335 } catch (JSONException e ) {
336336 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 {
5353 public static final String KEY_USER = "user" ;
5454 public static final String KEY_USER_TEXT = "userText" ;
5555 public static final String KEY_INBOX_SESSION_ID = "inboxSessionId" ;
56+ public static final String KEY_OFFLINE_MODE = "offlineMode" ;
5657
5758 //API Endpoint Key Constants
5859 public static final String ENDPOINT_DISABLE_DEVICE = "users/disableDevice" ;
@@ -110,8 +111,7 @@ public final class IterableConstants {
110111 public static final int SHARED_PREFS_ATTRIBUTION_INFO_EXPIRATION_HOURS = 24 ;
111112 public static final String SHARED_PREFS_FCM_MIGRATION_DONE_KEY = "itbl_fcm_migration_done" ;
112113 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" ;
115115
116116 //Action buttons
117117 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
675675
676676 server .enqueue (new MockResponse ().setResponseCode (200 ).setBody ("{\n " +
677677 " \" offlineMode\" : false,\n " +
678- " \" " + IterableConstants .SHARED_PREFS_OFFLINE_MODE_BETA_KEY + "\" : true,\n " +
678+ " \" " + IterableConstants .KEY_OFFLINE_MODE + "\" : true,\n " +
679679 " \" someOtherKey1\" : \" someOtherValue1\" \n " +
680680 " }" ));
681681 IterableActivityMonitor .getInstance ().unregisterLifecycleCallbacks (getContext ());
You can’t perform that action at this time.
0 commit comments