Add push notification capabilities

For ionic capacitor and voltbuild, How can i add push notification capability of Xcode ?

You need a plugin for that. I don’t know which one to use though, as it’s many years since I needed it. Hopefully someone else is better updated.

The one you shared uses Cordova, we use capacitor

But i think that what i’m looking for is something in the configuration level, not a js library

Something like trapeze that changes the config of xcode

But i need help to know how to do it and which plugin to use

How about this one?

Here’s a list of all the Capacitor plugins

I don’t think that you get the problem that i’m talking about

For sure i have the plugins of capacitor installed.and the push notification is working on android

What i need to make it work on IOS is to add capability of push notification in Xcode as the attached image in the original post

But i can’t find a way to do this via voltbuilder, as i don’t have access to xcode of voltbuilder

In other words, are the ios capabilities changeable dynamically?

I believe this is a capability you need to add to your app identifier in the apple developer portal. Then it’ll be included in your provisioning profile. You should be able to edit/modify your identifier and it’s capabilities here: Sign In - Apple

I spent few hours debugging and i think that i found the problem but i don’t know how to fix it

The mobileprovision file has the following content

So i went to see the generated ipa file from voltbuild and exported the entitlements

  • codesign -d --entitlements :- "MyApp.app"

And the result was the following

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>application-identifier</key>
        <string>WK6W979JY3.com.stackspushingtester.www</string>
        <key>beta-reports-active</key>
        <true/>
        <key>com.apple.developer.team-identifier</key>
        <string>WK6W979JY3</string>
        <key>get-task-allow</key>
        <false/>
    </dict>
</plist>

which excludes the aps-environment

Not sure about the reason of this exclusion from voltbuild, can you help?

Can you share your project with support@volt.build? We’d like to have a look

I have shared the code with you

Also, I found this other issue that mentions the same problem: iOS: Missing aps-environment in entitlement - #21 by jurijs.pasedko

Are you able to use the following instructions to enable the capability?

Yes, and i have the App.entitlements in the path ios/App/App updated accordingly with aps-entitlements set to production

This is the content of the xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>aps-environment</key>
	<string>production</string>
</dict>
</plist>

I see that you have the file there, but I don’t see where you’ve referenced it in your Xcode project. Are you sure you’ve followed the instructions to open the project in Xcode and add the push notification capability to signing and capabilities? If so can you try again. This should make changes to the ios/App/App.xcodeproject/project.pbxproj file.

This worked perfectly :pray:

Thank you :pray: