@@ -220,47 +220,39 @@ public static PushType getPushType() {
220
220
} else {
221
221
pushType = PushType .NONE ;
222
222
223
- // Emit warnings if the client doesn't get push due to misconfiguration of the manifest.
224
- if (hasAnyGcmSpecificDeclaration && !hasRequiredGcmDeclarations ) {
223
+ if (hasAnyGcmSpecificDeclaration ) {
224
+ if (!hasPushBroadcastReceiver ) {
225
+ /* Throw an error if someone migrated from an old SDK and hasn't yet started using
226
+ * ParsePushBroadcastReceiver. */
227
+ PLog .e (TAG , "Push is currently disabled. This is probably because you migrated from " +
228
+ "an older version of Parse. This version of Parse requires your app to have a " +
229
+ "BroadcastReceiver that handles " + ParsePushBroadcastReceiver .ACTION_PUSH_RECEIVE +
230
+ ", " + ParsePushBroadcastReceiver .ACTION_PUSH_OPEN + ", and " +
231
+ ParsePushBroadcastReceiver .ACTION_PUSH_DELETE + ". You can do this by adding " +
232
+ "these lines to your AndroidManifest.xml:\n \n " +
233
+ " <receiver android:name=\" com.parse.ParsePushBroadcastReceiver\" \n " +
234
+ " android:exported=false>\n " +
235
+ " <intent-filter>\n " +
236
+ " <action android:name=\" com.parse.push.intent.RECEIVE\" />\n " +
237
+ " <action android:name=\" com.parse.push.intent.OPEN\" />\n " +
238
+ " <action android:name=\" com.parse.push.intent.DELETE\" />\n " +
239
+ " </intent-filter>\n " +
240
+ " </receiver>" );
241
+ }
242
+ if (!isGooglePlayServicesAvailable ) {
243
+ PLog .e (TAG , "Cannot use GCM for push on this device because Google Play " +
244
+ "Services is not available. Install Google Play Services from the Play Store." );
245
+ }
246
+ // Emit warnings if the client doesn't get push due to misconfiguration of the manifest.
247
+ if (!hasRequiredGcmDeclarations ) {
225
248
/*
226
249
* If we detect that the app has some GCM-specific declarations, but not all required
227
250
* declarations for GCM, then most likely the client means to use GCM but misconfigured
228
251
* their manifest. Log an error in this case.
229
252
*/
230
- PLog .e (TAG , "Cannot use GCM for push because the app manifest is missing some " +
231
- "required declarations. Please " + getGcmManifestMessage ());
232
- } else if (!hasPushBroadcastReceiver &&
233
- (hasRequiredGcmDeclarations || hasRequiredPpnsDeclarations )) {
234
- /* Throw an error if someone migrated from an old SDK and hasn't yet started using
235
- * ParsePushBroadcastReceiver. */
236
- PLog .e (TAG , "Push is currently disabled. This is probably because you migrated from " +
237
- "an older version of Parse. This version of Parse requires your app to have a " +
238
- "BroadcastReceiver that handles " + ParsePushBroadcastReceiver .ACTION_PUSH_RECEIVE +
239
- ", " + ParsePushBroadcastReceiver .ACTION_PUSH_OPEN + ", and " +
240
- ParsePushBroadcastReceiver .ACTION_PUSH_DELETE + ". You can do this by adding " +
241
- "these lines to your AndroidManifest.xml:\n \n " +
242
- " <receiver android:name=\" com.parse.ParsePushBroadcastReceiver\" \n " +
243
- " android:exported=false>\n " +
244
- " <intent-filter>\n " +
245
- " <action android:name=\" com.parse.push.intent.RECEIVE\" />\n " +
246
- " <action android:name=\" com.parse.push.intent.OPEN\" />\n " +
247
- " <action android:name=\" com.parse.push.intent.DELETE\" />\n " +
248
- " </intent-filter>\n " +
249
- " </receiver>" );
250
- } else if (hasPushBroadcastReceiver
251
- && hasRequiredGcmDeclarations
252
- && !isGooglePlayServicesAvailable ) {
253
- PLog .e (TAG , "Cannot use GCM for push on this device because Google Play " +
254
- "Services is not installed. Install Google Play Service from the Play Store, " +
255
- "or enable PPNS as a fallback push service." +
256
- "\n To enable PPNS as a fallback push service on devices without Google Play " +
257
- "Service support, please include PPNS.jar in your application and " +
258
- getPpnsManifestMessage ());
259
- } else if (hasPushBroadcastReceiver
260
- && hasRequiredPpnsDeclarations
261
- && !isPPNSAvailable ) {
262
- PLog .e (TAG , "Cannot use PPNS for push on this device because PPNS is not available. " +
263
- "Include PPNS.jar in your application to use PPNS." );
253
+ PLog .e (TAG , "Cannot use GCM for push because the app manifest is missing some " +
254
+ "required declarations. Please " + getGcmManifestMessage ());
255
+ }
264
256
}
265
257
}
266
258
0 commit comments