I ended up copying the AWS-S3 file to the Heroku app, use the copied version (since it is local), and then delete the copied file once the notifications were sent.
fname = "tempfile.pem"
# open the file, and copy the contents from the file on AWS-S3
File.open(fname, 'wb') do |fo|
fo.print open(AWS::S3::S3Object.url_for(LOCATION_ON_S3, BUCKET_NAME)).read
end
file = File.new(fname)
# use the newly created file as the PEM file for the APNS gem
APNS.pem = file
device_token = '<a4e71ef8 f7809c1e 52a8c3ec 02a60dd0 b584f3d6 da51f0d1 c91002af 772818f2>'
APNS.send_notification(device_token, :alert => 'New Push Notification!', :badge => 1, :sound => 'default')
# delete the temporary file
File.delete(fname)
On second thoughts, I could've used private assets like in this question — Where to put private documents to use in Rails applications?, but even the answer mentions that AWS-S3 is probably a better idea.