[BUG] Push Notifications: 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead. #1672
Labels
Communication - Chat
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
Encountered the error message: "'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead." in ApplicationUtil.swift line 49 -> return UIApplication.shared
Exception or Stack Trace
'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
To Reproduce
Followed the Microsoft Azure tutorial link for integrating push notifications into a chat application.
Encountered the error message: "'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead."
Code Snippet
ApplicationUtil.swift line 49 -> return UIApplication.shared
Expected behavior
Successful compilation without errors on ./add-chat-push-notifications in xcode 15.
Screenshots

Setup (please complete the following information):
Additional context
Encountered the same issue in both a direct integration into the chat project and when using the Microsoft-provided example project link. The issue appears to be related to the AzureCore dependency, and a possible solution was suggested in the Apple Developer Forums link, recommending the use of @available(iOSApplicationExtension, unavailable). This change may need to be implemented in the Azure SDK to resolve the issue.
Azure-Samples/communication-services-ios-quickstarts#70
The text was updated successfully, but these errors were encountered: