Skip to content

Commit 331f977

Browse files
committed
feat(manifest): fixing pr comments
1 parent ebb0800 commit 331f977

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

AndroidSDK/src/com/leanplum/LeanplumFcmProvider.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,17 @@ public boolean isManifestSetup() {
5353
if (context == null) {
5454
return false;
5555
}
56-
57-
if (!BuildConfig.DEBUG) {
58-
return true;
59-
}
6056
// Firebase can only be setup through gradle, so we don't have to check manually
6157
// whether manifest is properly setup. We will only check our own services.
6258
try {
6359
boolean hasPushFirebaseMessagingService = LeanplumManifestHelper.checkComponent(
6460
LeanplumManifestHelper.ApplicationComponent.SERVICE,
65-
LeanplumPushFirebaseMessagingService.class.getName(), false, null,
61+
LeanplumManifestHelper.PUSH_FIREBASE_MESSAGING_SERVICE, false, null,
6662
Collections.singletonList(LeanplumManifestHelper.MESSAGING_EVENT), context.getPackageName());
6763

6864
boolean hasPushFirebaseListenerService = LeanplumManifestHelper.checkComponent(
6965
LeanplumManifestHelper.ApplicationComponent.SERVICE,
70-
LeanplumPushFcmListenerService.class.getName(), false, null,
66+
LeanplumManifestHelper.PUSH_FCM_LISTENER_SERVICE, false, null,
7167
Collections.singletonList(LeanplumManifestHelper.INSTANCE_ID_EVENT), context.getPackageName());
7268

7369
boolean hasRegistrationService = LeanplumManifestHelper.checkComponent(
@@ -82,7 +78,7 @@ public boolean isManifestSetup() {
8278
Util.handleException(t);
8379
}
8480
Log.e("Failed to setup Firebase Messaging, check your manifest configuration.");
85-
return true;
81+
return false;
8682
}
8783

8884
@Override

AndroidSDK/src/com/leanplum/LeanplumGcmProvider.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ class LeanplumGcmProvider extends LeanplumCloudMessagingProvider {
4949

5050
private static String senderIds;
5151

52+
/**
53+
* Sets GCM sender id.
54+
*
55+
* @param senderId Sender id.
56+
*/
5257
static void setSenderId(String senderId) {
5358
senderIds = senderId;
5459
}
5560

56-
/**
57-
* Stores the GCM sender ID in the application's {@code SharedPreferences}.
58-
*
59-
* @param context application's context.
60-
*/
6161
@Override
6262
public void storePreferences(Context context) {
6363
super.storePreferences(context);
@@ -119,10 +119,6 @@ public boolean isManifestSetup() {
119119
if (context == null) {
120120
return false;
121121
}
122-
// We don't want to check if manifest is setup in Release build.
123-
if (!BuildConfig.DEBUG) {
124-
return true;
125-
}
126122
try {
127123
boolean hasPermissions = LeanplumManifestHelper.checkPermission(LeanplumManifestHelper.RECEIVE_PERMISSION, false, true)
128124
&& (LeanplumManifestHelper.checkPermission(context.getPackageName() + ".gcm.permission.C2D_MESSAGE", true, false)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public class LeanplumManifestHelper {
5555

5656
// Leanplum
5757
public static final String PUSH_LISTENER_SERVICE_FILTER = "com.leanplum.LeanplumPushListenerService";
58+
public static final String PUSH_FCM_LISTENER_SERVICE = "com.leanplum.LeanplumPushFcmListenerService";
59+
public static final String PUSH_FIREBASE_MESSAGING_SERVICE = "com.leanplum.LeanplumPushFirebaseMessagingService";
5860

5961
/**
6062
* Gets Class for name.

0 commit comments

Comments
 (0)