Post not yet marked as solved
[<p>"></p><img src="x" onerror="prompt(document.domain)"><p>"></p>"><script></script><p><"</p><p><"</p>.csv](https://developer.apple.com/forums/content/attachment/db80e264-a325-4ffe-b4b7-f9ee722a4abb)
`"><h1>hi</h1>`
Post not yet marked as solved
Hello
I'm building an indoor geofencing app with iBeacons.
I want to detect each time a user approaches a beacon and the distance and save this data with Core Data only if the distance (proximity) to the iBeacon is close.
I am using Core Location to do this but I am not using the didEnter / didExit functions as they do not provide the distance to the beacon. I am mainly using the didRange function from locationManager to get all the beacons, find the closest one and its distance.
This approach works perfectly while the app is in the foreground. However, the app starts not working properly in the background. If I just change the app, the didRange function stops working, but if I lock the phone and look at the time on the lock screen, it starts working. The problem is not that the app does not work in the background, but that the functions are activated only in specific cases or times, eg. the phone is locked.
I added those properties in the info.plist
Privacy - Location When In Use Usage Description
Privacy - Location Always and When In Use Usage Description
Required background modes:
Location updates
I also added this code:
locationManager.delegate = self
locationManager.allowsBackgroundLocationUpdates = true
locationManager.pausesLocationUpdatesAutomatically = false
This is how I add a beacon and start monitoring it:
func addBeacon(id: String, major: Int16 = 0, minor: Int16 = 0) {
guard let uuid = UUID(uuidString: id) else { return }
let region = CLBeaconRegion(uuid: uuid, major: CLBeaconMajorValue(major), minor: CLBeaconMinorValue(minor), identifier: id + major.description + minor.description)
region.notifyOnEntry = true
region.notifyOnExit = true
region.notifyEntryStateOnDisplay = true
self.locationManager.startMonitoring(for: region)
resetValues()
}
func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) {
let beaconRegion = region as! CLBeaconRegion
if state == .inside {
// Start ranging when inside a region.
manager.startRangingBeacons(satisfying: beaconRegion.beaconIdentityConstraint)
} else {
// Stop ranging when not inside a region.
manager.stopRangingBeacons(satisfying: beaconRegion.beaconIdentityConstraint)
}
}
I am also making sure that locationManager.requestAlwaysAuthorization() is always true
Do you have any ideas why it is not always working in the background?
Thanks for your time.
Post not yet marked as solved
In the case where an app uses the Photo Library to reload images by using a fetchRequest with localIdentifier there is hole in the following guidance in WWDC21 "Improve access to Photos in your app"
"When the picker session is completed, selected photos will be returned to your app. Suppose the configuration is initialized with a PHPhotoLibrary object, picker results will contain both item providers and asset identifiers. Your app can use the item provider to load and display selected photos."
The picker result providers do not load the image if the image is not in the limited library list, even though the user has selected them with the PHPicker.
It looks like the workaround is to raise a user error that the image is not loaded because it is not in the limited selection, then do the PHPhotoLibrary.shared().presentLimitedLibraryPicker so the limited selection is the way the user wants it.
This workaround seems like an awful thing to do to the user since they have to pick the same photo(s) twice..
Also - this scenario works fine with the PHPickerDemo because privacy setting for the demo is not added in settings.. Presumably because PHPickerDemo is not directly using the PhotoKit API methods.
Any thoughts or workaround alternatives that you see? Or raise a bug?
Thanks!!
Post not yet marked as solved
Hi,
Please see my code below:
` func configureRequestButton() {
let button = UIButton()
button.setTitle("Test", for: .normal)
button.setTitleColor(.systemBlue,for: .normal)
button.addTarget(self,
action: #selector(button), <---- need the fuction to execute here
for: .touchUpInside)
StackView.addArrangedSubview(button)
}
func requestMusicAuthorization() async throws {
let authorizationStatus = await MusicAuthorization.request()
if authorizationStatus == .authorized {
isAuthorizedForMusicKit = true
} else {
// User denied permission.
}
}````
So I need to basically call that request music authorisation function in that test button but every time I do it says you have to conform it to object c if I do it crashes the app. I have done the Plist stuff. I am using UIKIt programmatically coding the UI. Can someone help because most of the api docs is based for swifUI for music kit.
Post not yet marked as solved
Hey! I work for a company based out of the US office and we would love to speak with anyone that has prior experience with customer support software. My team is working on research and would love to hear what your personal experiences have been while building software such as ZenDesk and LiveChat
Post not yet marked as solved
Hey, I'm trying to use the Google services in my MERN project. like (google authentication, send mail by nodemailer with google)
but it's working for all devices except the IOS devices in the USA.
I tried to inspect the response with the Safari web inspector and got this response. How can I fix this issue?
Post not yet marked as solved
We are developing an iOS app for our Computer Aided Dispatch system which is used by dozens of major police and other first responder agencies in the US. One of the required functionalities is that the device provide very frequent position updates, even when in the background (requirement is every 5 seconds, might be able to talk it down a bit...). Among other reasons, this is so an officer on foot would accurately appear on the maps of other officers. This data is critical to assisting the officers in (for example) not accidentally shooting each other by accident.
We also very much would like to keep a websocket open even when in the background as well, as this is used to keep the device up to date on the positions of the other officers, so that the map is up to date when they return to the app.
We understand this is going to be a major hit to battery life (especially frequent GPS updates), but the agencies understand this and are willing to deal with it in order to support these life-critical functionalities. Is there any way to enable this, or are we totally out of luck. The inability to do this is going to present our iOS app in a very bad light compared against the Android version.
Post not yet marked as solved
Hi,
Looking for an option to get rid of empty tab bar on top of the subject template. it takes a lot of screen estate and i don't plan to use it for app functionality.
It is marked with red on the picture.
As per documentation here: Link1 there is nothing about the tabs.
However in CarPlay programming guide Carplay it seems like the template doesn't have this top tab:
where is the truth? can it be hidden?
Thank you!
Post not yet marked as solved
Following the instructions here: https://developer.apple.com/metal/tensorflow-plugin/
When I do the step: conda install -c apple tensorflow-deps
I get:
Downloading and Extracting Packages
tensorflow-deps-2.9. | 3 KB | | 0%
CondaHTTPError: HTTP 403 FORBIDDEN for url https://conda.anaconda.org/apple/osx-arm64/tensorflow-deps-2.9.0-0.tar.bz2
Elapsed: 00:00.362533
CF-RAY: 72dd062a7a7cae2a-BOS
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
I tried downloading it using curl and the browser and got the same problem.
It appears that the version prior to 2.8 are there, but 2.8 and 2.9 give the same error.
Any advice?
Post not yet marked as solved
Hello dear community,
I am reaching out to your as I am building an app that works very well on Expo client, for which I achieve to build on iOS, but when launching it on Testflight, the app instantly crashes with the crash report attached.
Any help would be more than welcome.
2022-07-20_18-13-57.1538_+0200-161cd0da9ad5819b162a525b4e08056dddff1e65.crash
Post not yet marked as solved
Hi,
One application I'm maintaining crashes on iOS16 beta 3 with an exception
"Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES".
I'm running out of ideas how totrace down the reason.
It only happens when the Main Thread checker is enabled
it happens even if I display the alertcontroller totally early in applicationDidFinishLaunching
a new setup sample with pretty much identical code (see below) until applicationDidFinishLaunching (and main.xib) does not throw the exception regardless of the Main Thread checker state
I validated the build settings are identical between the sample and the crashing app
#import "OCViewController.h"
@interface OCAppDelegate: NSObject <UIApplicationDelegate>
@property (nonatomic, readwrite, strong) IBOutlet UIWindow *window;
@property (nonatomic, readwrite, strong) IBOutlet UINavigationController *navigationController;
@end
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([OCAppDelegate class]));
}
}
@implementation OCAppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
OCViewController *vc = [OCViewController new];
self.window.rootViewController = vc;
[self.window makeKeyAndVisible];
[vc showAlert];
}
@end
@implementation OCViewController
- (IBAction) showAlert {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"title" message:@"Test" preferredStyle:UIAlertControllerStyleAlert];
// NSLog( @"%@", [[[[UIApplication sharedApplication] keyWindow] rootViewController] valueForKey:@"_printHierarchy"] );
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {}
]
];
[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:alertController animated:YES completion:nil];
}
@end
The backtrace is
+[NSException raise:format:] + 112
-[UIViewController __supportedInterfaceOrientations] + 808
-[UIViewController __withSupportedInterfaceOrientation:apply:] + 48
-[UIViewController setInterfaceOrientation:] + 108
-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:] + 268
-[UIView(Internal) _didMoveFromWindow:toWindow:] + 1232
-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 112
-[NSISEngine withBehaviors:performModifications:] + 84
-[UIView _postMovedFromSuperview:] + 672
-[UIView(Internal) _addSubview:positioned:relativeTo:] + 1904
-[_UIAlertControllerPresentationController presentationTransitionWillBegin] + 148
__80-[UIPresentationController _initViewHierarchyForPresentationSuperview:inWindow:]_block_invoke + 2008
[....]
Post not yet marked as solved
Are there any guidelines on how many characters wide a price text field should be to accommodate all currencies?
Post not yet marked as solved
Hey there everyone, I finally got a multicolumn table implemented with what I wanted after looking through the code sample provided here, but now I am having some issues with how the data is displayed.
At first, everything displays correctly and fields update as they should, but whenever I scroll, the data does not present it itself as it should, in other words cells that should have remain one value end up changing or zeroing out, which affects the column holding a running total.
The application, which is a checkbook ledger application, holds its data in an SQLite database and when I view the database, the values there have changes as well, which forces me to import a previous SQL dump to get everything back, only to experience the issue again.
When I go back to an old version of the application, which has a hideous UI, however, scrolling does not modify anything.
Does anybody know how to deal with this little problem?
If you would like to see what I have already, here is the source code as it currently is.
https://github.com/bryceac/BCheckbook/tree/macTable
Post not yet marked as solved
I am doing localization using NSLocalizedString and it has issues when there is a number in line with a string. For example, when on a local build, String.localizedStringWithFormat("Points: %d”, 62) would return "Points: 62", but on the TestFlight build it returns "Points: -2,114,563,680". All numbers behave this way with a different -2 billion number representing the number on screen.
Post not yet marked as solved
Running Ventura 13.0, iOS 16.0, and iPad OS 16.9 - all latest developer betas. Play counts are not syncing between the devices. I've turned off/on library on all three devices. I've restarted Music app on all three devices. I've forced library sync, and rebooted. Play count is currently not working.
Post not yet marked as solved
**I am trying to upload my app to App Store Connect and am running into issues. I have submitted a build, and it was rejected and in the app review, the reviewer gave this report back.
**
Guideline 2.1 - Performance - App Completeness
We discovered one or more bugs in your app.
Specifically, the “Get Started” button was not responsive.
Review device details:
Device type: iPad
OS version: iOS 15.5
Next Steps
Please run your app on a device to reproduce the issues, then revise and submit your app for review. If at first you're unable to reproduce the issue, try the following:
For new apps, uninstall all previous versions of your app from a device, then install and follow the steps to reproduce.
For app updates, install the new version as an update to the previous version, then follow the steps to reproduce.
If we misunderstood the intended behavior of your app, please reply to this message in App Store Connect to provide information on how these features were intended to work.
Resources
For information about testing apps and preparing them for review, see Technical Note TN2431: App Testing Guide.
To learn about troubleshooting networking issues, see About Networking.
**Which led me to the forums here looking for assistance trying to figure out why my app isn't working on Apple'e side. I have tested the app at my organization. I have downloaded the app, via TestFlight, onto multiple Apple devices. I have tried iPhones and IPads, running iOS 15.5 (the same iOS version as mentioned in the reviewer's submissions). I have not ran into the issues they describe anywhere.
What should I do now? I don't know how to test for this bug, and reviewer will not give any additional information, other than "it doesn't work".
**
Post not yet marked as solved
I got this error when I'm archiving my application i m using XCode 13
Post not yet marked as solved
Hi,
1TB hard drive, 8TB hard drive, SD cards on the adapter or on the macbook reader or any other external drive are not working.
i tried all the finder preferences, and utility disk functions, all my drives are there in the utility disk, but nothing will work, the reparing says it's all good, if i click mount i get this ''com.apple.DiskManagement.disenter error -119930872''.
Help ?
Post not yet marked as solved
I have an app that I'm building and signing and deploying for the Mac App Store.
I received an email that there were problems with the deployment that make no sense to me.
ITMS-90286: Invalid Code Signing Entitlements - Your application bundle's signature contains code signing entitlements that are not supported on macOS. Specifically, value '367****Y2.com.foo.foo-one.electron' for key 'com.apple.application-identifier' in 'Foo One.app/Contents/MacOS/Foo.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libEGL.dylib' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier .
Say what now?
This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier .
But that is exactly what it is set to:
367****Y2.com.foo.foo-one.electron (asterisks just here to obscure our actual TeamID)
I have no idea how to proceed. Any advice?
Similar to this question thread 698452
Post not yet marked as solved
Hi
I am trying to upload an App to the App Store. It is a Java application with a small Swift wrapper. I build for both arm64 and x86-64 and include JREs for both architectures inside the bundle.
The Launcher App:
@main
struct LauncherApp {
static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "drrename")
static func main() {
var jrePath: String = ""
#if arch(arm64)
if let jrePathArm64 = Bundle.main.path(forResource: "jre-18.0.1_10_arm64/Contents/Home/bin/java", ofType: ""){
jrePath = jrePathArm64
}
#elseif arch(x86_64)
if let jrePathX86 = Bundle.main.path(forResource: "jre-18.0.1_10_x64/Contents/Home/bin/java", ofType: ""){
jrePath = jrePathX86
}
#endif
if jrePath != "" {
logger.log("Got jre path: \(jrePath)")
if let jarPath = Bundle.main.path(forResource: "drrename-0.6.4-SNAPSHOT", ofType: "jar"){
logger.log("Got jar path: \(jarPath)")
let task = Process()
task.launchPath = jrePath
task.arguments = ["-jar", jarPath]
task.launch()
task.waitUntilExit()
} else {
logger.critical("Failed to get jar path")
}
} else {
logger.critical("Failed to get jre path")
}
}
}
I get the following error:
I understand that both arm and x86 are required, that is why I package both x86-64 and arm64 JREs inside the bundle.
How can I resolve this error?
Many thanks!