http://drupal.org/sandbox/lawik/1507982
So far only Drupal 6.
Git:git clone --branch 6.x-1.x lawik@git.drupal.org:sandbox/lawik/1507982.git apn
The APN module handles Apple Push Notifications through the ApnsPHP library and integrates it with the Drupal user system.
There are other solutions available that aren't exactly the same:
- Prowl - Uses Prowl
- Iphone Push Notification through Easyapns - Different library, no Services from what I've seen
- Push Notifications - Drupal 7, alpha only. Similar approach, no updates.
There will be a sister project for the Android notifications using C2DM.
Features:
- Register push key for a user (tested) or anonymously (experimental) using Services 2.x (tested and used), Services 3.x (experimental, untested) for Apple Push Notifications
- Send user push notifications (tested)
- Send anonymous push notifications (untested)
- Feedback handling (removal of dead push keys)
- Simple functions for connecting to Apple and sending notifications.
Requires the ApnsPHP library. This cannot to my knowledge be included as it is BSD-licensed.
To do
- A Drupal 7 port.
- Solid testing and evaluation of the Services 3.x version.
- Rules integration
I look forward to your feedback.
Reviews of other projects
Menu Performance http://drupal.org/node/1403872#comment-5936066
CSS Menu http://drupal.org/node/1289484#comment-5936152
Search Statistics http://drupal.org/node/1438844#comment-5936216
Comments
Comment #1
patrickd commentedWelcome!
Please remove your .gitignore from git and add itself to gitignore.
package = Apple Push NotificationsIs it really necessary to put your module into it's own category?while waiting for an in-depht review of your module you can start out fixing some coding style issues detected by automated tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxlawik1507982git
We do really need more hands in the application queue and highly recommend to get a review bonus so we will(/can) come back to your application sooner.
regards
Comment #2
lawik commentedThank you. Glad to finally make proper contributions.
.gitignore removed and .info-file rectified.
I've started on the coding standards. That Ventral site is meticulous. I know I cleared Coda for all the serious levels. I believe only minors remained.
I intend to assist with review if I can squeeze the hours into the day as I hope to have this out before Drupal Camp GBG (April 28th), but right now I'm on a train so my connection isn't nearly good enough ;)
Comment #3
novalnet commentedHi,
Manual Review :
1. Format should be "* Implements hook_foo()." or "Implements hook_foo_BAR_ID_bar() for xyz_bar()."
2. You should PARREVIEW your script. You have many errors.
See http://ventral.org/pareview/httpgitdrupalorgsandboxlawik1507982git
3. apn.module => contains Indent errors and also Inline comments must end in full-stops, exclamation marks, or question marks.
4. Data type of return value is missing at line 170 in apn.module.
5. 6 | ERROR | Additional blank line found at the end of doc comment
9 | ERROR | Class name must use UpperCamel naming without underscores
11 | ERROR | Expected 6 space(s) before asterisk; 9 found
12 | ERROR | Expected 6 space(s) before asterisk; 9 found
13 | ERROR | Expected 6 space(s) before asterisk; 9 found
13 | ERROR | Missing parameter type at position 1
13 | ERROR | Parameter comment must be on the next line at position 1
14 | ERROR | Expected 6 space(s) before asterisk; 9 found
15 | ERROR | Line indented incorrectly; expected 2 spaces, found 8
15 | ERROR | Variable "sMessage" is camel caps format. do not use mixed case
| | (camelCase), use lower case and _
16 | ERROR | Variable "sMessage" is camel caps format. do not use mixed case
| | (camelCase), use lower case and _
There are so many errors in your module.so please PARREVIEW before submiting to review.
Comment #4
adnasa commentedI'm wondering about the following
9 | ERROR | Class name must use UpperCamel naming without underscoresi've seen many active projects using underscores in class names.
why isn't this module allowed underscores?
regards,
curious adnasa asking.
Comment #5
lawik commentedI've noted some issues on my own (functional issues) as well so there will be some fixes along with those code style changes.
I'll look into the use of camelcase, there are some variables still named after ApnsPHP conventions (the library for this module).
Comment #6
lawik commentedGot cleanly through ventral.org and drupalcs. A bunch of improvements and corrections.
Comment #6.0
lawik commentedUpdated with project reviews.
Comment #7
lawik commentedReview bonus tag.
Comment #8
lawik commentedActually testing the notification functionality of this would require you to have an Apple Developer Account (for some certificates) and an app created to register with this module. It's a bit much to demand from the Project Applications queue reviewers.
I work with developers who use this module and I'll keep updating it when/if they run into problems with the Push Notifications. Before it was cleaned up for this publication it has been used heavily in production so that part I'm pretty sure of.
Just thought I'd clarify that.
Comment #9
klausiReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
manual review:
watchdog('apn', "Attempting to add message:<br />UID: $uid<br />Text: $text<br />Badge: $badge<br />Sound: $sound<br />Expiry: $expiry");": do not insert variables directly into translatable messages, use placeholders instead. And please use the "@" placeholder to automatically sanitize the input. Please check all your watchdog() calls.require_once dirname(__FILE__) . '/mymodule.inc';Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #10
lawik commentedVery good feedback. Much appreciated, slightly frustrating ;)
Comment #11
lawik commentedReally good feedback. The modules a lot better for it and I've learnt a lot. Well worth making a few reviews. I'll try and squeeze a few more in to get the bonus again soon.
Comment #12
lawik commentedBrilliant, failed to include the apn.admin.inc file in my commit.
Also need to update my README.
Comment #13
lawik commentedAdded the missing file (so now the site config-page works again) and updated the README.txt to properly reflect the new libaries integration.
Comment #14
lawik commentedAnother update. Functionality adjusted from additional live testing as well as correcting a half-change form element. Passed CodeSniffer and Coder.
Comment #15
fabsor commented1. It's not clear what apn_library_check() returns. The function name suggests that it will return either TRUE or FALSE, but it actually return the library path if it exists. Consider renaming the function.
2. You selects everything from the table in apn_status(), you could just do a count query and db_result(), which you do in other functions.
3. You use watchdog() extensively in several functions, but you don't return the actual status to the implementer. Consider failing early by throwing exceptions.
4. The watchdog function is called with invalid arguments in apn_register_key(), apn_unregister_key(), apn_unregister_key_unknown(), apn_user_disable() and apn_user_enable(). The severity variable is the fourth argument.
5. You have a minor coding standard issue in apn_send(). try should have a space after try.
6. You declare $push as a an instance of a specific class, but you do a check if it's actually an object in some functions. This is unnecessary since PHP will throw errors about that. This concerns apn_push_add_message(), apn_push_send() and apn_push_exit().
Comment #16
fabsor commentedAlso, you have a typo in apn_send():
@expriy shoudl be @expiry.
Comment #17
lawik commentedWell it took me a while to get back to this but now I've resolved everything fabsor pointed out. Ventral registers som new comment standard issues that I honestly will leave as they are right now.
Comment #18
klausiSorry for the delay. Make sure to review more project applications and get a new review bonus and this will get finished faster.
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
Otherwise looks RTBC.
Comment #19
klausino objections for more than a week, so ...
Thanks for your contribution, lawik!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #20.0
(not verified) commentedAdded another Review.
Comment #21
avpaderno