How to upload token to send push notifications from Firebase console

I am looking for a way to take the users device notification FCM token and upload it to firebase. I know how to do an API call to firebase to save the data to Firebase Realtime Database, but I am not sure where/how to get the token.

Ultimate what we want to do is be able to send push notifications to devices from either a cloud function or the Firebase console. We understand push notifications can be sent within Kodika, but that is not feasible once we go into production. If you could show me what is needed to upload the device id/token. Also, this needs to work on both iOS and Android (I believe your program allows publishing to both platforms)

Hi,
To manually handle the FCM Token in your Kodika application, you first need to create a Model.
In our example we named it Model To Handle Push Notifications.

Then you need to open the newly created Model, go to Protocols and select the Handle Push Notifications Protocol

Proceed and add the Handle Push Notification Registration Token function.
In this function you can write the Logic needed to handle the passed parameter Token

Finally, you need to go to the Push Notifications menu


and at the bottom select the Model that you just created
image

Now, every time a new FCM Token is fetched, it will be used in your Model and you can send it to your database through the Handle Push Notification Registration Token function.

Note: During development the token will be from your relevant Kodika Server, so you will not be able to send notifications to it.

Thank you for this, I will construct this today. How do I get my app up to testflight to have my other partners test it, and test real notifications? Can I use Kodika notifications while developing?

Hi,
yes you can use Kodika Server to test notifications. Are you going also handle the notifications?

Yes, I would like to write a function in the app to handle both test and production notifications. I assume while in development, I cannot send a push notification from a cloud function?

I can give you access to our Zapier integration if you want, but you need to have a Zapier account.

Ahh I see, OK, if you could do that and I will set up an account with Zapier

I have set up a Zapier account

The upload doesn’t seem to work, it could be my API call however. Is there anything I need to do to call this model or request permissions?

Yes,
You need to use the Request Push Notifications Permissions Block or Action.
You can check also this video

It has the full process to send Push, but you can check the first steps.

I requested the permissions and that now works, but how do I get the function inside the model to trigger?

This is still not working for me, the token is not uploading, and I have no way to see if its an issue with my API call or I did the function wrong. You know how XCODE has a black window you can see everything processing with the app, does Kodika have that?

I need to set up a time with you for the empty arrays, so I’d also like to get some help with this, this is huge.