Skip to content

Commit 24ca254

Browse files
committed
[MOB-9446] Logic fix
1 parent 9022279 commit 24ca254

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,10 @@ public void onSwitchToBackground() {}
392392
private void onForeground() {
393393
if (!_firstForegroundHandled) {
394394
_firstForegroundHandled = true;
395-
fetchRemoteConfiguration();
396-
397395
if (sharedInstance.config.autoPushRegistration && sharedInstance.isInitialized()) {
398396
sharedInstance.registerForPush();
399397
}
398+
fetchRemoteConfiguration();
400399
}
401400

402401
boolean systemNotificationEnabled = NotificationManagerCompat.from(_applicationContext).areNotificationsEnabled();
@@ -407,11 +406,11 @@ private void onForeground() {
407406
if (!systemNotificationEnabled) {
408407
sharedInstance.disablePush();
409408
}
410-
}
411409

412-
SharedPreferences.Editor editor = sharedPref.edit();
413-
editor.putBoolean(IterableConstants.SHARED_PREFS_DEVICE_NOTIFICATIONS_ENABLED, systemNotificationEnabled);
414-
editor.apply();
410+
SharedPreferences.Editor editor = sharedPref.edit();
411+
editor.putBoolean(IterableConstants.SHARED_PREFS_DEVICE_NOTIFICATIONS_ENABLED, systemNotificationEnabled);
412+
editor.apply();
413+
}
415414
}
416415

417416
private boolean isInitialized() {

0 commit comments

Comments
 (0)