Since a few days now, I'm using Xcode 16 and I try to install a newly made provisioning profile for my app. On the development profile I always get the message "Failed to install one or more provisioning profiles on the device". But no message at all for the distribution profile. I even tried setting up completely new certificates as I updated to macOS 15 and Xcode 16. No success.
When checking the installed profiles via Finder under
open ~/Library/MobileDevice/Provisioning\ Profiles
I only see profiles from my last project from june this year. It does not matter how often I press "Download Manual Profiles" in Xcode nothing new lands here.
Is there any other way to install newly created profiles? As my project is done with .NET and not a native Xcode project I do not have the option to let Xcode it generate for me (if this would even work).
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I don't know what could be wrong but my UNNotificationServiceExtension is never getting called by any push from FCM. I call the FCM from a Python3 script and so far it works (I get a push notification but always with the default text and not the modified one). firebaseHeaders = {
"Content-Type":"application/json",
"Authorization":"key=MYKEY"
}
firebaseBody = {
"to":devicetoken,
"priority":"high",
"mutable-content":True,
"apns-priority":5,
"notification": { "titlelockey":"push.goalReachedTitle", "bodylockey":"push.goalReachedContentRemote", "bodylocargs":[str(entry['value']), entry['region']], "sound":"default", "badge":1 },
"data": { "values":data, "region":entry['region'], "value":entry['value'] }
}
firebaseResult = requests.post("https://fcm.googleapis.com/fcm/send", data=None, json=firebaseBody, headers=firebaseHeaders)
My Extension is also pretty basic (for testing) and I already tried to remove it and add it again to my main app project without success. class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
bestAttemptContent.title = bestAttemptContent.title + " [TEST 123]"
contentHandler(bestAttemptContent)
}
}
override func serviceExtensionTimeWillExpire() {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
contentHandler(bestAttemptContent)
}
}
}
Anyone has a idea what I still can check, test or miss?
Is there any way to prevent the CKSubscription from getting invoked if the change that invoked it comes from this app instance? My app updates the CloudKit after every change but if the user does this changes quickly, there is a high chance that the subscription get back to me with outdated data even tho this change came from this very app instance. I still want this update to happen if these changes are done from a different app instance on another device or what so ever.
About 15 hours now since my customers start getting the error "Asset URL has expired" when they try to download any On-Demand Resource on any of my apps. It has worked before and it still works fine in TestFlight (with the same App versions). How do I get this fixed? Or what do I have todo now??
I tried now two different approaches (MCAdvertiserAssistant / MCBrowserViewController and MCNearbyServiceAdvertiser / MCNearbyServiceBrowser) to implement this in my first Swift app but always got the result that it stays at "Connecting" for a few seconds and than just declines the request. In a video from Hacking with Swift there was a popup if the connection should be accepted - this never comes up on my devices. So maybe this is the error already?
As for the browser part, I use this ViewController wrapper to make it available:
import MultipeerConnectivity
import SwiftUI
struct MultipeerConnectivityBrowserView: UIViewControllerRepresentable {
func makeUIViewController(context: UIViewControllerRepresentableContext<MultipeerConnectivityBrowserView>) -> MCBrowserViewController {
let service = MultipeerConnectivityService.instance()
guard let session = service.session else {
print("Failed to load MCSession for Browser")
return MCBrowserViewController()
}
let viewController = MCBrowserViewController(serviceType: service.serviceType, session: session)
viewController.delegate = service
return viewController
}
func updateUIViewController(_ uiViewController: MCBrowserViewController, context: UIViewControllerRepresentableContext<MultipeerConnectivityBrowserView>) {
}
}
struct MultipeerConnectivityBrowserView_Previews: PreviewProvider {
static var previews: some View {
MultipeerConnectivityBrowserView()
}
}
I can see my 2nd device in the upcoming dialog but when I click on it, as described above, it just hangs at "Connecting" until it, as it seems to me, timed out.
This is currently the main implementation for the MC in my app:
import MultipeerConnectivity
class MultipeerConnectivityService: NSObject, MCSessionDelegate, MCBrowserViewControllerDelegate, MCAdvertiserAssistantDelegate {
		private static var internalInstance: MultipeerConnectivityService? = nil
		
		let serviceType = "sn-dueladviser"
		let peerID = MCPeerID(displayName: UIDevice.current.name)
		
		var session: MCSession?
		var advertiserAssistant: MCAdvertiserAssistant?
		
		static func instance() -> MultipeerConnectivityService {
				if let instance = internalInstance {
						return instance
				}
				
				internalInstance = MultipeerConnectivityService()
				return internalInstance!
		}
		
		private override init() {
				super.init()
				
				session = MCSession(peer: peerID, securityIdentity: nil, encryptionPreference: .required)
				session?.delegate = self
		}
		
		func startHosting() {
				guard let session = session else { return }
				advertiserAssistant = MCAdvertiserAssistant(serviceType: serviceType, discoveryInfo: nil, session: session)
				advertiserAssistant?.delegate = self
				
				advertiserAssistant?.start()
		}
		
		func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) {
				
		}
		
		func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) {
				
		}
		
		func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) {
				
		}
		
		func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) {
				browserViewController.dismiss(animated: true, completion: { })
		}
		
		func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController) {
				browserViewController.dismiss(animated: true, completion: { })
		}
		
		func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) {
				switch state {
				case .connected:
						print("Connected: \(peerID.displayName)")
				case .connecting:
						print("Connecting: \(peerID.displayName)")
				case .notConnected:
						print("Not Connected: \(peerID.displayName)")
						
				@unknown default:
						print("Unknown state received: \(peerID.displayName)")
				}
		}
		
		func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) {
				//todo: Receive data
		}
}
I tried to add NSLocalNetworkUsageDescription and NSBonjourServices without any change (even if both are not mentioned in any guides except the official documentation). Sadly it didn't change anything + it seems like my XCode does not know these keys or at least do not replace the key name with another text like it did with other keys like camera permission.
Is there any way for us developers to refund In-App-Purchases to users? At the Google Play Store it is possible through the order management (see: https://i.imgur.com/FhhYAEu.png) but I can't find anything like that on ITC.
Is there a way to get the size inside a UIViewControllerRepresentable? I try to include a UIKit control that requires me to put the size in it's constructor.
This is my code so far:
final class ChartVC: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
let viewController = UIViewController()
let chart = Chart(frame: CGRect(x: 0, y: 0, width: 300, height: 200)) //todo: don't use fixed values here...
viewController.view.addSubview(chart)
return viewController
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) { }
}
And this is, how I currently use this:
ChartVC()
.frame(minWidth: 180, idealWidth: 280, maxWidth: 420, minHeight: 300, alignment: .center)
.padding()
.background(Color.contentBackgroundColor)
.cornerRadius(8)
Question now is, how do I get the size that SwiftUI will apply to my frame?
After updating my Xcode to 12.0, all iOS 13 simulators are gone and there are also no iOS 14 simulators at all. Also I can't create any. Is there a way to fix this?
Edit: I already tried to reinstall Xcode. Strange that the Xcode 12 beta worked good next to the Xcode 11.x installation...
I want to create a app that has to load data from my API on a regular basis. The data is changed every 15 minutes so I would like to use a similar interval to load my data to update my widget and the data in the app. But what is the proper way of implementing such behavior? I mean the app would need to update the data even when the app is closed in the app switcher to update the widget and so on.
Background fetch seems to be the wrong way to me, and I'm also not sure about BGTaskScheduler. As far as I understand this, both needs to be started from my app which may not be opened after a device reboot.
I'm sure there must be a way to implement the wanted behavior because mail apps need todo the very same on servers that do not support push.