Skip to content

pdincau/mockapn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mockapn

This software simulates an An APN server.

What mockapn does:

Currently mockapn only receives push notifications printing:

  1. the token and the JSON for a successful push
  2. 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.

How to adapt the code to your needs:

In order to have mock_apn working, you have to:

  1. change in src/mock_apn_sup.erl the values for the SSL key, password and certificate
  2. 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.

How to compile:

$ make

How to run:

$ make start

How to test:

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().

About

A mock server for APN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published