question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error message on APS notifications

See original GitHub issue

Hello - When I’m sending APS notifications, I’m getting an error as follows:

{
  "error": {
    "code": 400,
    "message": "Value of [aps] must be a non-empty dictionary.",
    "errors": [
      {
        "message": "Value of [aps] must be a non-empty dictionary.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}

I am sending a message that does have [aps] populated. Is there something else I could be missing?

           var fcmMessage = new Message()
            {
                Token = address,
                Apns = new ApnsConfig()
                {
                    Aps = new Aps()
                    {
                        ContentAvailable = contentAvailable,
                        Badge = badge,
                        Sound = sound,
                    },
                },
            };

            if (data != null && data.Count > 0)
            {
                fcmMessage.Apns.CustomData = data;
            }

            if (!silentOnApns)
            {
                fcmMessage.Notification = new Notification()
                {
                    Title = title,
                    Body = message,
                };
            }

            var firebaseMessaging = FirebaseMessaging.GetMessaging(this.firebaseApp);

            return await firebaseMessaging.SendAsync(fcmMessage);```

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hiranya911commented, Mar 25, 2019

I don’t think so. The SDK currently exposes all the messaging functionality supported by the FCM backend service. But feel free to file a feature request at https://support.google.com/firebase/contact/support?page=bug_or_feature so that the FCM team can take a look and see if this is something we can support.

1reaction
albernhagencommented, Mar 25, 2019

Great, thanks for all of the info @hiranya911 . I’ll close this out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Messages for Push Notifications
Error Messages for Push Notifications ; Error while sending notification. Confirm certificate is for the correct Apple environment. Confirm that correct ...
Read more >
Handling notification responses from APNs
An internal server error occurred. ... The service is unavailable. ... The APNs server is shutting down. Listing 1 shows a sample response...
Read more >
FireBase Remote notifications giving APS error when ...
App delegate is setup (and now bloated) · APNs have been created signed and uploaded to apple downloaded keyed and uploaded to google...
Read more >
Push Notification Issues: Common Errors & Fixes
We know push notifications are a crucial feature for your apps, and sometimes things go wrong. If you receive an error message when...
Read more >
Notification/error message in apps & features, in settings
Hi,I get the following message every time i open apps tab in settings: "sign into your Microsoft account to continue app experience across ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found