We use the CTCellularPlanProvisioning API to check if the iPhone is capable to install an eSIM.
var isESIMSupported = CTCellularPlanProvisioning().supportsCellularPlan()
For nearly all users this seems to work fine. However we have some crashes shown in the organizer that the App crashes when calling this function. We are not able to reproduce this bug and cannot find any reasons for this crash. We call the function from the main Thread which should not be an issue according to the documentation "You can call this method at any time".
Maybe someone has similar issues/ crashes? Thanks for any help.
Post
Replies
Boosts
Views
Activity
Topic description: when a user wants to create a new Account and ignores the "Use strong password" or "choose other option" and clicks on button to next screen, the app will hang.
User Interaction / Experience
A Screen with usernameInputField, a passwordInputField and a Button to create the account. The next screen will be pushed (not modally). The second screen allows some userinteraction (in the example counting upwards and displaying this, which allows checking if the app responds to input).
How to reproduce
The user types in a username and klicks on the passwordTextField. A strong password is suggested by Apple. The overlay shows at the bottom. We ignore the Buttons provided by the overlay and press on the button in the app to create the account. Transition to next page animates, but the next screen is unresponsive.
Expected behavior (which works sometimes, when running with debugger)
On the second screen the Do you want to store the password action sheet should be displayed (like in the screenshot).
Findings
This bug occures for our production App with UIKit and SwiftUI implementation. I could also find an App on the AppStore with the same Bug and similar patterns (usernameField + passwordField + nextButton + navigation by pushing the next viewController).
I implemented the most basic to reproduce the bug and be sure it is nothing in my code. I cannot provide a standalone project, because https://<fully qualified domain>/.well-known/apple-app-site-association Information needs to be given for strong password to be suggested.
Screenshots when not running into bug.
// AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
appWindow = UIWindow(frame: UIScreen.main.bounds)
let viewController = UIHostingController(rootView: ContentView())
let navigationController = UINavigationController(rootViewController: viewController)
appWindow.rootViewController = navigationController
appWindow.makeKeyAndVisible()
return true
}
// Create Account implementation
struct CounterView: View {
@State var counter = 0
var body: some View {
VStack {
Text(String(counter))
.font(.title)
Button("+", action: { counter += 1 })
.buttonStyle(BorderedProminentButtonStyle())
}
}
}
struct ContentView: View {
@State var username = ""
@State var password = ""
var body: some View {
VStack {
Text("Choose your login credentials")
.padding()
TextField("username", text: $username)
.textContentType(.username)
SecureField("password", text: $password)
.textContentType(.newPassword)
NavigationLink(destination: CounterView()) {
Text("create account")
}
}
.padding(40)
}
}
The bug does NOT occure when you have the debugger attached from the start. I was able to get the bug and then attach to the process. I could see that memory raised drastically and the app crashed after a long time.
While testing, I could see once
View <:0x0> does not conform to UITextInput protocol
being printed to the console.
The bug does not occure when you present the next screen modally.
With Debugger attached the App response as expected and presents the action sheet for do you want to store the password.
My guess
I think when the transition to the next screen happens, the reference to some critical information for save password gets deallocated and then some Apple Api tries to show the action sheet but this does not work because some Information is missing. This seems to prevent the userinteraction and some code runs in an endless loop which would explain the memory raising quickly (our production build runs normally between 30 MB and 80 MB Memory).
Does anyone have similar issues?
I think all Ideas to fix this are some sort of hacks to make it work and I would think Apple needs to fix this, what do you think?