Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Which keypath need to Heroku? #61

Open
j4nos opened this issue Oct 5, 2017 · 1 comment
Open

Which keypath need to Heroku? #61

j4nos opened this issue Oct 5, 2017 · 1 comment

Comments

@j4nos
Copy link

j4nos commented Oct 5, 2017

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?

kepernyofoto 2017-10-05 - 15 37 28

kepernyofoto 2017-10-05 - 15 37 19

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.

@j4nos j4nos changed the title How to set up with Heroku? Which key path need to Heroku? Oct 5, 2017
@j4nos j4nos changed the title Which key path need to Heroku? Which keypath need to Heroku? Oct 5, 2017
@Danny-SS
Copy link

@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.

screen shot 2017-11-28 at 2 36 15 pm

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 free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants