'Microsoft Graph API Activity Feeds Notification does not push to mobile app

I'm POST-ing to MS Teams Activity Feed Notifications via the Microsoft Graph API. However, the notifications are only being pushed through to the desktop and browser applications

With the Microsoft Teams Mobile Application (both Android and iOS), we are getting either none, or intermittent push notifications, and the mobile Activity Feed is not showing any of our notification items.

I am using the following endpoint: https://graph.microsoft.com/v1.0/teams/{GROUP_ID}/sendActivityNotification

I have the following payload:

{
    "topic": {
        "source": "text",
        "value": "Relevant Channel",
        "webUrl": "https://teams.microsoft.com/l/entity/{APP_ID}/{ENTITY_ID}?context={\"channelId\":\"{CHANNEL_ID}\"}"
    },
    "activityType": "userMention",
    "previewText": {
        "content": "App Name"
    },
    "recipient": {
        "@odata.type": "microsoft.graph.aadUserNotificationRecipient",
        "userId": "{RECIPIENT_AADOBJECTID}"
    },
    "templateParameters": [
        {
            "name": "name",
            "value": "My Name"
        }
    ]
}

My authentication token is fine, and included in the headers, and my application has all the required permissions.


Am I posting to the wrong endpoint, or are there issues around push notifications to the Microsoft Teams application on mobile devices?



Solution 1:[1]

We followed this sample (https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/graph-activity-feed/nodejs) and were able to get activity feed notification in both MS Teams Desktop, Web and mobile client.

MS Teams Version(Android): 1416/1.0.0.2022262002/0313

POST https://graph.microsoft.com/v1.0/teams/xxxxb29b-2dde-4682-xxxx-4ec85e5bxxxx/sendActivityNotification

{
    "topic": {
        "source": "entityUrl",
        "value": "https://graph.microsoft.com/v1.0/teams/xxxxb29b-2dde-4682-xxxx-4ec85e5bxxxx"
    },
    "activityType": "pendingFinanceApprovalRequests",
    "previewText": {
        "content": "Internal spending team has a pending finance approval requests"
    },
    "recipient": {
        "@odata.type": "microsoft.graph.aadUserNotificationRecipient",
        "userId": "xxxx3913-2766-4e6f-9edb-90d52bfxxxxx"
    },
    "templateParameters": [
        {
            "name": "pendingRequestCount",
            "value": "5"
        }
    ]
}

Solution 2:[2]

We had the same issue, it looks like an issue on the Microsoft side. Please view their reply here and how it finally got fixed for us: https://stackoverflow.com/a/72137274/712700

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Prasad-MSFT
Solution 2 goamn