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

feat: add support for Pushy push notifications #254

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ce1eff4
fix: move token generation to agent (#1)
dballance Feb 1, 2023
ae61126
chore: undo random formatting changes that aren't necessary
jmhossler Mar 17, 2023
757e948
feat: implement a pushy push notification adapter
jmhossler Mar 20, 2023
bb265f9
fix: implement connect_socket method
jmhossler Mar 20, 2023
2aa8eee
feat: add pushy notification constructor
jmhossler Mar 20, 2023
4c3abe2
fix: do @spec new instead of @new smh
jmhossler Mar 20, 2023
917711f
fix: add return type to new spec
jmhossler Mar 20, 2023
b0f48c6
fix: update connect parameters and add docs link in mix
jmhossler Mar 20, 2023
fa4b59d
debug: add error log so I can tell why connection to pushy isn't working
jmhossler Mar 20, 2023
addf2ae
fix: require logger in pushy dispatcher
jmhossler Mar 20, 2023
f4c279c
fix: do a regular inspect of the error instead when connecting to pushy
jmhossler Mar 20, 2023
a39adde
fix: adjust socket connection settings to attempt to resolve handshak…
jmhossler Mar 20, 2023
ff3ed8a
refactor: don't use socket when connecting to pushy, just make http r…
jmhossler Mar 20, 2023
3c89181
fix: correctly call pushy_headers and remove unnecessary match
jmhossler Mar 20, 2023
d725ba5
fix: use notification encode_requests to encode the payload
jmhossler Mar 20, 2023
73cea75
fix: move over encoding logic so I can encode properly
jmhossler Mar 20, 2023
e42caab
fix: remove unmatched curly brace and use correct encode request impl
jmhossler Mar 20, 2023
839ac03
fix: don't pass in more params than necessary to error.parse
jmhossler Mar 20, 2023
c062ec2
fix: correct the pushy path for pushing notifications
jmhossler Mar 21, 2023
f7230b1
fix: remove error parse on good data, just return response from pushy
jmhossler Mar 21, 2023
a7d40d8
fix: pass notification around appropriately in do_push for pushy
jmhossler Mar 21, 2023
be63a72
feat: add result parser to handle both error and success cases
jmhossler Mar 21, 2023
1f8985b
fix: add additional notification fields to hold response info
jmhossler Mar 21, 2023
c9ec79a
fix: address some invalid variable refs and remove unused param from …
jmhossler Mar 21, 2023
0884f66
fix: pass the resulting json instead of some fictitious result parser…
jmhossler Mar 21, 2023
83bf249
fix: handle case where failed devices might not be included
jmhossler Mar 21, 2023
29fba72
fix: remove old reference to failed devices
jmhossler Mar 21, 2023
5b19e6d
fix: parse errors into notification structs instead of just atom
jmhossler Mar 21, 2023
bf90370
feat: add helper methods for filling in additional parameters for pus…
jmhossler Mar 21, 2023
7af0b96
fix: add missing empty curly bracket and format files
jmhossler Mar 21, 2023
72c33cf
docs(pushy): add documentation for notification and pushy module
jmhossler Mar 29, 2023
a5cc940
refactor: change order of new to take destination as first parameter …
jmhossler Mar 29, 2023
f46512f
test: implement basic pushy test implementation
jmhossler Mar 29, 2023
9251f98
feat: ensure pushy config is validated
jmhossler Mar 29, 2023
0de75f6
Fix compilation errors and warnings
nathanalderson Feb 29, 2024
fefcc3c
Make the default uri a string, not a charlist
nathanalderson Feb 29, 2024
acb29b8
fix: put variable on the right side of pattern match in parameter list
jmhossler Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add missing empty curly bracket and format files
  • Loading branch information
jmhossler committed Apr 1, 2024
commit 7af0b96a18e6b3db41875897694752409e092b81
6 changes: 4 additions & 2 deletions lib/pigeon/pushy/error.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ defmodule Pigeon.Pushy.Error do
@moduledoc false

@doc false
@spec parse(Pigeon.Pushy.Notification.t(), map) :: Pigeon.Pushy.Notification.error_response()
@spec parse(Pigeon.Pushy.Notification.t(), map) ::
Pigeon.Pushy.Notification.error_response()
def parse(notification, error) do
error_code = error
error_code =
error
|> Map.get("code")
|> parse_response()

Expand Down
2 changes: 1 addition & 1 deletion lib/pigeon/pushy/notification.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defmodule Pigeon.Pushy.Notification do

@spec put_time_to_live(__MODULE__.t(), integer()) :: __MODULE__.t()
def put_time_to_live(notification, time_to_live) do
%{notification | time_to_live: time_to_live
%{notification | time_to_live: time_to_live}
end

@spec put_content_available(__MODULE__.t(), boolean()) :: __MODULE__.t()
Expand Down