Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Model with struct/Binding or class/ObservableObject?
When using SwiftUI, developers tend to use a mix of structs and classes for their models depending on the use case. Both approaches have their advantages and disadvantages. Structs and Bindings: Structs are value types, which means they are passed by value (copied) when used in functions or assigned to variables. They are lightweight and efficient, especially for small models. Using Binding with structs allows you to create two-way bindings between the UI and the model, enabling updates in the UI to propagate back to the model. Classes and ObservableObjects: Classes are reference types, which means they are passed by reference (memory address) when used in functions or assigned to variables. They allow for more complex behaviors, including inheritance. Using ObservableObject and @Published with classes allows you to create data models that automatically notify their observers (e.g., SwiftUI views) when their properties change, which in turn triggers a UI update. As you've found, using ObservableObjects might be a better fit for your particular case due to the issue you encountered with the new Swift Navigation API. Converting your models to classes and making them conform to the ObservableObject protocol would allow you to use @ObservedObject or @StateObject for passing the models around, which can help manage state and avoid potential issues with bindings. While it might require some refactoring, using classes and ObservableObjects can provide more flexibility and stability for your app. Ultimately, the choice between struct/Binding and class/ObservableObject depends on your app's requirements and how you need to manage data and state changes.
Mar ’23
Reply to App is crashing on startup in Apple App review, but I cannot replicate it
Based on the crash log, it seems that the crash is happening on a background thread (Thread 22), but it's difficult to identify the exact cause without more information. Here are some suggestions to help you troubleshoot the issue: Symbolicate the crash log: Symbolicating the crash log will provide more human-readable information, such as method names and line numbers, which will help you pinpoint the problematic code in your app. You can use Xcode's atos tool or symbolicate the crash log within Xcode itself. Here's a guide on how to symbolicate crash logs: https://developer.apple.com/documentation/xcode/analyzing-crash-reports Inspect your multithreading code: Since the crash is happening in a background thread, carefully review any code that spawns new threads or manages concurrency, such as DispatchQueue, OperationQueue, or any Xamarin-specific libraries you are using. Ensure that you are using thread-safe data structures and that you're not accidentally accessing UI elements from a background thread. Test on multiple devices and iOS versions: As you mentioned that the crash occurs on startup according to the App Review but not on the devices you tested, try testing your app on various devices and iOS versions. You can use the iOS Simulator to test different device models and iOS versions. This might help reproduce the issue and narrow down the cause. Check for memory issues: Ensure that your app is handling memory correctly, especially in multi-threaded scenarios. Look for memory leaks, over-releases, or other memory-related issues that could lead to a crash. You can use Xcode's memory debugging tools (e.g., Instruments) to help you find and fix memory issues. Enable exception breakpoints: Enable exception breakpoints in your debugger to help identify where the crash is occurring. This will pause the debugger when an exception is thrown, allowing you to inspect the call stack and local variables for more information about the crash. If you're still unable to identify the issue, consider sharing the symbolicated crash log and relevant parts of your codebase (especially those related to multithreading) so that others can help you troubleshoot the problem more effectively.
Mar ’23
Reply to In-App Purchases working in Sandbox Mode on TestFlight, but not in the App Store
If the in-app purchase button is unresponsive in your live app, but it works fine in SandBox mode, there may be an issue with the configuration of your app's production environment. Here are some steps you can take to troubleshoot this issue: Check that you have set up the In-App Purchase correctly in your live app environment. Make sure that the version of the app you uploaded to the App Store contains the correct In-App Purchase code. Check that the In-App Purchase products have been created and are available for sale in your live app. You can do this by logging in to your App Store Connect account and checking the status of the In-App Purchase products. Verify that your app's bundle ID matches the one that you used when you set up the In-App Purchase in App Store Connect. If the bundle ID does not match, the In-App Purchase button may not function properly. Ensure that you have added the necessary code to handle In-App Purchases in your app. This includes handling responses from the App Store server, verifying receipts, and storing purchase data securely. If none of the above steps solve the issue, you may need to contact Apple Developer Support for further assistance. It is important to note that the In-App Purchase process can take some time to propagate throughout the App Store system, so it is possible that the button may not work immediately after you have uploaded a new version of your app. If this is the case, it is best to wait a few hours and try again.
Mar ’23
Reply to Apple rejection: In-app-purchase
It appears that your app has been rejected by Apple because the metadata of your "Monthly sub" in-app purchase does not include a price. The rejection message from Apple provides steps to resolve the issue by revising the metadata of your in-app purchases to accurately price each in-app purchase product. If your "Monthly sub" in-app purchase is not in the in-app purchase section, but in the subscription section, it may be possible that Apple made a mistake during the review process. In this case, you can contact Apple's App Review team and explain the situation to them. You can do this by using the Resolution Center in App Store Connect. However, if the in-app purchase is in the correct section and the metadata is missing a price, you will need to follow the steps provided by Apple to revise the metadata of your in-app purchases. This can be done by logging in to App Store Connect, clicking on "My Apps", selecting your app, clicking on "Features" to view your in-app purchases, clicking on a Reference Name that is in Developer Action Needed status, and editing the in-app purchase details. Once you have made the necessary changes, click "Save" to update the metadata. After making the changes, resubmit your app for review, and it should be approved if everything is in order.
Mar ’23
Reply to iCloud/CoreData Crashing [NSFetchResultsController _computeSectionInfo:error]
From the crash report you provided, the crash seems to be related to the Core Data framework, specifically when fetching data using NSFetchedResultsController. Since you mentioned that it only happens for users who have iCloud enabled, it might be related to how the data is synchronized between the local store and iCloud. Here are a few suggestions to help you investigate and potentially fix the issue: Make sure your Core Data stack is set up correctly to handle iCloud integration. Review your NSPersistentStoreCoordinator setup to ensure it has the necessary iCloud options. Check if there are any issues with the data model, such as missing or incorrect relationships, which might be causing issues when fetching data from the store. If possible, attempt to reproduce the issue using a device or simulator running iOS 16 and iCloud enabled. This will allow you to debug the issue in a more controlled environment. Since the crash happens during the execution of NSFetchedResultsController, you may want to try different ways of fetching data, such as using NSFetchRequest directly, to see if it resolves the issue. Make sure your app is not holding on to any stale NSManagedObject instances that may have been deleted or changed in the background. This can cause unexpected behavior when fetching data. Keep an eye on the Apple Developer Forums and related resources for any reports of similar issues or workarounds that may be available. Lastly, if you have identified this as an iOS 16 bug, you should file a bug report with Apple using their Feedback Assistant tool, providing as much information as possible to help them investigate and resolve the issue.
Mar ’23
Reply to Issues retrieving Apple Music Storefront ID using the API
func getStoreFrontID(userToken: String, developerToken: String) { let url = URL(string: "https://api.music.apple.com/v1/me/storefront")! var request = URLRequest(url: url) request.httpMethod = "GET" request.addValue("Bearer \(developerToken)", forHTTPHeaderField: "Authorization") request.addValue(userToken, forHTTPHeaderField: "Music-User-Token") let task = URLSession.shared.dataTask(with: request) { (data, response, error) in if let error = error { print("Error: \(error.localizedDescription)") return } guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else { print("Error: Invalid HTTP response") if let data = data, let errorMessage = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any], let message = errorMessage["errorMessage"] as? String { print("Error message: \(message)") } else { print("HTTP response: \(response.debugDescription)") } return } guard let data = data else { print("Error: No data received") return } do { let json = try JSONSerialization.jsonObject(with: data, options: []) if let dictionary = json as? [String: Any], let storefrontID = dictionary["defaultStorefront"] as? String { print("Store Front ID!: \(storefrontID)") } } catch { print("Error: \(error.localizedDescription)") } } task.resume() } This is the corrected function which takes the user token and developer token as parameters and makes a GET request to the /me/storefront endpoint to fetch the Storefront ID. It handles the response and prints the Storefront ID or any errors that occur during the process.
Mar ’23
Reply to Question about passkey fido ctap protocol
Meet passkeys involve a two-step process: key agreement and FIDO CTAP operations. Let's break down the process and address your questions. Key agreement: This step uses Bluetooth Low Energy (BLE) to establish a shared secret between the two devices (phone and authenticator). During this step, the devices perform a secure key exchange, allowing them to derive a shared secret that will be used for encrypted communication. FIDO CTAP operations: After the key agreement is completed, the two devices connect to a relay server, which acts as a bridge for their communication. At this point, the FIDO Client-to-Authenticator Protocol (CTAP) comes into play. CTAP defines how the client and authenticator communicate to perform authentication operations like creating and using credentials. CTAP supports multiple transports for communication, such as USB, NFC, and BLE. However, since you mentioned that the devices connect to a relay server, it is likely that the CTAP communication is using Transmission Control Protocol (TCP) over the internet rather than Bluetooth. If you turn off Bluetooth after the key agreement is finished, the communication between the two devices might still work as long as the devices have established a connection to the relay server via another transport like TCP. However, it's essential to ensure that the devices are connected to the internet via Wi-Fi or mobile data. Once the devices are connected to the relay server, CTAP messages are exchanged between the client and authenticator. These messages include requests for creating credentials, signing, and various other operations. The relay server facilitates the exchange of these messages without being able to decrypt the content, as the communication is encrypted using the shared secret established during the key agreement process. In summary, after the key agreement is completed using Bluetooth, the devices connect to a relay server, and FIDO CTAP operations are performed. The communication between the devices is encrypted and typically uses TCP over the internet. Turning off Bluetooth after the key agreement should not affect the CTAP communication as long as the devices are connected to the internet.
Mar ’23
Reply to Question re. sharing Core Data with CloudKit
When a Core Data object is shared via CloudKit and the user receives it through a message, the device would typically use the application associated with the file type to open the object. However, the question itself may not provide enough context to fully understand the situation. For example, it's unclear what type of object is being shared and what format it's in. Additionally, the question assumes that the user clicking the link has the necessary permissions to access the shared object. Therefore, more details may be needed to provide a complete and accurate answer.
Mar ’23
Reply to App install total
It's generally not possible to know the exact number of devices that currently have your app installed, as this information is not publicly available. However, there are a few different approaches you can use to estimate the number of active installations. One way is to track the number of unique users who have logged into your app or used certain features within a specific timeframe, such as the past 30 days. You could also use analytics tools to track user engagement and retention rates over time. Another approach is to use app store metrics, such as download and install data, to estimate the number of active installations. However, keep in mind that these metrics may not be 100% accurate, as they only account for installations from the app store and may not include installations from other sources or devices where the app has been sideloaded. Ultimately, it's important to keep in mind that getting an exact number of active installations is difficult, if not impossible, to achieve. Instead, focus on tracking user engagement and retention to get a better sense of how your app is performing over time.
Mar ’23
Reply to Adalo Built App Crashing on opening with TestFlight. Help!
Based on the provided crash report, it seems that the app is crashing due to an unhandled exception. The exception type is EXC_CRASH (SIGABRT) and the exception codes are 0x0000000000000000, 0x0000000000000000. The crash report also provides a backtrace, which shows the sequence of function calls that led to the crash. The backtrace indicates that the crash occurred in the RCTFatal function of the Lft Ovrs module. The RCTFatal function is part of the React Native framework and is responsible for handling fatal errors in the app. It's possible that the crash is related to the QR code scanner or to the login screen, since those are the components that are loaded immediately after the splash screen. It's also possible that there is a problem with the React Native configuration or with the Adalo build process. To troubleshoot this issue, you could try the following steps: Check the React Native logs: You can try to reproduce the issue and check the logs generated by React Native. The logs may provide more information about the error and help you narrow down the cause. Test the QR code scanner separately: You could try to create a separate app or component that only includes the QR code scanner and test it separately. This could help you determine if the issue is related specifically to the QR code scanner or if it's a more general issue with the app. Review Adalo documentation: Review Adalo documentation and ensure that the QR code scanner and login screen components have been properly implemented. Seek Help from Adalo Community: Seek help from the Adalo community forums or support channels. Other Adalo users may have encountered similar issues and may be able to provide guidance or troubleshooting tips. By following these steps, you may be able to identify and resolve the issue that is causing your app to crash.
Mar ’23
Reply to iCloud/CoreData Crashing [NSFetchResultsController _computeSectionInfo:error]
Based on the additional information provided, it appears that the crashing issue is related to the localizedUppercaseString method used in the nameFirstLetter method of the NSManagedObject subclass. This subclass is used as the sectionNameKeyPath in the NSFetchedResultsController, which is causing some devices running iOS 16 to crash. To work around this issue, you can try using a different method to convert the first character of the name string to uppercase. Instead of using localizedUppercaseString, you can use uppercaseStringWithLocale: method. Here's an example of how you could modify the nameFirstLetter method to use uppercaseStringWithLocale:: -(NSString *)nameFirstLetter { if(self.name != nil) { NSString *firstChar = [self.name substringToIndex:1]; NSString *upperCaseFirstChar = [firstChar uppercaseStringWithLocale:[NSLocale currentLocale]]; NSLog(@"**** Name:[%@] 1st[%@] Upper[%@]", self.name, firstChar, upperCaseFirstChar); return upperCaseFirstChar; } else { return @"?"; } } Here are a few more things you can try to further investigate and potentially fix the crashing issue: Consider using a different sectionNameKeyPath in the NSFetchedResultsController. If the issue is related to the localizedUppercaseString method used in the nameFirstLetter method, you may be able to work around the issue by using a different key path that doesn't rely on this method. For example, you could use a boolean flag to indicate whether the name starts with a letter or a number, and use that flag as the sectionNameKeyPath. If none of the above steps resolve the issue, you may need to modify your data model to remove the use of localizedUppercaseString in the NSManagedObject subclass. This may require significant changes to your codebase, so it should only be considered as a last resort. In the meantime, you may want to consider reaching out to affected users and informing them of the issue and potential workarounds. You could also consider disabling iCloud storage in your app until a fix is found, if that's an option.
Mar ’23
Reply to Publishing on App Store a python website built on Gitpod.oi
It is not possible to directly publish a website built in Python on the App Store. The App Store is specifically for mobile applications built using iOS or Android development frameworks. However, you can consider building a mobile application that interfaces with your website. This can be done using frameworks such as React Native, which allows you to build mobile applications using web technologies such as HTML, CSS, and JavaScript. Alternatively, you can consider building a Progressive Web Application (PWA) instead of a native mobile application. PWAs are web applications that can be installed on mobile devices and accessed through the device's home screen. They can provide a native-like experience and often have access to device features such as camera and location. If you do decide to build a mobile application or PWA, you can host your Python-powered website on a server and communicate with it through APIs. You can also consider using a cloud platform such as AWS or Google Cloud Platform to host your application and database. Overall, while it may not be possible to publish a Python-powered website directly on the App Store, there are several options available for building mobile applications that interface with your website.
Mar ’23