Vortex: add ApnsPHP dispatcher
Review Request #446 — Created May 26, 2016 and submitted
Information | |
---|---|
tardypad | |
Lunr | |
apns_php_dispatcher | |
|
|
Reviewers | |
lunr | |
The new ApnsPHP is pretty annoying to work with inside our notification structure in the end...
see http://reviews.lunr.nl/r/447/ as well for the response classIt's not straightforward to define the status of the push for each endpoint:
- the library only returns an error structure (in a weird format...) for the endpoints with a failure
- some invalid endpoints are detected early on before the push and we don't get them as part of this report (because they are detected in a different Message class)
- we can then assume that the notification was delivered successfully to the endpoints left
unit tests
-
-
src/Lunr/Vortex/APNS/ApnsPHP/APNSDispatcher.php (Diff revision 2) Not necessarily. It's a bit ugly since we have to honor Dependency Injection, but rather then pass the Message object in the constructor, we can re-instantiate a new one on every call to push().
We can do this by implementing a get_new_apns_message() method that returns the object. That way we can mock it (sort of).
Change Summary:
add get_new_apns_message function
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+208) |
Change Summary:
minor fixes
add unit tests
Description: |
|
|||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||
Depends On: |
|
|||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 4 (+742) |
Change Summary:
add set_internal_logger function
-
-
src/Lunr/Vortex/APNS/ApnsPHP/APNSDispatcher.php (Diff revision 5) I'd prefer use statements on top rather than absolute references in the code. Makes it slightly easier to see external dependencies.
-
src/Lunr/Vortex/APNS/ApnsPHP/APNSDispatcher.php (Diff revision 5) why do we need this?
I'd say this has no business here. The user can configure ApnsPHP however he/she wants before (or even after) passing it to the constructor of this class.
Change Summary:
put ApnsPHP class in use statements
remove set_internal_logger function
Diff: |
Revision 6 (+745)
|
---|