How to Send Push Notification to Apns from iOS Device

Is it possible to send push notification through APNS to device token generated via FCM?

No. Api.sandbox.push.apple.com can only be used with Tokens generated by Apple. You need to fetch the Apple token in the client using didRegisterForRemoteNotificationsWithDeviceToken and send it to your server.
BTW, the Firebase SDK does exactly that and fetches this token in order to send iOS notifications. For each FireBase token they fetch the relevant Apple token from the device and use it when connecting to the Apple servers.

When to use iOS device token when sending push notifications through FCM?

Only an FCM token is required to send a message to a device. There is no Apple-specific data required. Firebase handles the details of each underlying push notification system.

Can I send Push Notifications to Other Devices with APNS Dev iOS certificate?

Pushes go out over two environments - development and production and they are not interchangeable - i.e. if you send out a push to the Apple development server intended for a release build app it won't work and vice versa.
Apps installed and run via Xcode are debug builds and you need to send the push via the dev server, an app built for distribution is a prod build and thus the pushes need to go to the prod server.

As you are probably aware the url for the two servers is different.

Needless to say the server needs to be signed with both the prod and dev push certificates for the server to be able to send pushes on both environment.

BTW the two environments do not behave the same in terms of delivery speed etc. But this is only really noticeable for silent pushes, where bizarrely the dev environment is better than the prod one.

Push Notifications without Apple Push Notification Service?

Apple requires you to use APNS to send push notifications to devices. This cannot be done without APNS, if you found a way around this then Apple would most likely reject the app.

Click here to read the documentation. When you register for push notifications you are actually getting the device token for your app on that specific device from APNS, therefore that is an APNS specific token and you will need to use APNS to send the notification.

Does FCM send push notification dicrectly or it sends message to APNS?

The idea behind using Firebase Cloud Messaging to deliver push notifications to both Android and iOS devices is that implementing one server-side interface that sends all your push notifications (regardless of the platform) to one end-point should require less effort than implementing 2 server-side interfaces each sending to a different end-point and implementing a different API.

This is true regardless of whether or not FCM forwards the iOS messages to APNS or delivers them directly to the iOS devices.



Related Topics



Leave a reply



Submit