Notifications continue to send after deleting an installation

buyani.mhlongo 30 Reputation points
2025-02-13T15:14:58.56+00:00

Notifications continue to send after deleting an installation can we get help on this please

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
349 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Siva Nair 410 Reputation points Microsoft Vendor
    2025-02-17T15:23:38.8166667+00:00

    Hi buyani.mhlongo,

    To fix the issue, Lets follow these steps:

    1. Verify Installation Deletion- Run the following command using the Azure CLI to check if the installation still exists: az notification-hub installation show --hub-name "<YourHubName>" --resource-group "<YourResourceGroup>" --namespace-name "<YourNamespace>" --installation-id "<YourInstallationID>".
    2. If the installation still exists, try deleting it again: az notification-hub installation delete --hub-name "<YourHubName>" --resource-group "<YourResourceGroup>" --namespace-name "<YourNamespace>" --installation-id "<YourInstallationID>". 
    3. If the installation deletion did not fully remove the registration, list all active registrations: az notification-hub registration list --hub-name "<YourHubName>" --resource-group "<YourResourceGroup>" --namespace-name "<YourNamespace>". If any stale registrations are still active, delete them manually. 
    4. Clear Local Device Tokens-For Android (FCM): Call FirebaseMessaging.getInstance().deleteToken() to remove the FCM token. Ensure your app properly handles token refresh events. 
    5. Monitor Logs and Incoming Requests- Check if your backend system is still sending notifications to an old installation ID or device token. You can log outgoing notification requests to verify. 
    6. Force Expiration for FCM/APNs- For FCM, you can try forcing the token expiration:
    curl -X POST -H "Authorization: key=<YOUR_SERVER_KEY>" \   -H "Content-Type: application/json" \   -d '{     "to": "<DEVICE_TOKEN>",     "data": {       "action": "logout"     }   }' //mention you API endpoint.
    

    For APNs, ensure you’re handling feedback properly so expired tokens are removed.

     If you need any further assistant, do let me know.

    If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.

     


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.