I used onesignal to send notification to my app. The app work perfect when I send notification and its open. Unfortunately the app not receive notification when it closed even I set broadcast receiver.
<receiver
android:name="com.onesignal.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<receiver android:name="com.onesignal.BootUpReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
<service android:name="com.onesignal.GcmIntentService" />
<service
android:name="com.onesignal.SyncService"
android:stopWithTask="false" />