How can I use FCM with iOS devices?

It is possible to get an FCM registration token by using the Firebase iOS SDK in the app. You can then use this token to register the device manually, like below:

 

let deviceDetails = ARTDeviceDetails(id: ULID().ulidString)
deviceDetails.secret = generateSecret()
deviceDetails.platform = "android" //or "ios"
deviceDetails.formFactor = "tablet" //or "phone", "tv", "watch", "desktop", "tablet", "car"
deviceDetails.clientId = "clientA"
deviceDetails.metadata = NSMutableDictionary()
deviceDetails.push.recipient = [
"transportType": "gcm", //or "apns"
"registrationToken": "xx"
]

rest.push.admin.deviceRegistrations.save(deviceDetails) { error in
if let error = error {
print(error)
}
else {
print("Success")
}
}

 

It is important that you save the device details, as at present the local device will default to APNs.