se LWP::Protocol::https;
use LWP::ConnCache;
use JSON qw(encode_json);
use Class::Accessor::Lite (
new => 0,
rw => [qw/ua api_url api_key json/],
);
use Carp qw(croak);
use WWW::FCM::HTTP::R
> 'key='.$self->api_key);
$req->header('Content-Type' => 'application/json; charset=UTF-8');
$req->content(encode_json $payload);
return $req;
}
1;
__END__
=encoding utf-8
=head1 NAME
head1 SYNOPSIS
use WWW::FCM::HTTP;
my $api_key = 'Your API key'; # from google-services.json
my $fcm = WWW::FCM::HTTP->new({ api_key => $api_key });
# send multicast request