Apple Developers

RSS for tag

This is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and foster a supportive community.

Learn More

Posts under Apple Developers subtopic

Post

Replies

Boosts

Views

Activity

How to use donated users in your application and display Siri recommended users in Safari's system sharing
The following is my code, which runs successfully and is recommended to succeed, but it still does not show Siri's suggestion to users in the system sharing in Safari import AppIntents import Contacts import CoreSpotlight import Intents import UIKit class TestViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.white DispatchQueue.global().async { self.donateMessageInteraction(recipientName: "张三", phoneNumber: "+8613812345678") } } func donateMessageInteraction(recipientName: String, phoneNumber: String) { INPreferences.requestSiriAuthorization { status in guard status == .authorized else { return } // 1. 创建接收者 let recipientHandle = INPersonHandle(value: phoneNumber, type: .phoneNumber) let recipient = INPerson( personHandle: recipientHandle, nameComponents: nil, displayName: recipientName, image: nil, contactIdentifier: nil, customIdentifier: "com.yourapp.recipient.\(phoneNumber)" ) // 2. 创建发送者(你的应用身份) let senderHandle = INPersonHandle(value: "15210639372@163.com", type: .emailAddress) let sender = INPerson( personHandle: senderHandle, nameComponents: nil, displayName: "我的应用", image: nil, contactIdentifier: nil, customIdentifier: "com.yourapp.sender" ) // 3. 创建消息意图 let intent = INSendMessageIntent( recipients: [recipient], outgoingMessageType: .outgoingMessageText, content: "最近怎么样?", // 常用消息内容 speakableGroupName: nil, // 群组名称(一对一设为nil) conversationIdentifier: "com.yourapp.conversation.\(phoneNumber)", // 唯一会话ID serviceName: "My Chat Service", // 你的消息服务名称 sender: sender, // 发送者身份 attachments: nil ) // 4. 配置意图参数 intent.setImage(INImage(named: "user0"), forParameterNamed: \.sender) // 5. 创建并捐赠交互 let interaction = INInteraction(intent: intent, response: nil) interaction.direction = .outgoing interaction.donate { error in error.map { print("捐赠失败: \($0)") } } print("捐赠代码执行完成") } } }
0
0
346
Feb ’25
iCloud problem
I use microsoft office excel 2007. When I save a file located in the icloud, the file (often) turns into this the problem, for example, is that excel does not see this file (I'm trying to open it from excel) when I try to open the file manually, it says: The actual format of the file you are trying to open (26068000) is different from the file extension indicated. Before opening this file, make sure it is not corrupted and comes from a trusted source. Do you want to open this file now? icloud' developers, please fix it, thx.
1
0
276
Dec ’24
When navigationstack is using two times in SWIFTUI
Hello, I use Navigationstack in the first and second views. In this case, the second view is executed immediately and then disappears. Is there a solution? The code is as follows. device = i-phone struct ContentView: View { @State var path: [String] = [] var body: some View { NavigationStack(path: $path) { VStack { Text("Screen1") Spacer() Button(action: { path.append("2nd") }, label: { Text("go to 2nd Screen") }) } .navigationDestination(for: String.self) { s in if s == "2nd" { let _ = print("1st screen nav path(1) = \(path)") SecondScreen(path: $path) let _ = print("1st screen nav path(2) = \(path)") } } .onAppear { print("1st screen on appear") print("1st screen path = \(path)") } .onDisappear { print("1st screen on disappear") print("1st screen disa. path = \(path)") } .padding() } } } struct SecondScreen: View { @State var path2: [String] = [] @Binding var path: [String] var body: some View { NavigationStack(path: $path2) { VStack { Text("2nd Screen is loaded") Spacer() Button(action: { path2.append("3rd") } , label: { Text("go to 3rd Screen") }) Button(action: { path2.removeLast() } , label: { Text("back to 1st Screen") }) } .navigationDestination(for: String.self) { s in if s == "3rd" { // Text("3rd") thirdScreen() } else { thirdScreen() } } } .onAppear { print("2nd screen on appear") print("2nd screen path = \(path)") print("2nd screen path2 = \(path2)") } .onDisappear { print("2nd screen on disappear") print("2nd screen path = \(path)") print("2nd screen disa. path2 = \(path2)") } } } struct thirdScreen: View { var body: some View { VStack { Text("3rd Screen") } .onAppear { print("3rd screen on appear") } .onDisappear { print("3rd screen on disappear") } } }
0
0
193
Jan ’25
POSIX 96
I’m having trouble downloading my yahoo emails. I use the Mail function for all my email accounts. The Comcast emails seem to be downloading fine. I get the posix96 error. Is there a fix for this yet??
1
0
389
Feb ’25
Error when copying Home Directory
I am trying to move my home directory to a secondary drive, but I am running into to two issues. When I try to do it via Finder I get the error - The operation can’t be completed because “<my account name>” needs to be downloaded. And when I try to do it via the terminal in recovery mode (after mounting the Data directory), It seems to copy a set of directories within ~/Library/Daemon Containers/. These appear to be snapshots of some sort, which when cp runs, end up taking up the entire drive of the target drive, which is 4 times larger than my base volume. Two questions: Why I am getting the message via finder (and how do I get around it? What is the correct process for moving the home directory to a second drive? Thanks!
0
0
452
Dec ’24
How to Get Incoming Call Notifications to Create a Phone App in iOS 18.2+?
I am trying to create a phone app that can receive incoming call notifications using CallKit, as described in Apple's CallKit documentation. Added the com.apple.developer.calling-app entitlement in my .entitlements file. Implemented CXProvider and set up the delegate methods (provider:perform: and providerDidReset). Added UIBackgroundModes with voip in Info.plist. Configured CXProviderConfiguration to support phone numbers. I expected to receive incoming call notifications when my app was set as the default calling app. However, I am not receiving any notifications when an incoming call arrives. How can I properly detect and handle incoming calls in my default calling app? Is there any additional configuration required for iOS 18.2+?
0
0
318
Feb ’25
App crash!!!
Phone application is crashing every time I try to update WhatsApp has contact saved on my Iphone12, why? Mobile phone crash report from settings linkText Click on update contact option and you will redirect to review and update page without any data visibility. On clicking this update button, app crashes instantly.
1
0
491
Jan ’25
Rejected After 40 Days with a US LLC for Publishing App on Google Play: Anyone with Similar Experience?
Hi everyone, I’m a developer from Argentina, and I recently attempted to publish my app on Google Play under a US LLC. I submitted all the required documentation and followed the process step-by-step. After 40 days of back-and-forth communication and providing all the requested information, my application was ultimately rejected without a clear explanation. I understand that having a US company and bank account is a requirement for developers like me to operate internationally, but this rejection has left me quite confused about what went wrong. Has anyone else faced a similar situation? If so, how did you resolve it? Any advice or guidance would be greatly appreciated! Thanks in advance!
0
0
244
Dec ’24
NFC iOS 18.0 slow
Why NFC tags shown speed is slower than iOS 16.0? After paying with Apple Wallet with iOS 18.0, it seems that it could only detect the NFC tags after 5s, it is the particularity of the iOS 18.0? How can it be quick as former version?
0
0
271
Jan ’25
Asking for help with a rejection that lasts several weeks
https://www.youtube.com/watch?v=PO4UBVURX7M I've been getting rejected for several weeks, but I'll try to solve the problem through search or kindly provide guidance. The problem of claiming that the splash screen is frozen is frustrating because it cannot be reproduced. I also took a video and delivered it, and I'm really trying my best, but I don't know how. If you are developing in Flutter and receive feedback that it is stuck on the splash screen, can you get help on how to resolve it? What I found out through searching is to build it in the shell as follows: sudo rm -rf $HOME/Library/Developer/Xcode/DerivedData/* && cd ~/Projects/myproject && flutter clean && flutter pub get && cd ios && rm -rf Podfile.lock Pods && pod install && cd .. && flutter build ios --release and xcode -> archive -> apple upload. Even if I upload like this, there is a splash problem sometimes and I don't know what to do.
1
0
255
Dec ’24
iOS 18.3 (22D5040d) issues with unexpected shut downs and heavy battery drain
its crazy on my iphone 11 pro max . all of a sudden my battery is not recognized down to 1% keeps crashing cant open any apps keep rebooting absolutely the worse . after all this am finally gonna have to leave the apple echo system. apple seams to be a huge failure at the time. any one ger tips on this cause am heading to downgrade possible 18.2 cause all that issue did not exist till 18.3 beta
0
0
882
Jan ’25