I am trying to make https request in swift, with identity created from certificate and key. My code look like this
To create the identity.
func loadIdentity(certificate: String, privateKey: String)-> SecIdentity? {
guard let certData = Data(base64Encoded: certificate, options:NSData.Base64DecodingOptions.ignoreUnknownCharacters) else {
print("Unable to decode certificate PEM")
return nil
}
guard let cert = SecCertificateCreateWithData(kCFAllocatorDefault, certData as CFData) else {
return nil
}
let addCertQuery: [String: Any] = [kSecClass as String: kSecClassCertificate,
kSecValueRef as String: cert,
kSecAttrLabel as String: "certificateLabel"]
let tag = "fedvfdvdf-tag".data(using: .utf8)!
_ = deleteCertificateAndKey(certLabel: "certificateLabel",keyTag: tag )
let certAddStatus = SecItemAdd(addCertQuery as CFDictionary, nil)
guard let pemKeyData = Data(base64Encoded: privateKey, options:NSData.Base64DecodingOptions.ignoreUnknownCharacters) else {
return nil
}
let sizeInBits = pemKeyData.count * 8
let keyDict: [CFString: Any] = [
kSecAttrKeyType: kSecAttrKeyTypeRSA,
kSecAttrKeyClass: kSecAttrKeyClassPrivate,
kSecAttrKeySizeInBits: NSNumber(value: sizeInBits),
kSecReturnPersistentRef: true
]
var error: Unmanaged<CFError>?
guard let key = SecKeyCreateWithData(pemKeyData as CFData, keyDict as CFDictionary, &error) else {
return nil
}
let addKeyQuery: [String: Any] = [
kSecClass as String: kSecClassKey,
kSecAttrIsPermanent as String: true,
kSecValueRef as String: key,
kSecAttrApplicationTag as String: tag
]
let privKeyAddStatus = SecItemAdd(addKeyQuery as CFDictionary, nil)
let getIdentityQuery = [
kSecClass : kSecClassIdentity,
kSecReturnData : true,
kSecReturnAttributes : true,
kSecReturnRef : true,
kSecMatchLimit : kSecMatchLimitAll
] as CFDictionary
var identityItem: CFTypeRef?
let status = SecItemCopyMatching(getIdentityQuery , &identityItem)
print("identityItem finished with status: \(String(describing: identityItem))")
print("status finished with status: \(status)")
guard status == errSecSuccess else {
print("Unable to create identity")
return nil
}
return (identityItem as! SecIdentity);
}
o make api request. Code is breaking in this function, around this lines let task = session.dataTask(with: request) { (data, response, error) in and let session = URLSession(configuration: .default, delegate: URLSessionPinningDelegate(identity: identity), delegateQueue: nil) For testing I removed identity and just used default URLSession, and request start giving response (although it was 401 but it was not crashing), so my guess is error is because of URLSession.
func makeAzureRequest(scopeId:String, registrationId:String, key:String, certificate:String, provisionHost:String, fileNameWithFolder:String, modelId:String, completion: @escaping (Result<String, Error>) -> Void ) throws {
guard let identity = loadIdentity(certificate: certificate, privateKey: key) else {
throw NSError(domain: "", code: -1, userInfo: [NSLocalizedDescriptionKey: "Unable to create identity"])
}
let session = URLSession(configuration: .default, delegate: URLSessionPinningDelegate(identity: identity), delegateQueue: nil)
print("session: \(session)")
guard let url = URL(string: "https://global.azure-devices-provisioning.net/\(scopeId)/registrations/\(registrationId)/register?api-version=2021-06-01") else {
throw NSError(domain: "", code: -1, userInfo: [NSLocalizedDescriptionKey: "Invalid URL"])
}
var request = URLRequest(url: url)
request.httpMethod = "PUT"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue("utf-8", forHTTPHeaderField: "Content-Encoding")
let body = ["registrationId": registrationId]
request.httpBody = try? JSONSerialization.data(withJSONObject: body, options: [])
let task = session.dataTask(with: request) { (data, response, error) in
if let error = error {
completion(.failure(error))
} else if let data = data, let responseString = String(data: data, encoding: .utf8) {
completion(.success(responseString))
}else {
completion(.failure(NSError(domain: "", code: -1, userInfo: [NSLocalizedDescriptionKey: "Unknown error occurred"])))
}
}
task.resume()
}
to call function where api function is triggered.
@objc(AzureProvisionWithCertificate)
class AzureProvisionWithCertificate: NSObject {
@objc(provisionAndUploadFile:withRegistrationId:withKey:withCertificate:withProvisionHost:withFileNameWithFolder:withModelId:withResolver:withRejecter:)
func provisionAndUploadFile(scopeId:String, registrationId:String, key:String, certificate:String, provisionHost:String, fileNameWithFolder:String, modelId:String, resolve:@escaping RCTPromiseResolveBlock, reject:@escaping RCTPromiseRejectBlock) -> Void {
print("starting swift code here")
do {
try makeAzureRequest(scopeId: scopeId, registrationId:registrationId, key: key, certificate: certificate, provisionHost: provisionHost, fileNameWithFolder: fileNameWithFolder, modelId: modelId) { result in
switch result {
case .success(let responseString):
// Handle success, perhaps update the UI or process the response
case .failure(let error):
// Handle failure, perhaps show an error message to the user
}
}
} catch {
print("Failed to initiate request: (error.localizedDescription)")
}
}
}
And URLSessionPinningDelegate class look like this to SSL pinning.
import Foundation
import Security
class URLSessionPinningDelegate: NSObject, URLSessionDelegate {
var identity: SecIdentity
init(identity: SecIdentity) {
self.identity = identity
}
func urlSession(_ session: URLSession,
didReceive challenge: URLAuthenticationChallenge,
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodClientCertificate {
let credential = URLCredential(identity: self.identity,
certificates: nil,
persistence: .forSession)
completionHandler(.useCredential, credential)
} else {
completionHandler(.performDefaultHandling, nil)
}
}
}
Apple Developers
RSS for tagThis 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.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
The app is developed using react native. The issue is only in the iOS app but not in the Android. The app crashes when it is opened. And after the first crash, it will work if we try to open it again.
We do not know much about the cause of the crash as it is not replicated in debug mode.
Here is the app crash report we got from the test flight app.
Incident Identifier: 5E35C4DD-8CCC-43D3-A2B3-152277C9013E
Distributor ID: com.apple.AppStore
Hardware Model: iPhone13,1
Process: WATAMUKI_MOBILE [9673]
Path: /private/var/containers/Bundle/Application/DF3C370A-0AF0-482A-ABFC-4C926BD37605/WATAMUKI_MOBILE.app/WATAMUKI_MOBILE
Identifier: jp.watamuki.ios
Version: 9.7 (134)
AppStoreTools: 15F31e
AppVariant: 1:iPhone13,1:15
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: jp.watamuki.ios [2520]
Date/Time: 2024-08-16 16:24:12.0699 +0900
Launch Time: 2024-08-16 16:23:49.0526 +0900
OS Version: iPhone OS 17.5.1 (21F90)
Release Type: User
Baseband Version: 4.50.06
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: WATAMUKI_MOBILE [9673]
Triggered by Thread: 21
Thread 21 name:
Thread 21 Crashed:
0 libsystem_kernel.dylib 0x00000001ee12b42c __pthread_kill + 8 (:-1)
1 libsystem_pthread.dylib 0x0000000201ecac0c pthread_kill + 268 (pthread.c:1721)
2 libsystem_c.dylib 0x00000001acfceba0 abort + 180 (abort.c:118)
3 libc++abi.dylib 0x0000000201de8ca4 abort_message + 132 (abort_message.cpp:78)
4 libc++abi.dylib 0x0000000201dd8e5c demangling_terminate_handler() + 348 (cxa_default_handlers.cpp:77)
5 libobjc.A.dylib 0x000000019cf41e2c _objc_terminate() + 144 (objc-exception.mm:496)
6 libc++abi.dylib 0x0000000201de8068 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59)
7 libc++abi.dylib 0x0000000201de800c std::terminate() + 108 (cxa_handlers.cpp:88)
8 libdispatch.dylib 0x00000001acf15de8 _dispatch_client_callout + 40 (object.m:579)
9 libdispatch.dylib 0x00000001acf1d400 _dispatch_lane_serial_drain + 748 (queue.c:3900)
10 libdispatch.dylib 0x00000001acf1df30 _dispatch_lane_invoke + 380 (queue.c:3991)
11 libdispatch.dylib 0x00000001acf28cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
12 libdispatch.dylib 0x00000001acf28528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
13 libsystem_pthread.dylib 0x0000000201ec7934 _pthread_wqthread + 288 (pthread.c:2696)
14 libsystem_pthread.dylib 0x0000000201ec40cc start_wqthread + 8 (:-1)
Thread 21 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000201ded2c3 x5: 0x000000016e6c6810 x6: 0x000000000000006e x7: 0x0000000000000000
x8: 0xf72f9e93f4d9ff97 x9: 0xf72f9e929ab58f97 x10: 0x0000000000000200 x11: 0x000000016e6c6340
x12: 0x0000000000000000 x13: 0x00000000001ff800 x14: 0x0000000000000010 x15: 0x0000000000000000
x16: 0x0000000000000148 x17: 0x000000016e6c7000 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x0000000000008a17 x21: 0x000000016e6c70e0 x22: 0x0000000000000114 x23: 0x000000016e6c70e0
x24: 0x0000000300dc6868 x25: 0x0000000303998700 x26: 0x0000000000000000 x27: 0x0000000303998700
x28: 0x0000000000000000 fp: 0x000000016e6c6780 lr: 0x0000000201ecac0c
sp: 0x000000016e6c6760 pc: 0x00000001ee12b42c cpsr: 0x40001000
esr: 0x56000080 Address size fault
Apple App Store 审查委员会的电子邮件地址是什么?我们想上诉
Topic:
Community
SubTopic:
Apple Developers
I created a new XCode project by cloning a working project and then changing the name from SafetyTalks to Insights everywhere I found it in the XCode interface. after doing so, everything built and was published without any issues many times. Several weeks later, when attempting to execute the following command:
xcodebuild -scheme ${scheme} archive -archivePath ${archiveFilePath}
in a script that has also been used successfully many times in the past is suddenly writing the archive to the path that includes the name of the other project. Finder instead of Insights. When the following command is executed:
xcodebuild -exportArchive -archivePath ${archiveFilePath} -exportPath ${exportsDirectory} -exportOptionsPlist scripts/ExportOptions.plist
I receive the following response:
2024-08-20 16:10:40.179 xcodebuild[91395:1849040] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/c7/qf7lbb955yx4yd0w9wrwxfqjhyxryd/T/gov.ornl.finder.prod.intune_2024-08-20_16-10-40.177.xcdistributionlogs".
error: exportArchive: "Insights.app" requires a provisioning profile.
Error Domain=IDEProvisioningErrorDomain Code=9 ""Insights.app" requires a provisioning profile." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription="Insights.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}
** EXPORT FAILED **
mv: rename /Users/l4e/Mobile/Apps/Temp/Exports/insights.ipa to /Users/l4e/Mobile/Apps/Temp/Exports/gov.ornl.insights.prod.intune-1.0.0.3.ipa: No such file or directory
cp: /Users/l4e/Mobile/Apps/Temp/Exports/gov.ornl.insights.prod.intune-1.0.0.3.ipa: No such file or directory
cp: /Users/l4e/Mobile/Apps/Temp/Exports/gov.ornl.insights.prod.intune-1.0.0.3.ipa: No such file or directory
I have reviewed every single place within the XCode GUI and have not found the name Finder anywhere. I also had another developer review it together and still the name Finder was not found.
I have also cleaned the Build folder and have rebuilt it many times without success. What I think may happening is that somewhere there may be the Finder value that is written in a file that is inaccessible to the XCode GUI.
I have researched this and tried many suggested fixes but so far none have resolved it. All comments and suggestions are welcome.
Topic:
Community
SubTopic:
Apple Developers
At what age should I try I am 15 years old
Topic:
Community
SubTopic:
Apple Developers
I have a big issue with Apple care+. I am from Hungary, but I have bought my phone on a trip in Netherlands, bought the Apple care+ with the phone together. I come back to Hungary and a few months later crashed my phone. I would like to use my advantages of my Apple care+, I mean I would like to exchange my for 99€ as in the contract, but I can’t because in Hungary there is no original Apple store and service. Here is my question: How can I solve this problem??
Thank you in advance!
Best regards,
Attila
Hello,
My system is a 2020 M1 Macbook Air running MacOS 15 Beta 7
Without going into too much details, I ran "sudo chown -R user1 /" and allowed it to run through-- some files and folders didnt get affected due to permissions but for the files that got their permissions changed--I cant do basic things when logged in as user2 or the root user.
For example: sudo command with anything as the shell would hang, or another thing is the system would get stuck at almost half way into verifying whatever .dmg or .pkg I would be trying to install. A Get Info look at /usr/bin/sudo shows that the admin and everyone groups have no access so I think thats why I couldnt use sudo.
What options besides booting into recovery to reinstall do I have to remedy this? Because due to a faulty power button, the Macbook shuts down 5 seconds into the 10 required holding the button in order to get the startup options screen.
Is there any way I can repair the permissions? I have a Time Machine backup from a date before when I ran this command if restoring is the only thing that will work. Also worth mentioning is that I have Tinkertool System, Onyx, and CleanMyMac installed just incase I would need a 3rd party tool to fix this.
Cheers,
Topic:
Community
SubTopic:
Apple Developers
I keep getting these CAPTCHA messages with an I IP address and a site link and there are many files on my phone which I don’t understand
As I try to navigate sites, I get a CAPTCHA message of different types. With IP addresses and URLs.
IP address: 2a04:4e41:62::9ce7:d3c7
Time: 2024-08-23T06:27:11Z
URL: https://www.google.com/search?q=com.apple.os.update-E308CACB9FB73322E7681CC9DAFA19CF788DA2672BFBE91158D3C85061851851%40%2Fdev%2Fdisk1s1+on+%2F+(apfs%2C+sealed%2C+local%2C+nosuid%2C+read-only%2C+journaled%2C+noatime)+devfs+on+%2Fdev+(devfs%2C+local%2C+nosuid%2C+nobrowse)+%2Fdev%2Fdisk1s6+on+%2Fprivate%2Fpreboot+(apfs%2C+local%2C+nosuid%2C+journaled%2C+noatime)+%2Fdev%2Fdisk1s3+on+%2Fprivate%2Fxarts+(apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+nobrowse)+%2Fdev%2Fdisk1s2+on+%2Fprivate%2Fvar+(apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+protect)+%2Fdev%2Fdisk1s4+on+%2Fprivate%2Fvar%2Fwireless%2Fbaseband_data+(apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+nobrowse)+%2Fdev%2Fdisk1s7+on+%2Fprivate%2Fvar%2FMobileSoftwareUpdate+(apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+nobrowse)+%2Fdev%2Fdisk1s5+on+%2Fprivate%2Fvar%2Fhardware+(apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+nobrowse)+%2Fdev%2Fdisk1s8+on+%2Fprivate%2Fvar%2Fmobile+ (apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+protect)&ie=UTF-8&oe=UTF-8&hl=en-us&client=safari
q=com.apple.os.update-E308CACB9FB73322E7681CC9DAFA19CF788DA2672BFBE91158D3C85061851851%40%2Fdev%2Fdisk1s1+on+%2F+(apfs%2C+sealed%2C+local%2C+nosuid%2C+read-only%2C+journaled%2C+noatime)+devfs+on+%2Fdev+(devfs%2C+local%2C+nosuid%2C+nobrowse)+%2Fdev%2Fdisk1s
6+on+%2Fprivate%2Fpreboot+ (apfs%2C+local%2C+nosuid%2C+journaled%2C+noatime)+%2Fdev%2Fdisk1s3+on+%2Fprivate%2Fxarts+ (apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+nobrowse)+%2Fdev%2Fdisk1s2+on+%2Fprivate%2Fvar+ (apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+protect)+%2Fdev%2Fdisk1s4+on+%2Fprivate%2Fvar%2Fwireless%2Fbaseband_data+ (apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+nobrowse)+%2Fdev%2Fdisk1s7+on+%2Fprivate%2Fvar%2FMobileSoftwareUpdate+ (apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+nobrowse)+%2Fdev%2Fdisk1s5+on+%2Fprivate%2Fvar%2Fhardware+ (apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+nobrowse)+%2Fdev%2Fdisk1s8+on+%2Fprivate%2Fvar%2Fmobile+ (apfs%2C+local%2C+nodev%2C+nosuid%2C+journaled%2C+noatime%2C+protect)&ie=UTF-8&oe=UTF-8&hl=en-us&client=safari
https://www.google.com/search?q=com.apple.os.update-E308CACB9FB73322E7681CC9DAFA19CF788DA2672BFBE91158D3C85061851851%40%2Fdev%2Fdisk1s1+on+%2F+ apfs%2C+sealed%2C+local%2C+nosuid%2C+read-only%2C+journaled%2C+noatime)+devfs+on+%2Fdev+(devfs%2C+local%2C+nosuid%2C+nobrowse)+%2Fdev%2Fdisk1s6+on+%2Fprivate%2Fpreboot
Topic:
Community
SubTopic:
Apple Developers
My app is rejected from iOS review.
And It says that app crashed in only iPad.
I test with iPhone and iPad (5th generation) same as tested device in review, it works fine.
But I can't read crash report.
Can you give me some advice regarding what makes my app crash only in iPad?
crash report
I just suspect that I remove some cache in resume cycle of flutter app in main.dart.
@override
void deactivate() {
removeDiaryRankingCache();
super.deactivate();
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
if (state == AppLifecycleState.resumed) {
updateLastVisit();
removeDiaryRankingCache();
}
}
And this removeDiaryRankingCache() takes so much time and it is over allocated time to launch app in iPad or use so much memory over allocated storage of iPad..?
Please help me in any way.
Several weeks ago I made the decision to remove Grammarly from my system. I thought I was very thorough! I removed the app from my system and removed the extension from all my browsers. Somehow, it's still hanging around on the System Settings table for "Login Items & Extensions". I've turned it off for now, but I would feel better if it was gone for good.
I've checked the usual spots:
/Root Drive/Library/LaunchAgents is clear of Grammarly
/Root Drive/Library/LaunchDaemons is clear
A search in Finder only found one instance of "Gramm" showing up, buried in "Root Drive/Users/[My User Name]/Library/Group Containers/group.com.apple.chronod/chronod/remoteArchives/9FA76407-9FBF-434F-81CC-B28224F8DCC8
Any other input or suggestions would be much appreciated - I'd like to try anything before formatting and reinstalling the OS just to address this one small issue.
Oh, here's some info on my system: 2022 13-inch MacBook Pro M2, running macOS Sequoia Beta version 15.1 (24B5024e)
I was involved in a serious accident which I survived but my old M1 Macbook Air didn't. I couldn't afford a new one so I turned to the Facebook Marketplace and found an iCloud Activation locked 2020 M1 Macbook Air exactly like mine for $100 and couldn't resist not buying it. The guy selling it didn't look like he even knew what a Macbook is so I figured it was stolen.
I was able to harvest my HD and Touch ID from the old one and did the whole switcheroo and ended up with an almost brand new Macbook after doing a Time Machine restore with no issues and used it for 1 year.
The only thing I wasn't able to do was enter recovery mode. For some reason whenever I hold the power/Touch ID button for longer than 2 seconds the Macbook would immediately power off no matter how many times I tried. I eventually gave up troubleshooting the thing because not being able to enter recovery mode was something I could live with given all that's happened.
2 weeks ago my Touch ID stopped working and I don't know if it was long overdue or because I'm a slob and eat and smoke over the keyboard. Even my password wouldn't get accepted so I needed to reinstall MacOS. I was able to erase my Mac (from Disk Utility) and reinstall after pivoting from the Apple ID reset and then restored from an earlier back and I'm back to normal running Mac OS 15.1 Beta 2 but without a functioning Touch ID.
I hate being back in this scenario but I now realize the importance of being able to boot into recovery however I still can't afford a new laptop and trying to fix the Touch ID button costs $120 which I'm trying to avoid-- plus I don't even know if that would fix the problem, even though the fingerprint reading function returns.
I tried running a Python script from my Documents directory that forced boot-args on the nvram thinking maybe that would get me into recovery. It worked by shutting down the Macbook but then after restart it booted straight into MacOS.
Can someone please give me an expert's opinion? Is this the work of the SIP after I swapped the components or is it because of a faulty power button?
My ideal scenario is to be able to run a script but I don't know how feasible that is, otherwise, my next option is to replace the TouchID system but even with this there are doubts.
Appreciate any help.
Over this past weekend, a client reported the font for a specific page only on their website was TINY. After checking it out, it appears this is ONLY happening on iPhone browsers. Desktop and Andriod font size for the page did not change. We did not change any code on the site, either.
Is it possible this is related to an iPhone update? Would anyone be able to help me figure out this issue? Since it can't be replicated on any other device browser, and it happens on both Safari AND Chrome on the iPhone, it has to be something related to the iPhone itself.
I have also tried adjusting the font size, but no matter what I do if it looks ok for the iPhone, it is WAY too large on other devices, so this isn't the resolution.
If anyone has any ideas on what may have caused this or how to fix it, that would be great!
Thanks in advance for your time!
Hello Apple Developer Community,
I am seeking advice on how to pass the App Store review process for my app, HabitBet. Our app is designed to encourage users to develop healthy habits through real-world challenges, such as exercising, cooking, or learning new skills. Users are required to participate in these activities and provide proof of completion (such as photos or activity logs).
In addition to the real-world challenges, HabitBet allows users to set a financial commitment by entering a chosen amount of money when joining a challenge. If the user fails to complete the challenge, the set amount is charged. We believe this mechanism leverages behavioral economics to motivate users to achieve their goals and does not constitute paid digital content, as it involves actual physical actions and verifiable participation.
Recently, our app was rejected by Apple due to concerns about using paid digital content to drive user engagement. However, we think our app's challenges differ from digital content because they involve real-life actions and a unique form of user-driven commitment.
Additionally, we found similar apps like StepBet (https://apps.apple.com/jp/app/stepbet-walk-get-active-win/id1056175729), which utilize financial stakes to encourage real-world activities, that have been approved for the App Store. We would like to understand what differentiates our app's model from these examples and how we can align more closely with Apple's guidelines.
Could anyone provide guidance on how we can clearly demonstrate that our app’s challenges are not digital content and meet the App Store guidelines? Has anyone faced similar issues and found a solution?
Thank you in advance for your help.
Best regards,
Am new enough to SwiftUI that I that are still some concepts that confuse me. Case in point: .background
The code below is meant to detect when the user drags their finger over different areas, in this case three different size circles placed over each other.
The code works, but I get lost trying to figure out how the logic works.
.background calls a function that's a view builder, yet doesn't an actual view? Unless Color.clear is the view it's returning?
I have more questions, but might as well start with .background since it comes first? I think?
Thanks
import SwiftUI
struct ContentView: View {
@State private var dragLocation = CGPoint.zero
@State private var dragInfo = " "
@State private var secondText = "..."
private func dragDetector(for name: String) -> some View {
GeometryReader { proxy in
let frame = proxy.frame(in: .global)
let isDragLocationInsideFrame = frame.contains(dragLocation)
let isDragLocationInsideCircle = isDragLocationInsideFrame &&
Circle().path(in: frame).contains(dragLocation)
Color.clear
.onChange(of: isDragLocationInsideCircle) { oldVal, newVal in
if dragLocation != .zero {
dragInfo = "\(newVal ? "entering" : "leaving") \(name)..."
}
}
}
}
var body: some View {
ZStack {
Color(white: 0.2)
VStack(spacing: 50) {
Text(dragInfo)
.padding(.top, 60)
.foregroundStyle(.white)
Text(secondText)
.foregroundStyle(.white)
Spacer()
ZStack {
Circle()
.fill(.red)
.frame(width: 200, height: 200)
.background { dragDetector(for: "red") }
Circle()
.fill(.white)
.frame(width: 120, height: 120)
.background { dragDetector(for: "white") }
Circle()
.fill(.blue)
.frame(width: 50, height: 50)
.background { dragDetector(for: "blue") }
}
.padding(.bottom, 30)
}
}
.ignoresSafeArea()
.gesture(
DragGesture(coordinateSpace: .global)
.onChanged { val in
dragLocation = val.location
secondText = "\(Int(dragLocation.x)) ... \(Int(dragLocation.y))"
}
.onEnded { val in
dragLocation = .zero
dragInfo = " "
}
)
}
}
#Preview {
ContentView()
}
As an iOS developer, you have to know Objective-C, Swift, UIKit, SwiftUI, Flutter, ReactNative, and use them to develop your App. If you only know one of them, you will easily lose your job or have a hard time finding an iOS development job. Some companies even require you to know how to use them all. It is so crazy.
Topic:
Community
SubTopic:
Apple Developers
Hello, I am creating an app to let users coding html css and JavaScript.
i did import WebKiit and SuiftUI, but has somany errors in the code to implement my logic so users can switch between html css and Javascript.
i did create the program and working perfectly and created an app using Built in Apple the lunch Automator
programs works perfect , and wants it to build an app on. Xcode for macOS .
comes with so many errors in and red the documentation still have so many bugs .
import SwiftUI
import Webkit
struct ContentView: View {
@State private var webView: WKEebview = WKWebview()
….
main bugs :
webView.evaluateJavaScript ….
xcode didnt recognize the instance .
looking for recommendations.
Thanks again
Topic:
Community
SubTopic:
Apple Developers
Hello everyone, on August 31st, all the apps in my personal developer account were suddenly expired and deleted, I have not received any response from Apple. My apps are in compliance with Apple's policies. I then uploaded a new version and sent it to the review team, but I received the following error "There was an error processing your request. Please try again later."
I have contacted Apple via Email and Phone but no one cares about my problem.
Has anyone had the same situation as me, I am really worried.
Hi everyone, on August 31st all the apps in my personal developer account were suddenly expired and deleted, I have not received any response from Apple. My apps were in compliance with Apple's policies. I then uploaded a new version and sent it to the review team but I received the following error "There was an error processing your request. Please try again later."
I'm from Cambodia, I can't enroll apple developer program with Mackbook pro M3
Error message 'Sorry, you can’t enroll at this time.'
Do you know what's problem?
Gambling apps use real money bets, somehow they get past apple censorship. I hope the management will handle this
https://apps.apple.com/vn/app/express-sorting-master/id6479975539?l=vi
https://apps.apple.com/vn/app/janken-finger-club/id6482991646?l=vi
https://apps.apple.com/vn/app/us-rider-racing/id6504385105?l=vi
https://apps.apple.com/vn/app/td-pet-guardian-battle/id6502398066?l=vi
https://apps.apple.com/vn/app/shooter-water-balloons/id6593688592?l=vi
Topic:
Community
SubTopic:
Apple Developers