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
2 Views

Speakerphone Issue

Guys, on my iphone 13 with software version 15.3.1 I am facing this weird issue. Whenever I am receiving calls on speaker phone my voice is distorted. No matter what I do the front person cannot hear my voice and when I connect my earphones they can hear me clearly. I want to know how to fix this issue if it is related to software or is there any hardware issue and I have to visit the store?
Asked
by Ranjeet-.
Post not yet marked as solved
10 Views

Sandbox purchase

On trying to make a test purchase, I'm getting a native prompt saying "Apple Media Services Terms and Conditions have changed", continuing from this prompt, I'm unable to Agree the terms of service. This is on mobile device Help on this please
Asked
by Kiransp19.
Post not yet marked as solved
17 Views

nsurlsessiond downloadings with no reason

hello! every time my mac is launched nsurlsessiond is downloading some.Logs provided, any ideas?) p.s. - i fully disabled icloud before sudo lsof | grep nsurlsessiond UserEvent 128        root txt    REG        1,4   30016 1152921500313133033 /System/Library/UserEventPlugins/com.apple.nsurlsessiond.plugin/Contents/MacOS/com.apple.nsurlsessiond nsurlsess 309   _nsurlsessiond cwd    DIR        1,4    704          2 / nsurlsess 309   _nsurlsessiond txt    REG        1,4   623456 1152921500313132063 /usr/libexec/nsurlsessiond nsurlsess 309   _nsurlsessiond txt    REG        1,4   28820     12975184868 /Library/Preferences/Logging/.plist-cache.xDxd2OnD nsurlsess 309   _nsurlsessiond txt    REG        1,4  28620288 1152921500312952448 /usr/share/icu/icudt64l.dat nsurlsess 309   _nsurlsessiond txt    REG        1,4  10055680     12975165425 /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/0/com.apple.LaunchServices.dv/com.apple.LaunchServices-1082-v2.csstore nsurlsess 309   _nsurlsessiond txt    REG        1,4   242128     12968148574 /private/var/db/timezone/tz/2021a.3.0/icutz/icutz44l.dat nsurlsess 309   _nsurlsessiond txt    REG        1,4  1572480 1152921500313132594 /usr/lib/dyld nsurlsess 309   _nsurlsessiond  0r   CHR        3,2    0t0         313 /dev/null nsurlsess 309   _nsurlsessiond  1u   CHR        3,2    0t0         313 /dev/null nsurlsess 309   _nsurlsessiond  2u   CHR        3,2    0t0         313 /dev/null nsurlsess 309   _nsurlsessiond  4  NPOLICY                           UserEvent 538       MacVic txt    REG        1,4   30016 1152921500313133033 /System/Library/UserEventPlugins/com.apple.nsurlsessiond.plugin/Contents/MacOS/com.apple.nsurlsessiond nsurlsess 564       MacVic txt    REG        1,4   623456 1152921500313132063 /usr/libexec/nsurlsessiond
Asked
Post not yet marked as solved
12 Views

GPU training deadlock

I've been using tensorflow-metal together with jupyter lab. Sometimes during training, the notebook would stop printing training progress. The training process seems dead as interrupting kernel wouldn't respond. I have to restart kernel and train again. The problem doesn't always occur, and I couldn't tell what was the cause. Until recently I started using tensorflow-probability. I could 100% reproduce the problem on my machine. Here is the demo to reproduce the problem. import numpy as np import tensorflow as tf #tf.config.set_visible_devices([], 'GPU') import tensorflow_probability as tfp from tensorflow_probability import distributions as tfd from tensorflow_probability import sts STEPS = 10000 BATCH = 64 noise = np.random.random(size=(BATCH, STEPS)) * 0.5 signal = np.sin((     np.broadcast_to(np.arange(STEPS), (BATCH, STEPS)) / (10 + np.random.random(size=(BATCH, 1)))     + np.random.random(size=(BATCH, 1)) ) * np.pi * 2) data = noise + signal data = data.astype(np.float32) # float64 would fail under GPU training, no idea why def build_model(observed):     season = sts.Seasonal(         num_seasons=10,         num_steps_per_season=1,         observed_time_series=observed,     )     model = sts.Sum([         season,     ], observed_time_series=observed)     return model model = build_model(data) variational_posteriors = sts.build_factored_surrogate_posterior(model=model) loss_curve = tfp.vi.fit_surrogate_posterior( target_log_prob_fn=model.joint_distribution(observed_time_series=data).log_prob,     surrogate_posterior=variational_posteriors,     optimizer=tf.optimizers.Adam(learning_rate=0.1),     num_steps=5, ) print('loss', loss_curve) After starting the demo, using python demo.py, I can observe the python process is running, consuming cpu and gpu. And then, when the cpu and gpu usage drops to zero, it never prints anything. The process doesn't responding to ctrl+c, and I have to force kill it. I use Activity Monitor to sample the "dead" process. It shows a lot of threads are waiting, including main thread. ... + 2228 _pthread_cond_wait (in libsystem_pthread.dylib) + 1228 [0x180659808] + 2228 __psynch_cvwait (in libsystem_kernel.dylib) + 8 [0x1806210c0] And some metal threads ... + 2228 tensorflow::PluggableDeviceContext::CopyDeviceTensorToCPU(tensorflow::Tensor const*, absl::lts_20210324::string_view, tensorflow::Device*, tensorflow::Tensor*, std::__1::function<void (tensorflow::Status const&)>) (in _pywrap_tensorflow_internal.so) + 152 [0x28006290c] + 2228 tensorflow::PluggableDeviceUtil::CopyPluggableDeviceTensorToCPU(tensorflow::Device*, tensorflow::DeviceContext const*, tensorflow::Tensor const*, tensorflow::Tensor*, std::__1::function<void (tensorflow::Status const&)>) (in _pywrap_tensorflow_internal.so) + 320 [0x2800689bc] + 2228 stream_executor::Stream::ThenMemcpy(void*, stream_executor::DeviceMemoryBase const&, unsigned long long) (in _pywrap_tensorflow_internal.so) + 116 [0x286f0b08c] + 2228 stream_executor::(anonymous namespace)::CStreamExecutor::Memcpy(stream_executor::Stream*, void*, stream_executor::DeviceMemoryBase const&, unsigned long long) (in _pywrap_tensorflow_internal.so) + 128 [0x2816595c8] + 2228 metal_plugin::memcpy_dtoh(SP_Device const*, SP_Stream_st*, void*, SP_DeviceMemoryBase const*, unsigned long long, TF_Status*) (in libmetal_plugin.dylib) + 444 [0x126acc224] + 2228 ??? (in AGXMetalG13X) load address 0x1c5cd0000 + 0x1c5ad8 [0x1c5e95ad8] + 2228 -[IOGPUMetalBuffer initWithDevice:pointer:length:options:sysMemSize:gpuAddress:args:argsSize:deallocator:] (in IOGPU) + 332 [0x19ac3ae3c] + 2228 -[IOGPUMetalResource initWithDevice:remoteStorageResource:options:args:argsSize:] (in IOGPU) + 476 [0x19ac469f8] + 2228 IOGPUResourceCreate (in IOGPU) + 224 [0x19ac4c970] + 2228 IOConnectCallMethod (in IOKit) + 236 [0x183104bc4] + 2228 io_connect_method (in IOKit) + 440 [0x183104da8] + 2228 mach_msg (in libsystem_kernel.dylib) + 76 [0x18061dd00] + 2228 mach_msg_trap (in libsystem_kernel.dylib) + 8 [0x18061d954] I'm no expert but it looks like there is deadlock. Training with cpu works by uncommenting line 4. Here are my configurations. MacBook Pro (14-inch, 2021) Apple M1 Pro 32 GB macOS 12.2.1 (21D62) tensorflow-deps           2.8.0   tensorflow-macos          2.8.0   tensorflow-metal          0.4.0   tensorflow-probability    0.16.0
Asked
by wangcheng.
Post not yet marked as solved
15 Views

Accessing array values in published variable fails beyond a single value

I'm trying to access the second value in a published array of CGFloats, and I keep getting the "index out of range" error. In the code below I've given two examples, the first works with a test array of CGFloats, where the Text position works for both xy values. The second ForEach array highlights the problem I'm having where I can only write out the wrapped first value or index [0] but the second value keeps giving me this error. I'm flummoxed! class A: ObservableObject{          @Published var pp: [[CGFloat]] = [[0]] } struct ContentView: View {     @ObservedObject var a = A()          func updateP(){                  var xyvalues = [[56.833333333333336, 153.75], [23.833333333333332, 137.35], [209.0, 229.6], [306.1666666666667, 192.7]]                   for pp in xyvalues{             print(pp)             a.pp.append([pp[0],pp[1]])         }     }     init() {                updateP()         }               var array: [[CGFloat]] = [[2,3],[40,50],[200,200]]     var body: some View {                 ZStack{             ForEach(Array(zip(array.indices, array)), id: \.0) { i, a in                                       Text(a[1].description)                                 .position(x: a[0], y: a[1])                     }                     ForEach(Array(zip($a.pp.indices, $a.pp)), id: \.0) { i, p in                                                  Text(p.wrappedValue.description)                                    .position(x: p.wrappedValue[0], y: p.wrappedValue[0])                             Text(p.wrappedValue.description)                                    .position(x: p.wrappedValue[0], y: p.wrappedValue[1])             }         }     } }
Asked
by Emma8888.
Post not yet marked as solved
11 Views

MacOS Server

macOS Server, Should I consider applying for improved security?
Asked
by Handurus.
Post not yet marked as solved
13 Views

AVPlayer play after load all data

I'm using AVPlayer to play mp3 files from a remote url. i'm having some issues with the initial loading time of the mp3, it is very slow (around 5-8 sec). i compared it with other third parties players and its much slower, i also compared it with an android player and it is also much slower. so the problem is not with the url itself nor with the network connection.. another interesting point is that after the AVPlayer start playing the mp3, seeking is very fast (almost immediately), does that mean the player download the entire mp3 file before start playing, and thats the reason it is so slow? can i control this behaviour? if not, any other ideas what can be the reason?
Asked
Post not yet marked as solved
18 Views

UserNotificationCenter didReceive not working properly in production

I'm experiencing this weird problem where during development the following works flawlessly but is very flaky in production. I'm dynamically adding actions to notifications from my NotificationContent extension. When the user clicks on an action userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) should be called from where my app fires off an HTTP request based on the action that was selected. As already mentioned this works without issues during development but is extremely flaky in production. UNUserNotificationCenterDelegate: extension RealPushNotificationsHandler: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.sound]) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { let userInfo = response.notification.request.content.userInfo if let actionPayload = userInfo["action"] as? String, let notificationUUID = userInfo["uuid"] as? String { // handleAction fires off an HTTP request handleAction(notificationUUID: notificationUUID, actionIdentifier: response.actionIdentifier, actionPayload: actionPayload, completionHandler: completionHandler) } } NotificationContent/NotificationViewController.swift: class NotificationViewController: UIViewController, UNNotificationContentExtension { override func viewDidLoad() { super.viewDidLoad() } func didReceive(_ notification: UNNotification) { var actions: [UNNotificationAction] = [] // Parse actions from notification.request.content.userInfo [...] // Append actions to notification extensionContext?.notificationActions = actions } }
Asked
by Timm1234.
Post not yet marked as solved
13 Views

Controller not working in macOS 12.3

I tried to connect my xbox controller to my MacBook, even though the controller is registered in bluetooth setting, but it doesn't function at all. Have anyone met the same problem and if there's a fix for this problem
Asked
by Wisky_pro.
Post not yet marked as solved
20 Views

I've looked through all my code and still haven't figured out the problem. I wonder what happened?

I wonder what happened? Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x2b50 objc_release + 16 1 libsystem_blocks.dylib 0x17e8 _Block_release + 200 2 libsystem_blocks.dylib 0x17e8 _Block_release + 200 3 Luxy 0xc4d0dc -[AFURLSessionManagerTaskDelegate .cxx_destruct] + 106 (AFURLSessionManager.m:106) 4 libobjc.A.dylib 0x7d28 object_cxxDestructFromClass(objc_object*, objc_class*) + 116 5 libobjc.A.dylib 0x4b74 objc_destructInstance + 80 6 libobjc.A.dylib 0xe1c8 _objc_rootDealloc + 80 7 Luxy 0xc4bdf8 -[AFURLSessionManagerTaskDelegate dealloc] + 152 (AFURLSessionManager.m:152) 8 libsystem_blocks.dylib 0x17e8 _Block_release + 200 9 libdispatch.dylib 0x4670 _dispatch_client_callout + 20 10 libdispatch.dylib 0x12bcc _dispatch_main_queue_callback_4CF + 1036 11 CoreFoundation 0x51d84 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 12 CoreFoundation 0xbf5c __CFRunLoopRun + 2540 13 CoreFoundation 0x1f468 CFRunLoopRunSpecific + 600 14 GraphicsServices 0x138c GSEventRunModal + 164 15 UIKitCore 0x5195d0 -[UIApplication _run] + 1100 16 UIKitCore 0x297f74 UIApplicationMain + 364
Asked
Post not yet marked as solved
31 Views

12.3 RC no longer supporting MJPEG webcam capture

I just installed the release candidate last night, and now most apps can't capture my webcam's full resolution. It's a Logitech C615, and it supports 1080P 30fps, but only over MJPEG. Now apps are either capturing incredibly choppy video, or capturing at the low resolutions the camera supports over RGB.
Asked
by kode54.
Post not yet marked as solved
17 Views

Storing and processing text files

First question: I have a SwiftUI app that runs calculations based on number values and number arrays, both one and two-dimensional, stored in text files. However these text files are stored on my computer, and I wish to have them within the app itself so the app can run the calculations on my phone and other devices apart from my computer. Second question: I'm not sure how to read data from text files. I temporarily made JSON files but this isn't a long-term solution. I wish to be able to have the app read something like Apples: 0 Energy: "10" Mode: "Photo" Depth: 2.0 and be able to store it in an object with the corresponding properties and values so that they may be used in the calculations.
Asked
by pat119.
Post not yet marked as solved
37 Views

expiration_intent not set in pending renewal info for expired subscriptions

Hi, I've noticed we have some fetch tokens that contain an expired subscription, but in the pending renewal info, the expiration_intent field is never set. Here's an example pending renewal info object: { "auto_renew_product_id": "REDACTED", "auto_renew_status": "0", "is_in_billing_retry_period": "0", "original_transaction_id": "REDACTED", "product_id": "REDACTED" } The latest transaction in latest_receipt_info is long expired: { "expires_date": "2022-02-13 18:35:10 Etc/GMT", "expires_date_ms": "1644777310000", "expires_date_pst": "2022-02-13 10:35:10 America/Los_Angeles", "in_app_ownership_type": "PURCHASED", "is_in_intro_offer_period": "false", "is_trial_period": "false", "original_purchase_date": "2021-09-10 05:49:45 Etc/GMT", "original_purchase_date_ms": "1631252985000", "original_purchase_date_pst": "2021-09-09 22:49:45 America/Los_Angeles", "original_transaction_id": "REDACTED", "product_id": "REDACTED", "purchase_date": "2022-01-13 18:35:10 Etc/GMT", "purchase_date_ms": "1642098910000", "purchase_date_pst": "2022-01-13 10:35:10 America/Los_Angeles", "quantity": "1", "subscription_group_identifier": "REDACTED", "transaction_id": "REDACTED", "web_order_line_item_id": "REDACTED" } Is this a bug or a misunderstanding in how expiration_intent should work? For other expired transactions, I do see it getting set (although sometimes it's set weeks after the transaction actually expired).
Asked
Post not yet marked as solved
40 Views

How to find the refunded item key from response body v1 on Server Notification

Question about data format of response body v1 on “Server Notification” (not storekit). https://developer.apple.com/documentation/appstoreservernotifications/responsebodyv1 We’d like to specify the refunded product or purchase record in our database when receiving the REFUND notification. We are guessingproduct_id and original_transaction_id in the most-recent latest_receipt_info are the keys for specify that, and we can find most-recent latest_receipt_info by checking the purchase_date. But we haven’t found official information from apple about that and we can't sure about our guess. We just found infomation about storekit, but not for server notification. https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/handling_refund_notifications Does anyone know the official information or actual utilization experience? What are the rest of the latest_receipt_info array? Why it is designed as array?
Asked
by saka11.