Skip to content

Commit cab1532

Browse files
authored
feat(push): fixing component check (#88)
fixing component check using correct intent filter
1 parent e5fccdb commit cab1532

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

AndroidSDK/src/com/leanplum/LeanplumFcmProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public boolean isManifestSetup() {
5757
try {
5858
boolean hasPushReceiver = LeanplumManifestHelper.checkComponent(LeanplumManifestHelper.ApplicationComponent.RECEIVER,
5959
LeanplumManifestHelper.LP_PUSH_RECEIVER, false, null,
60-
Collections.singletonList(LeanplumManifestHelper.LP_PUSH_FCM_LISTENER_SERVICE), context.getPackageName());
60+
Collections.singletonList(LeanplumManifestHelper.LP_PUSH_FCM_MESSAGING_SERVICE), context.getPackageName());
6161

6262
boolean hasPushFirebaseMessagingService = LeanplumManifestHelper.checkComponent(
6363
LeanplumManifestHelper.ApplicationComponent.SERVICE,

AndroidSDK/src/com/leanplum/internal/LeanplumManifestHelper.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,11 @@ public static boolean wasComponentEnabled(Context context, PackageManager packag
157157
}
158158
int componentStatus = packageManager.getComponentEnabledSetting(new ComponentName(context,
159159
clazz));
160-
return PackageManager.COMPONENT_ENABLED_STATE_DEFAULT == componentStatus ||
161-
PackageManager.COMPONENT_ENABLED_STATE_DISABLED == componentStatus;
160+
if (PackageManager.COMPONENT_ENABLED_STATE_DEFAULT == componentStatus ||
161+
PackageManager.COMPONENT_ENABLED_STATE_DISABLED == componentStatus) {
162+
return false;
163+
}
164+
return true;
162165
}
163166

164167
/**

0 commit comments

Comments
 (0)