Skip to content

Commit 3bb5cea

Browse files
author
Evan Greer
committed
update system notification updates to call disable push
1 parent b50db73 commit 3bb5cea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class IterableApi {
5050
private String inboxSessionId;
5151
private IterableAuthManager authManager;
5252
private HashMap<String, String> deviceAttributes = new HashMap<>();
53-
private IterableKeychain keychain;
53+
public IterableKeychain keychain;
5454

5555
void fetchRemoteConfiguration() {
5656
apiClient.getRemoteConfiguration(new IterableHelper.IterableActionHandler() {
@@ -395,7 +395,11 @@ private void onForeground() {
395395
boolean isNotificationEnable = sharedPref.getBoolean(IterableConstants.SHARED_PREFS_DEVICE_NOTIFICATIONS_ENABLED, false);
396396
if (sharedInstance.config.autoPushRegistration && sharedInstance.isInitialized() && isNotificationEnable != systemNotificationEnabled) {
397397
IterableLogger.d(TAG, "Performing automatic push registration");
398-
sharedInstance.registerForPush();
398+
if(systemNotificationEnabled) {
399+
sharedInstance.registerForPush();
400+
} else {
401+
sharedInstance.disablePush();
402+
}
399403
}
400404
fetchRemoteConfiguration();
401405

0 commit comments

Comments
 (0)