FireBase how to send push from server to Android?

take an example here https://gist.github.com/prime31/5675017 but I have a problem. wrote the handler for a push when the app is opened or minimized, the notification comes. but when closed/killed push comes. have tried a bunch of options.

still do not understand must come when the app is closed? or not, or comes not through php
March 19th 20 at 08:53
1 answer
March 19th 20 at 08:55
for Android needs to come push if the app is minimized, since FireBase sends a notification to the background stream of the device, on IOS ceases to move after some time after the application is minimized, since IOS'e, the background application thread is cut after a certain period of time (5-10 minutes, due to a limitation of the system itself). Server-side (PHP), establishes a connection with FireBas'ω, in the case of Android and APN'ω, in the case IOS'and by passing to it the connection parameters (credense application) and the receiver settings, IOS/Android device, and then the PHP connection cuts off and the control of sending push takes on FireBase. That is, PHP makes a connection to FireBase, transmits settings to it, cuts off the connection -> FireBase received parameters sent push> the number of times the device has received the push -> display.
the principle of operation is clear to me. I do not understand that while the app is open push comes. but if you close it or kill push comes! Although I must. everywhere I read that it needs to reach. Yes, take for example social networks, it works for them, but of course there is no guarantee that they use the push service - Jaden72 commented on March 19th 20 at 08:58
@Jaden72, Kaka platform?
if iOS you first need to generate keys in the Apple Developerc Conesole and collect the project and a corresponding provision profile-AMI as APNS (service that delivered push on iOS regardless open your app or not) will not pass if Firebase keys will not or they will not be the same.

if the Android that you want to test the manifest file on the subject of presence
<service
android:name=".java.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
 <action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
- bettie.Predovic commented on March 19th 20 at 09:01

Find more questions by tags FirebaseAndroid