Push notification Android/iOS with Asterisk

Hi ! I’m building a voip Android/iOS app (Flutter) and now I want to add a push notification system. I read some posts on this, I have an idea and I want to know if it’s possible or not …
I want to use FirebaseMessaging because it’s working for iOS and Android. I saw many scripts like this : ios - how to send push notifications to iphone using fcm(firebase console) in PHP? - Stack Overflow.
My question is can I use this type of script in AGI command like :

  • AGI(“push.php”)
  • WAIT(5)
    -DIAL(NUMBER)

An other thing is how to save the token for each phone number. I saw that we can put the FCM/APNS token in the header of REGISTER request. Asterisk provide a way to take it ? Is it possible ?

My idea was to use the firebase database, the phone put his number phone and token in the table and asterisk read it with a script and take the good token.

So if someone have some experience on this, or a better way to do this, I’m listening :slight_smile: