Post

Replies

Boosts

Views

Activity

Why can't I edit the iTunes Connect user roles?
My first app and my first experience with iTunes Connect. I can add and delete users, and assign their roles when I add them, but I cannot edit them once added. The only thing I can do is "Resend Invitation".I'm logged in as myself with the Admin/Legal role. I have assigned all my other users the "Developer" role. The only Apple ID that is not greyed out in my list of users is my own. If I double-click my own AppleID to edit my roles, I can see that every checkbox is selected.https://help.apple.com/itunes-connect/developer/#/deva097c6c29I've read the above, but it mentions just double-clicking the user's AppleID in order to edit that user's roles an app access. But I can't do that.What am I missing?
6
0
13k
Jul ’17
error: failed to launch app -- iPhone has denied the launch request.
I was working on my app in Xcode and, after making some changes in Interface Builder and installing to my iPhone, this error popped up:error: failed to launch '/private/var/containers/Bundle/Application/long number/MyApp.app' -- X’s iPhone6 has denied the launch request. (Where X is me).I've tried:Quitting and relaunching XcodePowering down and restarting the iPhoneInstalling the latest Xcode beta 9.1 Beta 9B46Toggling the checkmark for "Automatically manage signing"Using Simulator (which works) I've found reference to this error elsewhere and some people had success by paying attention to their signing. I'm signing as an iOS Developer, so I don't know what else to do.
17
0
19k
Oct ’17
How to check for Main thread from the background?
I have a background operation (a web fetch) that grabs some data from the internet. I need to dispatch out that data as soon as possible during the fetch and have been using the following: func dispatchWebData(myNumber: Double) { if UIApplication.shared.applicationState == .active { DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { self.myFunction(myNumber: myNumber) } } else { DispatchQueue.global(qos: .userInteractive).asyncAfter(deadline: .now() + 0.2) { self.myFunction(myNumber: myNumber) } } }If the app is active, data handling is dispatched to the Main thread and the UI gets updated as soon as the data is available. If the app is not active, the main thread is not available so I dispatched data handling to the global thread. This was/is working fine.Now the MainThread Checker is sending me the little purple square warning that "UIApplication.applicationState must be used from main thread only".First, it seems silly that you can't check the application state from the background. What's the point if you can only check the state while the state is Active?But I wouldn't care about that issue as long as I can get my data handling to move forward. So I'm wondering is if I can check for the existence of the main thread and then dispatch to it if it's there, otherwise to the global thread. Other ideas welcome.
13
0
16k
Mar ’18
Domain=HMErrorDomain Code=80 "Missing entitlement for API."
A similar discussion here:https://forums.developer.apple.com/message/73484#73484I'm controlling an Ecobee 3 thermostat and a couple of switched outlets with my app (called AirCompare and in the store) using HomeKit. It works well and I've been running it continuously for over a year. The thermostat responds more slowly than the switches and sporadically I get the rare error shown in the title. The user sees only a red dot indicating an error but the text of the error prints to my log file. The error can usually be cleared by the user by taking any of a number of actions in the app that will call the Home Manager again.I thought this occasional error might have something to do with the thermostat's slow response causing something to time out, but the text of the error suggests someting else is screwy.I'm lost as to where to begin. I'd like to make this error even more rare. I'm thinking of adding another call of HM if the error is produced but this feels kludgy and I'd have to protect against an endless loop if the error persisted.
4
0
3.0k
May ’19
Swift Project including both C and C++
I'm familiar only with Swift. I have a running Swift app that I want to add other code to, from projects I've found online. One project was in C and with just a few hoops to jump, I got that part working. Yay me.Now I'm trying to add some C++ code and I'm hitting roadblocks.First question: Is my current Objective C Bridging Header the only one I need, or do I need another bridging header?Second question.The problem I'm having is with this code in my bridging header:#include "IF97.h" // The project I want to use #include <cmath> #include <vector> #include <algorithm> #include <iostream> #include <iomanip> #include <stdexcept> #include <stdio.h>All but the first and final lines produce "file not found" errors.
15
0
8.9k
Mar ’20
Unexpected dictionary behavior
A "normal" for..in loop on an array handles the elements in the order you would expect. But not this one.Go ahead and try this in a playground. Every time it runs, I get a different ordering of the keys and never get back 1,2,3,4,5 as entered. If I make another loop around the loop shown (as commented out), it'll give the same key order for each iteration. But a different key order appears when the whole thing is rerun.Confused.import UIKit let dataTable: [String: [Double]] = [ "1Cat": [99.95, 0, 0.05, 0, 0, 0, 0.04], "2Dog": [1, 1, 0, 98, 0, 0, 0.2], "3Mouse": [49.0, 43.2, 3.9, 0, 0.2, 3.7, 0.05], "4Gerbil": [40.3, 55.4, 3.0, 0, 0.4, 0.9, 0.05], "5Fish": [7.7, 90.8, 1.2, 0, 0.1, 0.2, 0.05]] for i in dataTable { print(i) } // for j in 1...4 { // for i in dataTable { // print(i) // } // print("\n") // }
8
0
1.1k
Mar ’20
How to catch the dreaded "uncaught exception"?
I'm working on an engineering app that uses a bunch of java code I succefully converted using J2OBJC. Amazing! I can call the functions defined in that java code from my Swift code and it works nicely most of the time.But that java code throws an "OutOfRangeException" whenever the user input paramaters fall out of some range. The error ends up in my AppDelegate and crashes my app there.Is there a way to catch this "exception" gracefully without crashing?I've tried the following but it doesn't work, as Xcode warns:do { 'catch' block is unreachable because no errors are thrown in 'do' block let myVar = JavaProject().someFunction(with: Temp) } catch { }*** Terminating app due to uncaught exception 'OutOfRangeException', reason: 'JavaProject.OutOfRangeException'
5
0
2.6k
Apr ’20
Numbers and String.localizedStringWithFormat
My app uses a text field where the user enters a number. Upon an entry, the app checks to make sure that the user has entered a number and not gibberish, then stores the numerical entry as a double.let stored = NumberFormatter().number(from: textField.text! as String)!.doubleValueThen calculations are made and the gui updated. For updating the text field, I convert a stored double back to text:numberInput.text = String.localizedStringWithFormat("%.\3f %@", stored, "")It all works fine, for entries under 1000.Problem: When a comma is inserted by the localizer, as in "1,000", and the user does not clear the entire entry or enters a comma manually - for instance edits the old entry to show "1,001" - that is no longer recognized as a number. Of course entering 1001 is fine. I cannot just strip out the comma because it can have different meanings in different locations. I want to show the comma in the textfield to propoerly format the number display.Ideas?
3
0
1.1k
Apr ’20
Macbook Pro backlight brightness
I'd like to find a way to control the display backlight brightness using the method in use before Mojave. The method I'm looking for may be even older.I have one of the cursed late-2011 Macbook Pros with the failed AMD Radeon graphics. Using the excellent solution from dosdude, I have disabled the AMD discrete graphics and everything runs fine using the Intel graphics. Everything EXCEPT adjusting screen brightness. (I think there are other issues with sleep but that doesn't concern me.) Symptoms include no response to the F1 and F2 buttons and no slider in System Preferences. Most folks get max brightness all the time. I was living with that until a recent update to 10.14.6. Now I'm locked at some lower level.Loss of brightness control is a well-documented shortcoming of the dosdude fix. It's a small price to pay to unbrick your Macbook! But it would be awesome to restore dimming.Anyway, the loss of brightness control corresponds to a system upgrade. I think dimming worked fine under Sierra but disappeared with High Sierra. Possibly it was Mojave that killed it. I'm sure the details are in the dosdude patch thread and I could retrieve those details if it matters. The possibility of returning to the dimming control used back then is tantalizing. Maybe that's because I have no idea how impossible it is?If there was an easy approach to this I'm pretty sure a talented guy like dosdude would have found it. So I'm wondering if he left some stone unturned. Some kext replacement or such that might restore dimming to all of us suffering along with one of Apple's rare lemon models.
1
0
1.4k
May ’20
HomeKit debugger warning: No handlers for message: HMFMessage
My app uses HomeKit to control a few accessories and it seems to work fine. But while connected to the Debugger in Xcode, I'm seeing a lot of these reports:Date, time myApp[] [Messaging.Dispatcher] No handlers for message: HMFMessage kCharacteristicValueUpdatedNotificationKey(big key)I believe the source of the message may be my Ecobee 3 thermostat. I use a couple switched outlets also but I don't think these warnings have occur when I interact with them.Is there something I can do to intercept the message and eliminate the debugger warning? I don't really care what the debugger is saying or not, but I'm suspicious that there may be a performance problem when I interact with the Ecobee, and I'm hopeful that handling the message properly might help with that. The performance problem is generally slow responsiveness and an occasional failure to respond to a temperature change.
3
0
1.1k
May ’20
Users not seeing local notifications
Some users are telling me they "never" or rarely get alerts sent by my app while in the background. I have no such problem on my phone - I get alerts frequently. I've checked every setting we can find related to background app refresh, and to notifications, but all seems in order.My app (AirCompare) does background fetches, processes a small amount of web data, and then sends an alert. This all works fine for me and most users. In the case of the affected user, my app logging shows that alerts were requested, but the user never saw them.Here's an example alert, one relaed to the weather:requestIdentifier = "Tickle Weather" content.title = "... Weather update ..." content.subtitle = "" content.body = "my alert text" content.sound = nil logSB.info("Tickle Weather alert sent at \(currentDate)") let trigger = UNTimeIntervalNotificationTrigger.init(timeInterval: 0.2, repeats: false) let request = UNNotificationRequest(identifier:requestIdentifier, content: content, trigger: trigger) UNUserNotificationCenter.current().add(request) { (error) in if (error != nil){ self.logSB.error("ERROR sending a notification at \(currentDate)") } // close error conditional } // close userNotificationThe user's logs show that web data were fetched and processed and that the alerts are sent with no error logged. But the user sees nothing.What are we missing?[update] I forgot to mention: When the user crosses a geofence set within my app, that notification comes through. Occaionally one of the previously missing alerts will fire at the same time, even a day late.
2
0
855
May ’20
How to check for background fetch eligibility?
A user is having problems with my app and I've traced his log files to discover that the user never receives a background fetch opportunity. Every setting seems to be OK, including not being in lo power mode, but nothing ever happens. Users phone is iOS12. The app works fine on my iOS 13 phone and in Simulator for iOS 12.Is there a way to determine if your app is truly registered for background fetches?On a related note, it'd be nice to know the availability of all of these, as dictated by the user's choices in Settings: • iCloud key,value store, NSUbiquitousKeyValueStore.default • Notifications • Background app refresh • Location servicesI can check the Notifications: let center = UNUserNotificationCenter.current() center.getNotificationSettings { settings in guard (settings.authorizationStatus == .authorized) else { self.logSB.error("Authorization status is NOT authorized") return } self.logSB.debug("Authorization status IS authorized") if settings.alertSetting == .enabled { // Schedule an alert-only notification. self.logSB.debug("Authorization alert is enabled") } else { // Schedule a notification with a badge and sound. self.logSB.error("Authorization alert is NOT enabled") } }
2
0
2.1k
May ’20
Active app being sent to background - why?
I've been struggling to figure out why my app misbehaves for a few users. Their systems seem to be hostile towards the app. It's being sent to the background from the active state, and once in the background it seems to be quickly suspended. I do not see this on my phone or in Simulator, so it's very hard to diagnose. I have good logging that can detail background operation, but the logs die along with the app.The app is designed for longrun operation in the background. When the system allows, it gets some web data and reports to the user via a local notification. It's complicated but it all works, except for a few users. The app additionally has a "Night Mode", where it remains the active app all night and web data is gathered every 10 minutes on a timer. Mine ran perfectly all night last night but a user log shows the app was backgrounded after just 3 minutes. It must have also suspended shortly after that because there are zero log entries until the user woke up in the morning and logging resumed. That particular user is getting some background fetches this morning, so at least we know the proper permission settings are in place.What would cause an app to be so aggressively demoted?
3
0
1k
May ’20
How to force a fresh install?
Some of my users experience a problem where background fetches never trigger. I've been unable to fix that from within the app but we've learned the hard way that a complete nuclear reinstall fixes the problem. That means trashing the app, logging out of the user's Apple ID, reinstalling the app (it may have required a new purchase?) and finally logging back in. Of course all older settings are lost but app function is fully restored.Logging out of the Apple ID account is a pain, though. A user reports that all credit cards in his Wallet were lost and had to be re-entered. Not a practical approach.Is there a simpler, less invasive way to force a true reinstall, even if it does detroy all saved settings? Open to ideas.
12
0
8.3k
Jun ’20
HomeKit entitlement now public?
Years ago I submitted a request to obtain entitlement for my app to access HomeKit from the background. There was a rumor back then that there was a secret background entitlement to enable this, and that's exactly what I needed. Today I received a cryptic Feedback from Apple on that old request: "After reviewing your feedback, we have some additional information for you: The HomeKit entitlement is public now. Please close your feedback if this is no longer an issue for you. Thanks!" What does this mean? I suspect it has nothing to do with what I asked for.
1
0
883
Jul ’20