use Net::APNS::Persistent;

#  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 = '9261B831E2285250464EB4039D087B25B3BD149498214C9F47B74EAD3CFC7ED0'; #MIGUE

  my $devicetoken_hex = $ARGV[0];
  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 => 'Disponible nueva versión de iMareas, actualizado a 2018',
          sound => 'default',
          badge => 1,
      },
    });

  $apns->send_queue;

  $apns->disconnect;


