The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Colloquy::Push - APNS messaging for Mobile Colloquy

SYNOPSIS

  use Colloquy::Push;
  my $id = 'ce7098848342d16da...';

  my $iphone = Colloquy::Push->new($id, timeout => 5);
  $iphone->push( message => 'hello world!',
                 room    => '#perl',
                 server  => 'irc.freenode.net',
                 sender  => 'bg' );

DESCRIPTION

  C<Colloquy::Push> can be used to dispatch iPhone "Push" notifications to
  devices running B<Mobile Colloquy> that are registered to accept these
  notifications.
  
  As a prerequisite for using this module, you must have the device ID of the
  recipient. This is admittedly tricky because the ID is generated and managed
  by the APNS servers, so there is a mock server included in the distribution
  that can be used for exactly this purpose.

METHODS

new( $device, ... )

This method constructs a new Colloquy::Push instance. It takes the device-token of the iPhone that will receive the APNS notifications as its only required argument. Optionally, these additional keyword arguments are accepted:

   KEY                     DEFAULT
   -----------             --------------------
   server                  "colloquy.mobi"
   port                     7906
   timeout                  10
   debug                    0
   persistent               0
push( ... )

This method takes a number of keyword arguments needed to build and dispatch a push notification. Keywords marked with an asterisk are required:

   KEY                     VALUE
   -----------             --------------------
   action                  boolean: event was an action (default: 'false')
   badge                   amount to increment icon badge
 * message                 body of the message or action
   room                    originating IRC channel (optional if privmsg)
 * sender                  originating IRC nick
 * server                  originating IRC server
   sound                   alert sound (see app prefs for available sounds)

SEE ALSO

  • Mobile Colloquy (http://colloquy.mobi/)

AUTHOR

Brandon Gilmore, <brandon@mg2.org>

COPYRIGHT AND LICENSE

Copyright (C) 2010 Brandon Gilmore

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.