use Net::APNS::Persistent;

#  my $devicetoken_hex = 'AF571DEF64C7BCDCE0AC07995101D08DCF1EF53ABDACA300F96120EFDC70FF8E'; #Iphone 5 blanco
#  my $devicetoken_hex = 'A298E67BA792FC6ABE5A3E2EAE73AC8CF81A51E2939507347ECD00469D9B4F0C';#Iphone 5 blanco bueno
#  my $devicetoken_hex = '4592F5933455935082C9733EE9CDB347690191FEA819848A970F08FC75EDA4C1'; #i5
#  my $devicetoken_hex = 'A02DF1BF3545D532DFBB82B02FA74728D1D985B91AB4B175C2DDA644A4640945'; #MIO PRO
#  my $devicetoken_hex = '6A3CE62DCA2BA061F684A1955D60C3FE387BA6701CBF39F75E8DA2D7E2727FE0'; #MIO IPAD PRO
#  my $devicetoken_hex = 'CB589D873B089DB76F8D1E350DF0662D2E38F73892F97B118F58524EB7FB13D5'; #PAPA IPHONE
  #my $devicetoken_hex = 'F65BC218A6D2CF6DD7E83E4939558C2339415540B995882E0DBBFFE264645E3C'; #MIO DEV
#  my $devicetoken_hex = '106112027786D517AF65E2F61907D3D973A356A26C6D322CD9570595A5954691'; #IG
  #my $devicetoken_hex = '9261B831E2285250464EB4039D087B25B3BD149498214C9F47B74EAD3CFC7ED0'; #MIGUE
  #my $devicetoken_hex = '6D27F8FA65711CB99C9ECE84469D0DF9B446165360E8B5BF37E5B660B08B43D7';
  #my $devicetoken_hex = '7B9E98D55361E4EDD3C61F8001C42CB9C66E2B1A6DBE63D8E6F5928AC377AFBB';
  my $devicetoken_hex = 'AAD9781EF1E681A02D28D203681F3399C163D1D9201DD1A30757CF3500DE6DD9';

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

  $apns->queue_notification(
    $devicetoken_hex,
    {
      aps => {
          alert => 'Disponible nueva versión de iMareas Pro. Actualizadas mareas de 2018',
          sound => 'default',
          badge => 1,
      },
    });

  $apns->send_queue;

  $apns->disconnect;


