Welcome to the Apple Developer Forums

Post your questions, exchange knowledge, and connect with fellow developers and Apple engineers on a variety of software development topics.

For questions about using Apple hardware and services, visit Apple Support Communities

Posts

Sort by:
Post not yet marked as solved
0 Replies
5 Views
I want to count how many people view each of my pages in my app. Is there a way to setup a trigger in an iOS/MacOS project so that when a page is viewed that it can activate the trigger and increase the count for how many people have viewed a particular page? I did something similar using firebase, but my current company wants to only use apple services. Here is the firebase link to what i used for custom events: https://firebase.google.com/docs/analytics/events?platform=web Any help finding an apple version or help would be greatly appreciated!
Posted
by
Post not yet marked as solved
0 Replies
5 Views
Hello everybody, I ask for your support in verifying the merchant domain for ApplePay payments. On the "Certificates, Identifiers & Profiles" page accessible on the Apple Developer site, under "Merchant Domains" we can enter the domain, download the file and complete the verification. I would like to know if it is possible to set the Verification Expires date, which would appear to be generated automatically. For example, can I set the date so that I will have to re-verify the domain after 12 months? Thanks in advance, Best regards.
Posted
by
Post not yet marked as solved
0 Replies
12 Views
Hi, I need to get a unique ID which is profile_id in the Facebook and google login case. This unique ID helps me to verify from my database if the record already exists. If the record already exists, I can simply log in, if not, I can create a new account using the details provided by Apple sign-in. Can someone also confirm, apart from the full name and email what other details apple returns? For example, phone number, profile photo, and more.
Posted
by
Post not yet marked as solved
0 Replies
13 Views
I recently added Swift to my existing objective-c static library project and encountering issues when debugging Swift code. While in a breakpoint and entering po command to print a variable value I get: error: expression failed to parse: error: Couldn't realize type of self Note the following: The project is an objective-c static library with recently added Swift files. The error appears only when breakpoint is in a Swift file. There is no issues while debugging objective-c file (*.m file). Xcode version is 14.1 Project is using CocoaPods. There are no issues with compilation and runtime. The only issue is with debugging Swift code. When running swift-healthcheck from breakpoint, there are plenty of errors as follow: LoadOneModule() -- Missing Swift module or Clang module found for "Infra", "imported" via SwiftDWARFImporterDelegate. Hint: Register Swift modules with the linker using -add_ast_path. While Infra is the name of my static library. (I couldn't find any helpful instructions explaining how to register swift modules, while I'm not even sure it points to the actual issue). Any suggestions will be highly appreciated.
Posted
by
Post not yet marked as solved
1 Replies
23 Views
I do have a SwiftUI view with a model and lately when I run the iOS App on Mac as "designed for iPAD" it crashes. The view uses a LazyVGrid - I suspect that is the issue? My code works on iPad and iPhone but crashes on Mac when elements from the LazyVGrid are being removed from the ObservableObject driving the view. Any recommendations what I could do about this? I currently have no idea about where to start as I cannot dig further and the stack trace does not contain any of my code... Cheers, Michael here is what I get in the output: *** First throw call stack: ( 0 CoreFoundation 0x000000019b28c418 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000019add6ea8 objc_exception_throw + 60 2 Foundation 0x000000019c1cca60 -[NSCalendarDate initWithCoder:] + 0 3 UIKitCore 0x00000001c5137cfc -[UICollectionViewData indexPathForItemAtGlobalIndex:] + 172 4 UIKitCore 0x00000001c5429d74 __114-[UICollectionView _createAndAppendViewAnimationsForInsertsInCurrentUpdate:appearingAnimations:newSubviewManager:]_block_invoke + 76 5 UIKitCore 0x00000001c5429c78 -[UICollectionView _createAndAppendViewAnimationsForInsertsInCurrentUpdate:appearingAnimations:newSubviewManager:] + 1304 6 UIKitCore 0x00000001c5428ba8 -[UICollectionView _viewAnimationsForCurrentUpdateWithCollectionViewAnimator:] + 244 7 UIKitCore 0x00000001c542ee84 __102-[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]_block_invoke.748 + 180 8 UIKitCore 0x00000001c5011034 +[UIView(Animation) performWithoutAnimation:] + 76 9 UIKitCore 0x00000001c542e3bc -[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:] + 1388 10 UIKitCore 0x00000001c5428278 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + 8608 11 UIKitCore 0x00000001c5430b98 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:] + 512 12 SwiftUI 0x00000001daf7aaec OUTLINED_FUNCTION_7 + 10996 13 SwiftUI 0x00000001db151160 OUTLINED_FUNCTION_2 + 52 14 SwiftUI 0x00000001db151188 OUTLINED_FUNCTION_2 + 92 15 UIKitCore 0x00000001c5011034 +[UIView(Animation) performWithoutAnimation:] + 76 ... 2022-11-22 15:03:07.461972+0100 CameraCompanionBETA[3997:41963] [General] An uncaught exception was raised 2022-11-22 15:03:07.462026+0100 CameraCompanionBETA[3997:41963] [General] request for index path for global index 4 when there are only 4 items in the collection view 2022-11-22 15:03:07.462092+0100 CameraCompanionBETA[3997:41963] [General] ( 0 CoreFoundation 0x000000019b28c418 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000019add6ea8 objc_exception_throw + 60 2 Foundation 0x000000019c1cca60 -[NSCalendarDate initWithCoder:] + 0 3 UIKitCore 0x00000001c5137cfc -[UICollectionViewData indexPathForItemAtGlobalIndex:] + 172 4 UIKitCore 0x00000001c5429d74 __114-[UICollectionView _createAndAppendViewAnimationsForInsertsInCurrentUpdate:appearingAnimations:newSubviewManager:]_block_invoke + 76 5 UIKitCore 0x00000001c5429c78 -[UICollectionView _createAndAppendViewAnimationsForInsertsInCurrentUpdate:appearingAnimations:newSubviewManager:] + 1304 6 UIKitCore 0x00000001c5428ba8 -[UICollectionView _viewAnimationsForCurrentUpdateWithCollectionViewAnimator:] + 244 7 UIKitCore 0x00000001c542ee84 __102-[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]_block_invoke.748 + 180 8 UIKitCore 0x00000001c5011034 +[UIView(Animation) performWithoutAnimation:] + 76 9 UIKitCore 0x00000001c542e3bc -[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:] + 1388 10 UIKitCore 0x00000001c5428278 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + 8608 11 UIKitCore 0x00000001c5430b98 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:] + 512 12 SwiftUI 0x00000001daf7aaec OUTLINED_FUNCTION_7 + 10996 13 SwiftUI 0x00000001db151160 OUTLINED_FUNCTION_2 + 52 14 SwiftUI 0x00000001db151188 OUTLINED_FUNCTION_2 + 92 15 UIKitCore 0x00000001c5011034 +[UIView(Animation) performWithoutAnimation:] + 76 16 SwiftUI 0x00000001daf7a934 OUTLINED_FUNCTION_7 + 10556 17 SwiftUI 0x00000001da9da4b0 OUTLINED_FUNCTION_10 + 77892 ...
Posted
by
Post not yet marked as solved
2 Replies
21 Views
I want to display a random view, whether it's the firstScreen, secondSscreen or thirdScreen as seen in the pictures. I tried selecting a random element from my array but that does not seem to work. I hope you can help me! Thank you!
Posted
by
Post not yet marked as solved
0 Replies
18 Views
hey, severals hours for searching a solution without success... i want to save a URL video into a specific User Album and unfortunatly nothing happen ! if I define only the new name of the video (without the urlpath), I can find the video in the recent album ! anybody have an idea what 's happen ? please see below example of my code        let galleryPath = self.getDirectoryPath() print ("######### value of galleryPath  : (String(describing: galleryPath))")                 let filePath = galleryPath + "/nameX.mov"                 print ("######### value of filePath  : (String(describing: filePath))")               DispatchQueue.main.async {                 urlData.write(toFile: filePath, atomically: true)                    PHPhotoLibrary.shared().performChanges({                    PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL:                    URL(fileURLWithPath: filePath))                 }) {                    success, error in                    if success {                       print("Succesfully Saved")                    } else {                       print(error?.localizedDescription)                    }                 }              } Many thanks for your help ! JM
Posted
by
Post not yet marked as solved
0 Replies
22 Views
We implemented communication between Swift App and DriverKit driver using IOConnectCallAsyncStructMethod. void USBDriverClass::registerAsyncCallback(){   // Async required variables   notificationPort = NULL;   machNotificationPort = NULL;   runLoopSource = NULL;       // Async initialization   globalRunLoop = CFRunLoopGetMain();   CFRetain(globalRunLoop);       notificationPort = IONotificationPortCreate(kIOMainPortDefault);   if (notificationPort == NULL)   {     printf("Failed to create notification port for application.\n");   }       machNotificationPort = IONotificationPortGetMachPort(notificationPort);   if (machNotificationPort == 0)   {     printf("Failed to get mach notification port for application.\n");   }       runLoopSource = IONotificationPortGetRunLoopSource(notificationPort);   if (runLoopSource == NULL)   {     printf("Failed to get run loop for application.\n");   }       // Establish our notifications in the run loop, so we can get callbacks.   CFRunLoopAddSource(globalRunLoop, runLoopSource, kCFRunLoopDefaultMode);       // Establish our "AsyncCallback" function as the function that will be called by our Dext when it calls its "AsyncCompletion" function.   // We'll use kIOAsyncCalloutFuncIndex and kIOAsyncCalloutRefconIndex to define the parameters for our async callback   // This is your callback function. Check the definition for more details.   asyncRef[kIOAsyncCalloutFuncIndex] = (io_user_reference_t)AsyncCallback;   // Use this for context on the return. For example you might pass "this". But since this example is entirely static, we'll skip that step.   asyncRef[kIOAsyncCalloutRefconIndex] = (io_user_reference_t)NULL;       kern_return_t ret = kIOReturnSuccess;   uint8_t words = 4;       size_t inputSize = sizeof(StructA);   StructA structA;       structA.tag = 1;   structA.length = 0;   structA.values[0] = 0x106000;   structA.values[1] = words * sizeof(uint32_t);       size_t outputSize = sizeof(OutputData);   OutputData data;   printf("registerAsyncCallback called");       ret = IOConnectCallAsyncStructMethod(connection, MessageType_RegisterAsyncCallback, machNotificationPort, asyncRef, kIOAsyncCalloutCount, &structA, inputSize, &data, &outputSize);   if (ret != kIOReturnSuccess)   {     printf("IOConnectCallAsyncStructMethod failed with error: 0x%08x.\n", ret);   } } And when we get data from device we send data back from Driver to Swift app ivars->mUSBProbeDriverClient->AsyncCompletion(ivars->streamingDataCallback, kIOReturnSuccess, asyncData, 16); Driver should transfer data to swift app asynchronously when it's provided by USB device so we can not transfer struct synchronously. Async call back has limitation of 16 of uint64_t only and our application require larger data transfer. The logical way to transfer data using a memory buffer and as per Apple documentation they are providing this using IODataQueueDispatchSource. But they have not provided any example or showed how to use this. How to use fill buffer and use it in swift app using IODataQueueDispatchSource?
Posted
by
Post not yet marked as solved
0 Replies
13 Views
Good Day! I am currently working on in-app provisioning integration into our app. I have an error when I try to add a card into my wallet via our app. Btw card was successfully added from native iOS flow. So When I try to send PKAddPaymentPassRequest from my app into PassKit SDK I get next error on UI: «Could not add card» «Try again later or contact your card issuer for more information» In console of the device I get next errors: «PassbookUIService» «Proceeding with provisioning without fairplay data: -42187» And also I noticed that some response has 500 status «PassbookUIService» «Task <7F93C0ED-B20D-4557-92A2-8C98608410F4>.<4> received response, status 500 content K» Attached screen from console.
Posted
by
Post not yet marked as solved
0 Replies
30 Views
I've written a simple shape container that can be styled using an environment value. struct CoolShape: Shape {     @Environment(\.coolShapeStyle) var coolShapeStyle     func path(in rect: CGRect) -> Path {         coolShapeStyle.path.path(in: rect)     } } I then added some sample styles to style the shape and also created some utility functions to make it easy to add the style. protocol CoolShapeStyle {     var path: Path { get } } struct CoolCircleStyle: CoolShapeStyle {     let path = Path(ellipseIn: CGRect( x: 0, y: 0, width: 100, height: 100 )) } struct CoolSquareStyle: CoolShapeStyle {     let path = Path(CGRect( x: 0, y: 0, width: 100, height: 100 )) } extension CoolShapeStyle where Self == CoolCircleStyle {     static var circle: Self { Self() } } extension CoolShapeStyle where Self == CoolSquareStyle {     static var square: Self { Self() } } struct CoolShapeStyleEnvironmentKey: EnvironmentKey {     static let defaultValue: CoolShapeStyle = CoolCircleStyle() } extension EnvironmentValues {     var coolShapeStyle: CoolShapeStyle {         get { self[CoolShapeStyleEnvironmentKey.self] }         set { self[CoolShapeStyleEnvironmentKey.self] = newValue }     } } extension View {     func coolShapeStyle(_ coolShapeStyle: CoolShapeStyle) -> some View {         environment(\.coolShapeStyle, coolShapeStyle)     } } I then proceed to create the view as one would do normally, which works fine, all until I also add a fill or stroke to the shape. // This works fine CoolShape() .coolShapeStyle(.circle) // This creates a warning CoolShape() .fill(Color.red) .coolShapeStyle(.square) I'll then get the environment value error: Accessing Environment's value outside of being installed on a View. This will always read the default value and will not update. This is very odd, as a Shape and also the InsettableShape conform to View, yet the path(in:) function appears to be run at a different time. Is there any way I can fix this?
Posted
by
Post not yet marked as solved
1 Replies
19 Views
Hi , Hoping for someone with solid expertise to chime in. Does Xcode allow me to create an version of Apples Messages app where i can customize features? Like creating unique groups of contacts, colouring certain contacts, making notes? Is this possible? I am just wanting to know if features like this are possible for the Mac os/ios app before spending more time making it work. Thanks
Posted
by
Post not yet marked as solved
1 Replies
20 Views
Yesterday I ran a python script in terminal (python3) with the command: "nohup python3 //name_of_script.py// -u &". Unfortunately I cant kill the process, due to the PID changing faster, than its possible to run the pkill command. Ive tried: 1.) Ps ax | grep //name_of_process//  as well as --> kill -kill $(ps -A | grep //name_of_process// | awk '{print $1}') both no use. PID changes too fast? 2.) moving the file into another directory: no use, PID still constantly changing 3.) maybe the PID is constantly changing because the daemon is constantly crashing(?). Looked into my LaunchAgents folder and no sign of the script. Though im not very familiar with the structure of the folder I wasn't able to find anything. Im not an expert by any means so if there is anything I might have missed, please just leave a comment, no matter how rudimentary it seems. If you have any clue on where the script could be located to auto run on startup, help would be appreciated.
Posted
by
Post not yet marked as solved
1 Replies
23 Views
I am trying to figure out what the best way is of implementing a "toggle notifications on / off" switch in iOS using the SwiftUI framework. Calling unregisterForRemoteNotifications() seems to be one solution, but it's not recommended, as I understand from the docs. Another solution is to send a request to the provider server to set the token to inactive. But how would I handle this if the user happens to be offline when the toggle is switched, and comes online later? Any notificatins already sent would then arrive from APNs, I guess? The user could disable notifications in systems settings, which I assume just mutes the notification on an iOS level? Is there a way to replicate this within the app itself? I understand that the user settings can't be manipulated directly. But what is the recommended way of handling this situation (if there is one)? Thanks in advance!
Posted
by
Post not yet marked as solved
1 Replies
18 Views
Hello, I want to keep my iPhone screen "ON", for particular time interval and I want to control it from my app only. Is there any way to achieve same in swift? Eg. I want my app should not go to sleep for 5 mins or 2 mins whatever user decides. And after that interval is over it can go to sleep or can take the iPhone default screen awake time.
Posted
by
Post not yet marked as solved
0 Replies
27 Views
BD45-0B764F9AF92D","adam_id":0,"build_version":"8613.3.9.0.16","bundleID":"com.apple.SafariViewService","share_with_app_devs":0,"is_first_party":1,"bug_type":"142","os_version":"iPhone OS 15.6.1 (19G82)","incident_id":"09C4668C-2A26-4FFA-9997-D94D03BFBADC","name":"SafariViewService"} Date/Time: 2022-11-21 23:10:04.816 -0600 End time: 2022-11-21 23:15:03.469 -0600 OS Version: iPhone OS 15.6.1 (Build 19G82) Architecture: arm64e Report Version: 35.1 Incident Identifier: 09C4668C-2A26-4FFA-9997-D94D03BFBADC Data Source: Microstackshots Shared Cache: 004DDBDB-1A9C-3F9C-9D17-1D9EC4E68E5D slid base address 0x1c1560000, slide 0x41560000 Command: SafariViewService Path: /Applications/SafariViewService.app/SafariViewService Identifier: com.apple.SafariViewService Version: 15.6.1 (8613.3.9.0.16) Beta Identifier: 00F05AEF-E88F-46CF-B51C-3C28CDA99B77 Architecture: arm64e Parent: UNKNOWN [1] PID: 749 Event: wakeups Action taken: none Wakeups: 45001 wakeups over the last 299 seconds (151 wakeups per second average), exceeding limit of 150 wakeups per second over 300 seconds Wakeups limit: 45000 Limit duration: 300s Wakeups caused: 45001 Wakeups duration: 299s Duration: 298.65s Duration Sampled: 211.63s Steps: 97 Hardware model: iPhone13,3 Active cpus: 6 HW page size: 16384 VM page size: 16384 Advisory levels: Battery -> 1, User -> 3, ThermalPressure -> 0, Combined -> 1 Free disk space: 4140.01 MB/238.31 GB, low space threshold 150 MB Heaviest stack for the target process: 14 ??? (<66E1FB26-68F8-379B-A052-EB8B8291B5E1> + 105892) [0x100521da4] 14 ??? (SafariViewService + 8676) [0x10010e1e4] 14 ??? (UIKitCore + 2711696) [0x1c3fc8090] 14 ??? (UIKitCore + 5327704) [0x1c4246b58] 14 ??? (GraphicsServices + 4980) [0x1dda3e374] 14 ??? (CoreFoundation + 125896) [0x1c18d2bc8] 7 ??? (CoreFoundation + 45148) [0x1c18bf05c] 7 ??? (CoreFoundation + 22164) [0x1c18b9694] 7 ??? (CoreFoundation + 836000) [0x1c19801a0] 7 ??? (CoreFoundation + 766996) [0x1c196
Posted
by
Post not yet marked as solved
0 Replies
16 Views
Hi Apple, We are a MDM vendor and have been testing on Account driven User enrollment where apple hits at https://axm-adm-enroll.apple.com/enroll/byod during the byod enrollment flow and fails there itself and when i pinged it in browser I could able to see the certificate was not trusted and I explicitly installed a certificate profile for this to get working. Can you please bring a resolution to this as this behavior will spoil the smooth experience of the user enrollment. And to note the certificate expires on Expires: Monday, 12 December 2022
Posted
by
Post not yet marked as solved
0 Replies
14 Views
I own a few thousand iPads and have used MDM and are in supervised mode and I want to automatically launch into single app mode after an app is upgraded/installed. Is it possible to silently allow various permission popups displayed at startup without manual operation
Posted
by
Post not yet marked as solved
0 Replies
15 Views
We require notification suppression for a feature we're working on, and to enable the same, we found out we need to request a special entitlement for notification suppression. So as per Apple's website, we applied for the same, and it has been almost 2-3 weeks, yet we've got no response, neither a confirmation nor rejection. We've email multiple Apple support people, and there's been no response from their side so far. What are the next steps we can take? How do we escalate the same to Apple for an expedited response? And if possible, how do we suppress notification without the entitlements?
Posted
by
Post not yet marked as solved
0 Replies
13 Views
If the resource downloaded through BADownloadManager has been completed, will BADownloadManager download the same resource repeatedly? If not, does the developer have to keep track of the downloaded resources? So that when the extension is triggered, the query ignores the downloaded resources
Posted
by

Pinned Posts

Categories

See all