In development mode the file structure is different than after bundling, so you should never rely on it. Particularly, you should not access your files directly like you're doing with path
methods.
Loading private assets is described in this section of Meteor's documentation. It mostly boils down to this method:
Assets.getBinary("certificate-file.pem");
and it's getText
counterpart.
As for configuring APN agent, see this section of documentation. You don't have to configure the agent by passing file path as cert file
param. Instead you may pass the raw data returned by Assets
methods directly as cert
. The same holds for key file
~ key
pair and other settings.
As an alternative, you would need to submit your files independently to the production server to a different folder than your Meteor app and use their global path. This, however, would not be possible for cloud providers like Heroku, so it's better to use assets in the intended way.