use Net::APNS::Persistent;

#  my $devicetoken_hex = '7D2C7E0A4D90289D772AC0846AF1435A9F8E47A329F3156C41B594A3A005BE2D'; #MIO IPAD
#  my $devicetoken_hex = 'AF571DEF64C7BCDCE0AC07995101D08DCF1EF53ABDACA300F96120EFDC70FF8E'; #Iphone 5 blanco
##  my $devicetoken_hex = 'A298E67BA792FC6ABE5A3E2EAE73AC8CF81A51E2939507347ECD00469D9B4F0C';#Iphone 5 blanco bueno
  #my $devicetoken_hex = '4592F5933455935082C9733EE9CDB347690191FEA819848A970F08FC75EDA4C1';
  #my $devicetoken_hex = 'C8B4C69B48FA5194BEA078993D0F397971EA850865180F5D6E142FB1F354B0B2'; #mio i5
  #my $devicetoken_hex = 'A02DF1BF3545D532DFBB82B02FA74728D1D985B91AB4B175C2DDA644A4640945'; #MIO PRO
#  my $devicetoken_hex = '9668C93E3D5BBCF8382F5B6DFAF18D9D69A77D4664A2936DC15FB9956B863BC5'; #MIGUE PRO
#  my $devicetoken_hex = '23E7C3EAA244FAF780925813E69B5317678F24B1B08AAD07A4AEEB57D9276547'; #JULIO IPHONE
  #my $devicetoken_hex = 'F65BC218A6D2CF6DD7E83E4939558C2339415540B995882E0DBBFFE264645E3C'; #MIO DEV
  #my $devicetoken_hex = '106112027786D517AF65E2F61907D3D973A356A26C6D322CD9570595A5954691'; #IG
  my $devicetoken_hex = '59749F4727C159BFE3DD4535C1964AC1FC34D1CE7AA04195B0798C778D171022';
  #my $devicetoken_hex = '9261B831E2285250464EB4039D087B25B3BD149498214C9F47B74EAD3CFC7ED0'; #MIGUE

  my $apns = Net::APNS::Persistent->new({
    sandbox => 0,
    #host    => 'gateway.push.apple.com',
    cert    => 'iMareasFree.pem',
    key     => 'iMareasFree.pem',
    passwd  => 'sistemas',
  });

  $apns->queue_notification(
    $devicetoken_hex,
    {
      aps => {
          alert => 'Nueva versión disponible de iMareas, con mareas de 2018',
          sound => 'default',
          badge => 1,
      },
    });

  $apns->send_queue;

  $apns->disconnect;


