| 1 | package Facebook::Graph::Publish::PageTab; | ||
| 2 | 4 | $Facebook::Graph::Publish::PageTab::VERSION = '1.1205'; | |
| 3 | 4 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | extends 'Facebook::Graph::Publish'; | |
| 5 | |||
| 6 | 4 | ▶ | use constant object_path => '/tabs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 4 | has app_id => ( | |
| 9 | is => 'rw', | ||
| 10 | required => 1, | ||
| 11 | ); | ||
| 12 | |||
| 13 | 0 | ▶ | around get_post_params => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 14 | 0 | my ($orig, $self) = @_; | |
| 15 | 0 | my $post = $orig->($self); | |
| 16 | 0 | push @$post, app_id => $self->app_id; | |
| 17 | 0 | return $post; | |
| 18 | 4 | }; | |
| 19 | |||
| 20 | 4 | 1; | |
| 21 | |||
| 22 | |||
| 23 | =head1 NAME | ||
| 24 | |||
| 25 | Facebook::Graph::Publish::PageTab - Add a page tab. | ||
| 26 | |||
| 27 | =head1 VERSION | ||
| 28 | |||
| 29 | version 1.1205 | ||
| 30 | |||
| 31 | =head1 SYNOPSIS | ||
| 32 | |||
| 33 | my $fb = Facebook::Graph->new; | ||
| 34 | |||
| 35 | $fb->add_page_tab($page_id, $app_id)->publish; | ||
| 36 | |||
| 37 | =head1 DESCRIPTION | ||
| 38 | |||
| 39 | This module gives you quick and easy access to publish an app as a page tab. | ||
| 40 | |||
| 41 | B<ATTENTION:> You must have the C<manage_pages> privilege to use this module. | ||
| 42 | |||
| 43 | =head1 METHODS | ||
| 44 | |||
| 45 | =head2 app_id ( id ) | ||
| 46 | |||
| 47 | Specify an app id for the app to add as the page tab. | ||
| 48 | |||
| 49 | =head2 publish ( ) | ||
| 50 | |||
| 51 | Posts the data and returns a L<Facebook::Graph::Response> object. The response object should contain the id: | ||
| 52 | |||
| 53 | {"id":"1647395831_130068550371568"} | ||
| 54 | |||
| 55 | =head1 LEGAL | ||
| 56 | |||
| 57 | Facebook::Graph is Copyright 2010 - 2017 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself. | ||
| 58 | |||
| 59 | =cut | ||