Comments (8)
The way that certificates are stored with the application has changed fundamentally. We are talking about adding the ability to use the old-style APIs and treat your application as a single-app, but for right now this is not possible with the latest version.
Almost every change made to the gem for the latest version was to allow multiple apps, so if you are dealing with a single app, you might consider using the last version.
I will be leaving this issue open for consideration in the next release.
from apn_on_rails.
Is there an upgrade path to convert from the previous setup to new setup -- or is just "manually create an app record with your keys"?
from apn_on_rails.
I'm not that familiar with the code, but I think it is a manual process. You'll have to create an app with your keys, and associate all the old devices with your new app.
from apn_on_rails.
ruby script/console
> a = APN::App.new
> a.apn_dev_cert = File.read('......_push.pem')
> a.save
hope this help
from apn_on_rails.
The above comments correctly show how to create an app. But in order to make the app compatible with existing implementations without code changes the current version (0.4.1) now allows devices not associated with an APN::App and uses the certs stored in the config directory to send notifications addressed to those apps.
Thanks for the feedback leading to this change.
from apn_on_rails.
It appears that notifications are now sent via rake task, rather than as they are created - but with the fix to allow "single app" code, there are no App records for the rake task to find, and thus there are no notifications sent?
from apn_on_rails.
Hi,
The notifications can be sent by calling a method or by calling a rake task that calls a method. This has not changed in this version or in the 4.0 update. They are, as you note, not sent when they are created.
The APN::App.send_notifications method will send all unsent notifications for any APN::Apps and also any unsent notifications that are not associated with an APN::App. So even if you have not created any APN::App instances, you should call the APN::App class method to send your notifications. The old method that I deprecated (I think it is APN::Notification.send_notifications or something like that) prints a deprecation message but also calls the APN::App.send_notifications method so even if you don't change from old code that calls the deprecated method your notifications should still send.
I can't tell from your message whether you are finding that your notifications are not being sent when you call APN::App.send_notifications. I tested it out in the context of a larger Rails app using both devices/notifications not associated with an APN::App instance and ones that were. I was able to send the notifications in both cases. But of course there is always the possibility of a bug!
Thanks,
Rebecca
from apn_on_rails.
Yeah...just noticed that. I think I actually have an issue with ssl certs in my app. I'll report back here if I can't get it to work, but I see no reason why it won't work like you just described, now that I check out the code.
from apn_on_rails.
Related Issues (20)
- Group notification example HOT 3
- Rails 3.2 and self.table_name HOT 4
- Certificate issues which aren't found on other libraries HOT 5
- Login button HOT 1
- Rename create_groups.rb to create_apn_groups.rb HOT 1
- apn:install generator not working on rails 2.3.14 HOT 1
- Fix confusing README.textile HOT 6
- Can't make app = APN::App.create(:apn_dev_cert => "MY_DEV_CERT.pem", :apn_prod_cert => "MY_PROD_CERT.pem") HOT 4
- Neither PUB key nor PRIV key:: not enough data HOT 1
- uninitialized constant APN::App::RAILS_ENV HOT 13
- Cannot send notification because of Broken Pipe error HOT 1
- Sound off HOT 2
- applications based on different Rails.env couldn't be recognised
- Triggering APN on New Message
- Remove/Change puts log message
- apn_bases table not exist
- Only the first notification in each batch is being sent HOT 1
- notification delivery fails if any part of the message contains UTF-8 characters
- Unable to use APN with multiple apps because connection.rb hard-wired to use configatron HOT 1
- "ruby script/rails generate apn_on_rails:install" is error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apn_on_rails.