You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 27, 2020. It is now read-only.
@j4nos. I see no one answer, but I'll tell you what I did.
I am very new to Vapor, APNS and Heroku. Just for proof of concept, I was able to get an APNS concept of registering device tokens and sending simple notifications on Heroku through VaporAPNS.
Before Heroku.. my server and client had been working while running on my local Xcode version with a hardcoded path to the .p8 certificate on my Mac. I had created a folder Certs and dropped my .p8 certificate in there.
I did not add either the Certs folder nor the .p8 certificate itself to a target since that seemed to be Xcode specific.
When I went through the steps of getting the project on Heroku, I was able to verify the file existence in my Heroku instance.
$ heroku run bash
$ ls
Certs Config Package.pins Package.resolved Package.swift ....
In my setup for VaporAPNS I modified my code to use workingCopy() in the setupRoutes func for the Routes.swift
let certificateKeyPath = workingDirectory() + "Certs/AuthKey_6P4E36PTHF.p8"
let vaporOptions = try Options(topic: Constants.topic, teamId: Constants.teamID, keyId: Constants.CertificateKeyID, keyPath: certificateKeyPath)
let vaporAPNS = try VaporAPNS(options: vaporOptions)
Aside
I finally got it working, but the biggest problem which I initially missed what the lack of support of HTTP2 in the curl build. I tried vaporOptions.forceCurlInstall. That kept failing, so I researched more and used a buildpack that resolved my issues. https://github.com/vzsg/heroku-buildpack-curl-http2
Again, I am super new to this, so I may not be doing this the correct way. I'll continue to research and take input for anyone who comments.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to use with Heroku. Which target I need to select to attach APNsAuthKey_AQ34EHZCDQ.p8 file, Run or frozen-sea-xxx or App?
Which keyPath I need to set be able to use with Heroku?
I attached
APNsAuthKey_AQ34EHZCDQ.p8
file finally to the root of frozen-sea-xxx project.The text was updated successfully, but these errors were encountered: