Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for P8 certificate apple push notifications #386

Merged
merged 11 commits into from
Jun 12, 2018

Conversation

mariannegru
Copy link
Collaborator

@mariannegru mariannegru commented Nov 3, 2017

Apple push notifications using authentication tokens

http://help.apple.com/xcode/mac/current/#/dev54d690a66

@@ -14,3 +14,4 @@ def self.down
drop_table :rapns_apps
end
end
x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this was mistakenly added here?

README.md Outdated
```ruby
app = Rpush::Apnsp8::App.new
app.name = "ios_app"
app.apn_key = File.read("/path/to/sandbox.pem")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it a .p8 file?

@aried3r
Copy link
Member

aried3r commented Dec 4, 2017

Thanks for your PR! Sadly I cannot test this myself as I don't use APNS myself, but I'll try to have a closer look soon.

@soulfly
Copy link

soulfly commented Dec 5, 2017

@mariannegru could you please provide more information in description for this PR, e.g. Apple links to what is P8 and how to generate it. Will be useful for testing. thanks!

@sveredyuk
Copy link

I can test this, because I need APNS token support

* upstream/master:
  Prepare 3.0.2 release
  Add 3.0.1 migration to test suite
  use actual table name
  Prepare 3.0.1 release
  Update dependencies
  Add changelog for 3.0.1
  Update rubies

# Conflicts:
#	spec/support/active_record_setup.rb
@sveredyuk
Copy link

@mariannegru Good job. I am testing it right now. Got Errno::ECONNRESET, Connection reset by peer. It's because of wrong credentials ?

@mariannegru
Copy link
Collaborator Author

mariannegru commented Jan 25, 2018

@sveredyuk Can you check in sql if the apn_key is set? Must be something with -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY-----

You need to make sure you have all the values present: apn_key, apn_key_id ,team_id, bundle_id

I use fastlane to generate p8 files.

@sveredyuk
Copy link

Yes, apn_key is present and valid (i got it from apple dev site), JWT token is generating but response Errno::ECONNRESET, Connection reset by peer

@mariannegru
Copy link
Collaborator Author

Are you testing development or production? Maybe the device token is not for the right environment.

@sveredyuk
Copy link

for production, we are using production env even on staging devices

@mariannegru
Copy link
Collaborator Author

If you run the app from xcode I think you should use the development environment and make sure you have the rpush app configured for development.
Seams the Errno::ECONNRESET is retuned by inactivity or when you send device tokens to different environments.

We have it for 46 apps in production and is working fine.

@lenart
Copy link

lenart commented Mar 14, 2018

Hey @mariannegru. What's holding this PR from being merged into master?

@aried3r
Copy link
Member

aried3r commented Mar 14, 2018

I think it should be rebased once more to see if the issues with CI were fixed in master. Then I'd be open to merging this as an experimental feature. I have no way of testing this myself.

I'd rather have more people try out this feature as "experimental" than rely on people manually trying out this branch.

* upstream/master:
  fixes rpush#416
  @notification.app triggers loading of association :app
  Add Gemfile.lock to .gitignore
  Use newest modis and rpush-modis
  Add newly generated gemfiles
  Limit pg gem for some test setups
  Remove Gemfile.lock
  Update .travis.yml to test using Ruby 2.5
  Add sandbox URL to ApnsHttp2 dispatcher
@sveredyuk
Copy link

We are waiting for this MR to be merged. I could test it again

@mariannegru
Copy link
Collaborator Author

@sveredyuk did you tested this again?

@sveredyuk
Copy link

@mariannegru just planed to test on weekend.

@aried3r
Copy link
Member

aried3r commented Apr 11, 2018

Hey! Sorry for the long silence. I am currently preparing a 3.1.0 release and will try to tackle this next for a 3.2.0.

Unfortunately there are now some (expected) conflicts. If I find the time I'll try to resolve them myself, but I'd appreciate any help. One thing that would have to be changed is the name of the migration (rpush_3_2_0_add_apns_p8 instead of just the add_apns_p8).

* upstream/master:
  Add some info about the auth_key
  Update CHANGELOG.md
  Update CHANGELOG.md
  Re-add Gemfile.lock to repo. Fixes rpush#425
  Prepare 3.1.1 release
  Use latest gem release on Travis
  Add changelog entry [ci skip]
  Changed pluck(:id) to .ids
  rpush_notifications active_record performance improvements
  Prepare 3.1.0 release
  Update CHANGELOG.md [ci skip]
  Add support for Pushy service

# Conflicts:
#	lib/generators/rpush_migration_generator.rb
#	lib/rpush/client/redis/app.rb
#	spec/support/active_record_setup.rb
@mariannegru
Copy link
Collaborator Author

@aried3r Sorry for the delay, I've merged the latest and renamed to migrations to the next release

@aried3r
Copy link
Member

aried3r commented May 23, 2018

Awesome! Thank you, I'll have another look and hope to merge it soon when I get the time.

@aried3r aried3r mentioned this pull request Jun 12, 2018
@aried3r aried3r merged commit 59d282e into rpush:master Jun 12, 2018
@aried3r aried3r mentioned this pull request Jun 13, 2018
@aried3r aried3r mentioned this pull request Jul 11, 2018
@rofreg rofreg mentioned this pull request Jan 16, 2019
@jhottenstein jhottenstein mentioned this pull request Feb 5, 2019
Adrian1707 pushed a commit to Adrian1707/rpush that referenced this pull request Apr 24, 2024
Added support for P8 certificate apple push notifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants