This application validates apple receipts with App Store. How to validate
You need to clone the repository and download rebar/rebar3 (if it's not already available in your path).
git clone https://github.com/thiagoesteves/applev.git
cd applev
To compile and run
make
The application has two modes of operation: Sync and Async. If you decide to use the sync mode, when validation function is called, the function will be blocked until it finishes (or timeout). If async mode is selected, you must pass the PID (or process name) of the destination process in order to receive the result and any argument to identify the validated receipt. See the examples:
1> applev:validate(<<"Your Receipt Here">>).
{ok,#{<<"bid">> => <<"com.es.Purchaser">>,<<"bvrs">> => <<"3">>,
...
<<"unique_vendor_identifier">> =>
<<"5C275B5A-3E66-4026-9523-845B225755FC">>}}
2> applev:validate_async(self(), <<"Your Receipt Here">>, [arg1, arg2]).
{ok,<0.247.0>}
3> flush().
Shell got {apple_receipt_return,{ok,#{<<"bid">> => <<"com.es.Purchaser">>,
...
<<"unique_vendor_identifier">> =>
<<"5C275B5A-3E66-4026-9523-845B225755FC">>},
[arg1, arg2]} }
ok
In order to test the connectivity, there are test functions using sandbox receipt
1> applev:validate().
{ok,#{<<"bid">> => <<"com.es.Purchaser">>,<<"bvrs">> => <<"3">>,
...
<<"unique_vendor_identifier">> =>
<<"5C275B5A-3E66-4026-9523-845B225755FC">>}}
2> applev:validate_async().
{ok,<0.247.0>}
3> flush().
Shell got {apple_receipt_return,{ok,#{<<"bid">> => <<"com.es.Purchaser">>,
...
<<"unique_vendor_identifier">> =>
<<"5C275B5A-3E66-4026-9523-845B225755FC">>}
none}}
ok
The following command will invoke common test and coverage.
make test