andere app id

This commit is contained in:
JM 2026-05-05 16:58:59 +02:00
parent f9cff1f137
commit c3fec7dde7
1 changed files with 32 additions and 33 deletions

View File

@ -33,52 +33,50 @@ class NotificationPayloadFactory
// $discussionUrl = $this->resolveSubjectUrl($blueprint) ?? 'https://forum.sbp.de'; // $discussionUrl = $this->resolveSubjectUrl($blueprint) ?? 'https://forum.sbp.de';
// $previewSnippet = $this->buildPreviewText($blueprint); // $previewSnippet = $this->buildPreviewText($blueprint);
// $discussionTitle = 'Backup-Strategie für Forum';
// $discussionUrl = 'https://forum.sbp.de/d/34-which-file-extensions-are-allowed-for-uploads/2';
// $previewSnippet = 'Bitte prüft, ob wir tägliche Snapshots brauchen.';
// $reasonText = 'Neue Antwort in beobachteter Diskussion';
// // Freie Actor+Reason-Zeile für systemDefault
// $reasonText = match ($blueprint::getType()) {
// 'newPost' => 'There was a new answer in one of your folloed posts',
// 'postMentioned' => 'Your post has been mentioned',
// 'userMentioned' => 'You have been mentioned',
// 'postLiked' => 'Your post has been liked',
// default => 'New sbp forum update',
// };
$discussionTitle = 'Backup-Strategie für Forum'; $discussionTitle = 'Backup-Strategie für Forum';
$discussionUrl = 'https://forum.sbp.de/d/34-which-file-extensions-are-allowed-for-uploads/2'; $discussionUrl = 'https://forum.sbp.de/d/34-which-file-extensions-are-allowed-for-uploads/2';
$previewSnippet = 'Bitte prüft, ob wir tägliche Snapshots brauchen.'; $previewSnippet = 'Bitte prüft, ob wir tägliche Snapshots brauchen.';
$reasonText = 'Neue Antwort in beobachteter Diskussion'; $reasonText = 'Neue Antwort in beobachteter Diskussion';
// ✅ Teams AppCatalog ID (aus Get-TeamsApp)
$teamsCatalogAppId = '61e3fb91-4b17-428f-856b-51a345e10f06';
// ✅ kompakte Unterseiten-ID (KEINE URL!)
// Freie Actor+Reason-Zeile für systemDefault
$reasonText = match ($blueprint::getType()) {
'newPost' => 'There was a new answer in one of your folloed posts',
'postMentioned' => 'Your post has been mentioned',
'userMentioned' => 'You have been mentioned',
'postLiked' => 'Your post has been liked',
default => 'New sbp forum update',
};
// Teams-App-/Tab-Ziel aus deinem aktuellen Manifest
$teamsManifestAppId = 'd92b1be6-ea92-46b1-bcb0-c08ffdd1a61a';
$teamsEntityId = '8ffe419f-ca44-4627-a4b2-f223da2d07aa';
$discussionTitle = 'Backup-Strategie für Forum';
$discussionUrl = 'https://forum.sbp.de/d/34-which-file-extensions-are-allowed-for-uploads/2';
$subEntityId = 'discussion:34:2'; $subEntityId = 'discussion:34:2';
// ✅ Kontext für entityUrl
$contextJson = json_encode([ $contextJson = json_encode([
'subEntityId' => $subEntityId, 'subEntityId' => $subEntityId
], JSON_UNESCAPED_SLASHES); ], JSON_UNESCAPED_SLASHES);
$teamsDeepLink = sprintf( // ✅ entityUrl (KEIN webUrl, KEIN Deep Link)
'https://teams.microsoft.com/l/entity/%s/%s?tenantId=%s&webUrl=%s&label=%s&context=%s', $entityUrl = sprintf(
rawurlencode('d92b1be6-ea92-46b1-bcb0-c08ffdd1a61a'), 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/%s?context=%s',
rawurlencode('8ffe419f-ca44-4627-a4b2-f223da2d07aa'), rawurlencode($teamsCatalogAppId),
rawurlencode('e2052793-a0f4-47d8-a3a3-52c926e79df5'),
rawurlencode($discussionUrl),
rawurlencode($discussionTitle),
rawurlencode($contextJson) rawurlencode($contextJson)
); );
$payload = [ $payload = [
'topic' => [ 'topic' => [
'source' => 'text', 'source' => 'entityUrl',
'value' => $discussionTitle, 'value' => $entityUrl,
'webUrl' => $teamsDeepLink,
], ],
'activityType' => $activityType !== '' ? $activityType : 'systemDefault', 'activityType' => 'systemDefault',
'previewText' => [ 'previewText' => [
'content' => mb_substr($previewSnippet, 0, 150), 'content' => mb_substr($previewSnippet, 0, 150),
], ],
@ -90,6 +88,7 @@ class NotificationPayloadFactory
], ],
]; ];
if ($iconId !== '') { if ($iconId !== '') {
$payload['iconId'] = $iconId; $payload['iconId'] = $iconId;
} }