first of all environment is React native, I try to setup push notification in iOS following instruction from rnfirebase package here what step i do and I do testing on Real iPhone Device
and acivate capabillity
notification not delivered I didn't know what wrong because message also send from FCM and what happens on APNS where I get an error just confused
thank for advance
and also try by connecting directly with pusher
and also not received again
then try to use Onesignal with same certificate with Firebase is work even on the test message
The token you are using in Pusher doesn't look right. My tokens for remote notifications look like this.
I was just testing silent pushes, but the token would look similar for regular alerts. Here is the code I use to grab the token. My guess is that you are pushing a bad token up to FCM.
fileprivate func convertHexDataToString(_ data: Data) -> String {
var string: String = ""
for i in 0..<data.count {
string += String(format: "%02.2hhx", data[i] as CVarArg)
}
return string
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let tokenString = convertHexDataToString(deviceToken)
#if DEBUG
print("APN sandbox token: '\(tokenString)'")
Messaging.messaging().setAPNSToken(deviceToken, type: .sandbox)
#else
print("APN prod token: '\(tokenString)'")
Messaging.messaging().setAPNSToken(deviceToken, type: .prod)
#endif
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With