anchor.diff:        apns:expiry(86400),
         [ {<<"acme2">>, <<"x">>},
           {<<"acme3">>, {[{<<"acme4">>, false}]}}]),
  -  receive
  -    {'DOWN', Ref, _, _, _} = DownMsg5 ->
  -      throw(DownMsg5);
  -    DownMsg5 ->
  -      throw(DownMsg5)
  -    after 1000 ->
  -      ok
  -  end,
  +  monitor_process_for_a_second(Ref),
  +
     ok = apns:send_message(?TEST_CONNECTION, #apns_msg{device_token = ?DEVICE_TOKEN,
                                    sound = "chime",
                                    badge = 12,
                                    expiry = apns:expiry(86400),
                                    alert = "Low Priority alert",
                                    priority = 0}),
  -  receive
  -    {'DOWN', Ref, _, _, _} = DownMsg6 ->
  -      throw(DownMsg6);
  -    DownMsg6 ->
  -      throw(DownMsg6)
  -    after 1000 ->
  -      ok
  +    monitor_process_for_a_second(Ref)
     end.
   
   log_error(MsgId, Status) ->
     error_logger:error_msg("Error on msg ~p: ~p~n", [MsgId, Status]).
   
   log_feedback(Token) ->
  -  error_logger:warning_msg("Device with token ~p removed the app~n", [Token]).+  error_logger:warning_msg("Device with token ~p removed the app~n", [Token]).
  +
  +monitor_process_for_a_second(Ref) ->
  +  receive
  +    {'DOWN', Ref, _, _, _} = DownMsg ->
  +      throw(DownMsg);
  +    UnexpectedMessage ->
  +      throw(UnexpectedMessage)
  +  after 1000 ->
  +    ok
  +  end.
  
positive.code:     apns:send_message(
        ?TEST_CONNECTION, ?DEVICE_TOKEN,
        Now ++ " - Test Alert", random:uniform(10), "chime"),
    receive
      {'DOWN', Ref, _, _, _} = DownMsg ->
        throw(DownMsg);
      DownMsg ->
        throw(DownMsg)
      after 1000 ->
        ok
    end,
    ok =
      apns:send_message(
        ?TEST_CONNECTION,
  
negative.code:                   key    = "KEY"},
        random:uniform(10),
        "chime"),
    monitor_process_for_a_second(Ref),
  
    ok =
      apns:send_message(
        ?TEST_CONNECTION, ?DEVICE_TOKEN, #loc_alert{key = "EMPTY"},
        random:uniform(10), "chime"),
    monitor_process_for_a_second(Ref),
  
    ok =
      apns:send_message(
        ?TEST_CONNECTION, ?DEVICE_TOKEN, Now ++ " - Test Alert",
        random:uniform(10), "chime",
        apns:expiry(86400), [{<<"acme1">>, 1}]),
    monitor_process_for_a_second(Ref),
  
    ok =
      apns:send_message(
        ?TEST_CONNECTION, ?DEVICE_TOKEN,
  