Post

Replies

Boosts

Views

Activity

Reply to Mocking or simulating CBPeripheral, CBCentralManager, etc in tests
They are NSObjects and you can instantiate them even thought their initializers are private. In one of my apps I use the following approach to mock NSObject classes with private initializers. In case of CBPeripheral the following can be used as a start (assuming you are using Swift): let p = CBPeripheral.perform(NSSelectorFromString("new")).takeRetainedValue() as! CBPeripheral In my case I use the helper: func create<O : NSObject>(_ class: O.Type = O.self) -> O { return O.perform(NSSelectorFromString("new")).takeRetainedValue() as! O } let p = create(CBPeripheral.self)
Jan ’25
Reply to Transaction fails with ASDServerErrorDomain Code=3504 in production
I can see the following errors reported in Bugsnag, the app is waiting for the review (there are no new products added): "NSLocalizedDescription": "An unknown error occurred", "NSUnderlyingError": "Error Domain=ASDServerErrorDomain Code=3506 \"Missing application adam id or bundle id.\" UserInfo={NSLocalizedFailureReason=Missing application adam id or bundle id.}" } "NSLocalizedDescription": "An unknown error occurred", "NSUnderlyingError": "Error Domain=ASDServerErrorDomain Code=3504 \"This item cannot be found.\" UserInfo={NSLocalizedFailureReason=This item cannot be found.}"
Topic: App & System Services SubTopic: StoreKit Tags:
Sep ’23
Reply to [SKStoreProductViewController sceneDisconnected:] crash on iOS 15.7
I'm seeing this issue in one of the apps I work on. I saw it first in crashlogs (Bugsnag) in July but last 2 weeks the number of reported crashes skyrocketed. The app doesn't explicitly use the SKStoreProductViewController. It uses UIApplication.shared.open("itms-apps://apps.apple.com/app/appid") and the SKStoreReviewController.requestReview(), I'm not sure which one of these uses the SKStoreProductViewController. What is very odd, the other 2 apps that use the same way to show the other product app pages don't have this crash in their logs. Edit: I saw somebody mentioned the issue could be related to AdMob. This app also uses AdMob, the other 2 apps don't use AdMob.
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’22
Reply to Mocking or simulating CBPeripheral, CBCentralManager, etc in tests
They are NSObjects and you can instantiate them even thought their initializers are private. In one of my apps I use the following approach to mock NSObject classes with private initializers. In case of CBPeripheral the following can be used as a start (assuming you are using Swift): let p = CBPeripheral.perform(NSSelectorFromString("new")).takeRetainedValue() as! CBPeripheral In my case I use the helper: func create<O : NSObject>(_ class: O.Type = O.self) -> O { return O.perform(NSSelectorFromString("new")).takeRetainedValue() as! O } let p = create(CBPeripheral.self)
Replies
Boosts
Views
Activity
Jan ’25
Reply to Transaction fails with ASDServerErrorDomain Code=3504 in production
I can see the following errors reported in Bugsnag, the app is waiting for the review (there are no new products added): "NSLocalizedDescription": "An unknown error occurred", "NSUnderlyingError": "Error Domain=ASDServerErrorDomain Code=3506 \"Missing application adam id or bundle id.\" UserInfo={NSLocalizedFailureReason=Missing application adam id or bundle id.}" } "NSLocalizedDescription": "An unknown error occurred", "NSUnderlyingError": "Error Domain=ASDServerErrorDomain Code=3504 \"This item cannot be found.\" UserInfo={NSLocalizedFailureReason=This item cannot be found.}"
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to xcode13.4.1:Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib
It's enough to disable bitcode in the build settings. No need to set strip swift symbol to No. BUT with bitcode disabled on iOS 12.1.2 the images using Comopression: GPU Smallest size don't show up!!!! They show up fine on iOS 12.5.5 and iOS 10.3.4 (Didn't have other devices). This is a big issue. Apple: please revert changes you did.
Replies
Boosts
Views
Activity
Sep ’22
Reply to [SKStoreProductViewController sceneDisconnected:] crash on iOS 15.7
I'm seeing this issue in one of the apps I work on. I saw it first in crashlogs (Bugsnag) in July but last 2 weeks the number of reported crashes skyrocketed. The app doesn't explicitly use the SKStoreProductViewController. It uses UIApplication.shared.open("itms-apps://apps.apple.com/app/appid") and the SKStoreReviewController.requestReview(), I'm not sure which one of these uses the SKStoreProductViewController. What is very odd, the other 2 apps that use the same way to show the other product app pages don't have this crash in their logs. Edit: I saw somebody mentioned the issue could be related to AdMob. This app also uses AdMob, the other 2 apps don't use AdMob.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’22