1 | <?php |
||
17 | class Messenger |
||
18 | { |
||
19 | |||
20 | const API_URL = 'https://graph.facebook.com/'; |
||
21 | const API_VERSION = 'v2.9'; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $appSecret; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $verifyToken; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $pageToken; |
||
37 | |||
38 | /** |
||
39 | * @var \GuzzleHttp\ClientInterface |
||
40 | */ |
||
41 | protected $client; |
||
42 | |||
43 | /** |
||
44 | * Messenger constructor. |
||
45 | * |
||
46 | * @param string $appSecret |
||
47 | * @param string $verifyToken |
||
48 | * @param string $pageToken |
||
49 | * @param \GuzzleHttp\ClientInterface $client |
||
50 | */ |
||
51 | 1 | public function __construct(string $appSecret, string $verifyToken, string $pageToken, ClientInterface $client = null) |
|
64 | |||
65 | /** |
||
66 | * @return \Kerox\Messenger\Api\Send |
||
67 | */ |
||
68 | 1 | public function send(): Send |
|
72 | |||
73 | /** |
||
74 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
75 | * @return \Kerox\Messenger\Api\Webhook |
||
76 | */ |
||
77 | 1 | public function webhook(ServerRequestInterface $request = null): Webhook |
|
81 | |||
82 | /** |
||
83 | * @return \Kerox\Messenger\Api\User |
||
84 | */ |
||
85 | 1 | public function user(): User |
|
89 | |||
90 | /** |
||
91 | * @return \Kerox\Messenger\Api\Profile |
||
92 | */ |
||
93 | 1 | public function profile(): Profile |
|
97 | |||
98 | /** |
||
99 | * @return \Kerox\Messenger\Api\Code |
||
100 | */ |
||
101 | 1 | public function code(): Code |
|
105 | |||
106 | /** |
||
107 | * @return \Kerox\Messenger\Api\Insights |
||
108 | */ |
||
109 | 1 | public function insights(): Insights |
|
113 | |||
114 | /** |
||
115 | * @return \Kerox\Messenger\Api\Tag |
||
116 | */ |
||
117 | 1 | public function tag(): Tag |
|
121 | } |
||
122 |