Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Purpose of Entitlements.plist's Enable Push Notifications

Sandman202Sandman202 Member ✭✭

While trying to understand why the iOS devices are receiving push notifications without sound, I came across something I am curious about relating to Entitlements.plist and Enable Push Notifications. In my company's Xamarin.Forms app, we do not have the Enable Push Notifications checked, yet the app receives push notifications. When I mark this checkbox and attempt to deploy to a device in debug mode, I receive the message

Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).

Application could not be uploaded to the device.

I have seen several logs about setting up Firebase where they say to use make Enable Push Notifications.

I have 2 questions:
1. What is the purpose of this checkbox, if I currently am receiving notifications without it marked?
2. What could cause the sound/vibrate to not work when a push notification is received?

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    1. What is the purpose of this checkbox, if I currently am receiving notifications without it marked?

    This key specifies whether to use the development or production Apple Push Notification service (APNs) environment when registering for push notifications.

    Xcode sets the value of the entitlement based on your app's current provisioning profile. For example, if you're using a development provisioning profile, Xcode sets the value to development.

    Refer to https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc .

    1. What could cause the sound/vibrate to not work when a push notification is received?

    Do you use custom sound ? Do you set sound tag in payload ?

    Refer to https://github.com/CrossGeeks/FirebasePushNotificationPlugin/issues/123 .

  • Sandman202Sandman202 Member ✭✭

    Do you use custom sound ?

    We are not using a custom sound. Just the default.

    Do you set sound tag in payload ?

    The sound tag is not set in the payload.

    Just an fyi... someone else wrote the app. It was handed to me a few months back. Not too familiar with Firebase. Our server calls Firebase and then push notifications are sent to Android and iOS devices. I've seen other comments online mentioning the sound needs to be set in the payload. Where exactly is the payload defined? Firebase? iOS?

  • Sandman202Sandman202 Member ✭✭

    I had to go back on our server and I see where the payload is created. No sound tag is present. I will need to test sending a payload with this option to validate it will work.

  • ColeXColeX Member, Xamarin Team Xamurai

    @Sandman202 said:
    I had to go back on our server and I see where the payload is created. No sound tag is present. I will need to test sending a payload with this option to validate it will work.

    Feel free to update here if problem gets resolved.

Sign In or Register to comment.