I’ve included the aps-enviroment entitlement within the App.entitlements, and the provisioning profile. Nonetheless, I get the under error in my Ionic Capacitor iOS app. The Android model is in fact working completely positive.
I attempted including it to the information.plist in line with the recommendation of Chat-GPT however that didn’t make any distinction both.
I’ve additionally tried eradicating, recreating, and studying the provisioning profile and may verify the post-notifications are enabled on the app id on the Apple Developer web site.
Any assistance is appreciated.
App.entitlements
<?xml model="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist model="1.0">
<dict>
<key>aps-environment</key>
<string>manufacturing</string>
</dict>
</plist>
data.plist
<?xml model="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist model="1.0">
<dict>
<key>aps-environment</key>
<string>manufacturing</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Khalsa Secondary</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Foremost</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>
AppDelegate.swift
import UIKit
import Capacitor
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func utility(_ utility: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override level for personalisation after utility launch.
FirebaseApp.configure()
return true
}
func applicationWillResignActive(_ utility: UIApplication) {
// Despatched when the appliance is about to maneuver from lively to inactive state. This could happen for sure forms of short-term interruptions (equivalent to an incoming telephone name or SMS message) or when the person quits the appliance and it begins the transition to the background state.
// Use this technique to pause ongoing duties, disable timers, and invalidate graphics rendering callbacks. Video games ought to use this technique to pause the sport.
}
func applicationDidEnterBackground(_ utility: UIApplication) {
// Use this technique to launch shared sources, save person information, invalidate timers, and retailer sufficient utility state info to revive your utility to its present state in case it's terminated later.
// In case your utility helps background execution, this technique known as as a substitute of applicationWillTerminate: when the person quits.
}
func applicationWillEnterForeground(_ utility: UIApplication) {
// Referred to as as a part of the transition from the background to the lively state; right here you possibly can undo lots of the modifications made on coming into the background.
}
func applicationDidBecomeActive(_ utility: UIApplication) {
// Restart any duties that have been paused (or not but began) whereas the appliance was inactive. If the appliance was beforehand within the background, optionally refresh the person interface.
}
func applicationWillTerminate(_ utility: UIApplication) {
// Referred to as when the appliance is about to terminate. Save information if applicable. See additionally applicationDidEnterBackground:.
}
func utility(_ app: UIApplication, open url: URL, choices: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
// Referred to as when the app was launched with a url. Be happy so as to add further processing right here,
// however if you would like the App API to assist monitoring app url opens, ensure that to maintain this name
return ApplicationDelegateProxy.shared.utility(app, open: url, choices: choices)
}
func utility(_ utility: UIApplication, proceed userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
// Referred to as when the app was launched with an exercise, together with Common Hyperlinks.
// Be happy so as to add further processing right here, however if you would like the App API to assist
// monitoring app url opens, ensure that to maintain this name
return ApplicationDelegateProxy.shared.utility(utility, proceed: userActivity, restorationHandler: restorationHandler)
}
func utility(_ utility: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Information) {
Messaging.messaging().apnsToken = deviceToken
Messaging.messaging().token(completion: { (token, error) in
if let error = error {
NotificationCenter.default.publish(title: .capacitorDidFailToRegisterForRemoteNotifications, object: error)
} else if let token = token {
NotificationCenter.default.publish(title: .capacitorDidRegisterForRemoteNotifications, object: token)
}
})
}
func utility(_ utility: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
NotificationCenter.default.publish(title: .capacitorDidFailToRegisterForRemoteNotifications, object: error)
}
}