Unable to retrieve device token on iOS app

177 Views Asked by At

We have use-case where we need to send push notification from our backend to buildfire application. And in order to do so, we would need device token on backend.

We tried to extract it using following function in custom plugin but we are getting its value as empty string. We tested this in TestFlight build.

buildfire.getContext(function (err, result) {
  console.log(result.deviceId)
}

We have uploaded firebase certificate to Buildfire and have also linked APNs to it.

If anyone can guide us with this, it will be a great help.

1

There are 1 best solutions below

6
blue On

context.deviceId is not a supported property. Following are the supported documented properties in context: https://sdk.buildfire.com/docs/context/#data

You can also take a look at https://sdk.buildfire.com/AWSGatewayPublicAPI/#/push_notifications and https://sdk.buildfire.com/docs/push-notifications/#schedule to see how push notifications can be triggered from a server or device.