Post

Replies

Boosts

Views

Activity

Reply to Widgets not working with TestFlight since Xcode 12 beta 3
I only see the answer after post this comment, so forget about this. Using Xcode 12 beta 5, still having this issue: Widget works locally on a device from Xcode but not after I distribute it through TestFlight, it just disappeared. Any ideas? Below is my codes: struct Provider: IntentTimelineProvider {   typealias Entry = ScreenTimeEntry   typealias Intent = ConfigurationIntent   func placeholder(with: Context) -> ScreenTimeEntry {     let entry = ScreenTimeEntry.sample     return entry   }   public func snapshot(for configuration: ConfigurationIntent, with context: Context, completion: @escaping (ScreenTimeEntry) -> ()) {     let entry = ScreenTimeEntry(date: Date(), configuration: configuration)     completion(entry)   }   public func timeline(for configuration: ConfigurationIntent, with context: Context, completion: @escaping (Timeline<Entry>) -> ()) {     let currentDate = Date()     let entries: [ScreenTimeEntry] = [       ScreenTimeEntry(date: currentDate, configuration: configuration)     ]     let timeline = Timeline(entries: entries, policy: .atEnd)     completion(timeline)   } }
Aug ’20
Reply to Widget Intent Definition: Can I define a parameter with multiple values that has fixed size 0 for small widget?
Just find this question here, that also answers my question: https://developer.apple.com/forums/thread/653863 A widget must either have an IntentConfiguration or a StaticConfiguration, so you can't do exactly what you're describing with just one widget. You can accomplish a similar effect by making two widgets that use the same implementation for their timeline provider and view methods, and provide both of them with a WidgetBundle.
Sep ’20
Reply to How are IAP receipts supposed to work when an iOS app runs on an Arm Mac?
I tried SwiftStoreKit & TPInAppReceipt in running iOS app to M1 mac book, it does not work. I try to run my app in mac, finish the purchase process, and rerun it to see if it passes local receipt validation. But in this situation, my receipt file name is 'sandboxReceipt', however, the path 'Bundle.main.appStoreReceiptURL' returns 'receipt', hence the appStoreReceiptData returns by SwiftStoreKit is nil. so I download my app by app store, finish the purchase process. My app version of App Store using SwiftStoreKit & OpenSSL to validate receipt, i reopen the download app, the local receipt validation fails, which is expected. now i got both the sandboxReceipt & receipt, so i run my app with Xcode in mac again. Now i got the receipt data, and enter the validation process in TPInAppReceipt, and the validation failed. I notice in the 'guid' method, it actually runs the same block as in iOS device. I guess the expected result is to run the last block. fileprivate func guid() -> Data {     #if os(watchOS)   var uuidBytes = WKInterfaceDevice.current().identifierForVendor!.uuid   return Data(bytes: &uuidBytes, count: MemoryLayout.size(ofValue: uuidBytes)) #elseif !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS))   var uuidBytes = UIDevice.current.identifierForVendor!.uuid <---------------------- code runs here!   return Data(bytes: &uuidBytes, count: MemoryLayout.size(ofValue: uuidBytes)) #elseif targetEnvironment(macCatalyst) || os(macOS)       var masterPort = mach_port_t()   var kernResult: kern_return_t = IOMasterPort(mach_port_t(MACH_PORT_NULL), &masterPort) ... #endif } Here is my debug information: let device = UIDevice.current log.info([ &#9;"=== Device Information ===", &#9;"Name: \(device.name)", &#9;"System Name: \(device.systemName)", &#9;"System Version: \(device.systemVersion)", &#9;"Model: \(device.model)", &#9;"Localized Model: \(device.localizedModel)", ].joined(separator: "\n")) /* output: === Device Information === Name: Alen’s MacBook Pro 13 System Name: iOS System Version: 14.2 Model: iPad Localized Model: iPad/
Dec ’20
Reply to How are IAP receipts supposed to work when an iOS app runs on an Arm Mac?
Hi, endecotp. The receipt/sandboxReceipt I guess it's a bug that App Store should fix. I tried the develop version of TPInAppReceipt, it does not work because when compute macos_guid, many code can't compiler when target is My Mac (Designed for iPad). But I have another project, that's designed for Mac, so it should be able to get it's guid data, since the guid data is unique per mac (i guess), so i can use the guid data returns by the mac project, to see if it can validates my iOS receipt? I'll give it a try. You can follow our discuss in TPInAppReceipt here: https://github.com/tikhop/TPInAppReceipt/issues/73 Update: I try to get the macos_guid from another project that build for mac, and use that guid data to verify my iOS project runs on mac, and it fails because the computed hash is not equal to receipt hash. maybe the guid data is not the same for different projects?
Dec ’20
Reply to Resume long lived operation failed with error CKDatabaseOperations must be submitted to a CKDatabase
Unable to find the edit button, I'll attach more logs here. Debug with: Xcode 13.0 beta 5 (13A5212g) iOS 15 beta 7 2021-08-27 16:23:51.202825+0800 MyApp[431:12260] [xpc.exceptions] <NSXPCConnection: 0x282a6f2a0> connection to service with pid 129 named com.apple.cloudd: Exception caught during invocation of reply block to message 'fetchLongLivedOperationsWithIDs:completionHandler:'. Exception: CKDatabaseOperations must be submitted to a CKDatabase ( 0   CoreFoundation                      0x00000001820db070 556693B0-3E65-30B3-B026-7107FD29DC41 + 626800 1   libobjc.A.dylib                     0x000000019a58df64 objc_exception_throw + 60 2   CloudKit                            0x000000018948c1b4 CKStringFromApplicationPermissionStatus + 6784 3   CloudKit                            0x0000000189495e6c CKStringFromApplicationPermissionStatus + 46904 4   OffScreenKit                        0x00000001070753d0 $s8IceCream15DatabaseManagerPAAE34resumeLongLivedOperationIfPossibleyyFySaySSGSg_s5Error_pSgtcfU_ySo11CKOperationCSg_AHtcfU_ + 536 5   libswiftCloudKit.dylib              0x000000019fe60760 0F47946A-53BB-344F-ABC5-228D48BAE29F + 100192 6   CloudKit                            0x0000000189494098 CKStringFromApplicationPermissionStatus + 39268 7   CloudKit                            0x00000001894939d4 CKStringFromApplicationPermissionStatus + 37536 8   CoreFoundation                      0x0000000182064304 556693B0-3E65-30B3-B026-7107FD29DC41 + 140036 9   CoreFoundation                      0x0000000182081ad4 556693B0-3E65-30B3-B026-7107FD29DC41 + 260820 10  Foundation                          0x00000001838a1930 AD55BAA6-3C1C-3392-AFBC-73E9063C34B9 + 219440 11  Foundation                          0x00000001838c2828 AD55BAA6-3C1C-3392-AFBC-73E9063C34B9 + 354344 12  Foundation                          0x000000018389d4b4 AD55BAA6-3C1C-3392-AFBC-73E9063C34B9 + 201908 13  libxpc.dylib                        0x00000001f216732c A519A4A5-9D87-3B62-9585-41EDADDD5127 + 115500 14  libxpc.dylib                        0x00000001f215a85c A519A4A5-9D87-3B62-9585-41EDADDD5127 + 63580 15  libdispatch.dylib                   0x0000000181d4d9d0 70FBC63E-C446-3BD3-A3BD-6F022317469B + 14800 16  libdispatch.dylib                   0x0000000181d6afd4 70FBC63E-C446-3BD3-A3BD-6F022317469B + 135124 17  libdispatch.dylib                   0x0000000181d54f84 70FBC63E-C446-3BD3-A3BD-6F022317469B + 44932 18  libdispatch.dylib                   0x0000000181d55c44 70FBC63E-C446-3BD3-A3BD-6F022317469B + 48196 19  libdispatch.dylib                   0x0000000181d60318 70FBC63E-C446-3BD3-A3BD-6F022317469B + 90904 20  libsystem_pthread.dylib             0x00000001f21311b0 _pthread_wqthread + 288 21  libsystem_pthread.dylib             0x00000001f2130f50 start_wqthread + 8 )
Aug ’21
Reply to ApplicationActivity.application.localizedDisplayName always nil
Same issue, same thoughts. I can get apps name in the shield extension, but can't get apps name in the report extension. Also in the report extension, I can get the name of categories, and it has the same requirement, so can't get apps name looks like a bug for me. Also in the WWDC session video, the screenshot of WorkLog demo shows screen time per app, so I think we should be able to do the same thing in our own app. I'm using beta 3 and waiting for beta 4.
Jul ’22