How I migrated to FCM from GCM/APN

Push notification Architecture

Step 01: Create the FCM project

Step 02: Creates a lib file to handle the FCM service

ENV['FCM_AUTH_KEY']
URL:  https://fcm.googleapis.com/fcm/sendheader: {
'Content-Type': 'application/json',
'Authorization': "key=#{@fcm_token}"
}
data: {
'data': data_in_JSON
}
fcm_sender.rb

Step 03: Create classes to handle both Android/iOS

Step 04: Handle the response

{"multicast_id":6953102881003652604,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":""}]}
{"multicast_id":8656242266114418762,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":""}]}

Things to Remember

ps aux | grep rpush
kill -9 the-pid-number

Problems I face

--

--

Developer ❤️ JS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store