public function FirebaseTopicManagerService::processTopicSubscription in Firebase Push Notification (FCM) 8
Same name and namespace in other branches
- 3.0.x src/Service/FirebaseTopicManagerService.php \Drupal\firebase\Service\FirebaseTopicManagerService::processTopicSubscription()
Process topic un/subscription.
Parameters
string $topic: The topic, which will be processed.
string|array $tokens: Token or tokens this will be subscriber\unsubscribe by topic.
string $endpoint: The endpoint for processing by topic.
File
- src/
Service/ FirebaseTopicManagerService.php, line 43
Class
- FirebaseTopicManagerService
- Service for managing topics.
Namespace
Drupal\firebase\ServiceCode
public function processTopicSubscription($topic, $tokens, $endpoint) {
$this->endpoint = $endpoint;
$this->body = [
'to' => '/topics/' . $topic,
'registration_tokens' => is_array($tokens) ? $tokens : [
$tokens,
],
];
$this
->send();
}