This software simulates an An APN server
.
Currently mockapn
only receives push notifications printing:
- the token and the JSON for a successful push
- the token for an not successful push
Only for packets built using the enhanced format
if the token is invalid (most common error in my experience with APN) an error message is sent to client and the connection is closed.
Nothing but printing is done for packets built using simple format
.
No other functionality is implemented for now.
In order to have mock_apn
working, you have to:
- change in
src/mock_apn_sup.erl
the values for the SSL key, password and certificate - change in
src/mock_apn_server.erl
the list representing the invalid tokens
For test purposes you may also want to change the tokens in test/mock_apn_test.erl
accordingly.
$ make
$ make start
First you have to start the mock server:
$ make start
Then you have to call in a separated shell:
$ erl
1> mock_apn_test:push().