I use my own server, use FCM to push notifications to the ios device, push notifications are successful, I also use the Realm database system to help me store the fcm push n
You can store notifications into your database when your app is killed.
To access database using "App Group" use,
var fileMgr : FileManager!
let databasePathURL = fileMgr!.containerURL(forSecurityApplicationGroupIdentifier: "<APP_GROUPS_ID>")
From above code once you get the path for database, you can perform your insert operation into database. It would be your normal insert operation that you are performing.
Insert code for saving data in this file and in the method highlighted in below image.
For accessing your files into Extention follow the below image.
If you need any other help, Do let me know.