If a server is sending a push to an app, then how can it know whether it should be sending the push using the Apple sandbox push server, or the production server?
If the app is on the app store or testflight then it needs to be using the sandbox server, but if the app is being run via XCode interactively as devs are developing/testing then the push needs to be sent via the sandbox server.
But the server itself has no idea if the app was installed via Testflight/app store/XCode/ or a development .ipa. So the server can't know how to send the push.
The app has to send the push token to the server anyway, so the app could inform the server which environment it should be sent over. But then how can the app detect that itself?
A naive answer is to use #ifdef DEBUG to detect this, but that is incorrect. Which environment a push should be sent over is not correlated with that. For example an app could be being run with a debug scheme or a release scheme, but in both cases if the app is installed/running via xcode then the push environment has to be the sandbox.
So my question is, is there a way the app can detect which push environment a push should be sent over in order than it can instruct the server accordingly?
Overview
Post
Replies
Boosts
Views
Activity
Hello developers,
I'm currently working on an authorization plugin for macOS. I have a custom UI implemented using SFAuthorizationPluginView, which prompts the user to input their password. The plugin is running in non-privileged mode, and I want to store the password securely in the system keychain.
However, I came across an article that states the system keychain can only be accessed in privileged mode. At the same time, I read that custom UIs, like mine, cannot be displayed in privileged mode.
This presents a dilemma:
In non-privileged mode: I can show my custom UI but can't access the system keychain.
In privileged mode: I can access the system keychain but can't display my custom UI.
Is there any workaround to achieve both? Can I securely store the password in the system keychain while still using my custom UI, or am I missing something here?
Any advice or suggestions are highly appreciated!
Thanks in advance! 😊
I belong to an EC shop application developers' team, and we got a crame from a small part of our customers about our application.
"Search Bar does not work on iOS 18."
This bug doesn't appear on most of our devices updated to iOS 18.0.
In some cases, it disappeared by turning [Settings > Accessibility > Touch > Reachability] off.
But it is not the same for all customers found the bug.
I'm looking for how to fix this bug, and why it happens.
I'm not sure but I doubt that this may be a bug of iOS18, UIKit, RxCocoa, RxSwift, or something else.
Any information would be welcome.
import UIKit
import RxSwift
import RxCocoa
@IBDesignable
public final class SearchBar: UISearchBar {
var textField: UITextField {
if #available(iOS 13.0, *) {
return searchTextField
} else {
return value(forKey: "_searchField") as! UITextField
}
}
private let disposeBag = DisposeBag()
private func bind() {
textField.rx.isFirstResponder
.bind(to: Binder(self) { me, isFirstResponder in
// This doesn't work in some iOS 18 devices.
me.textField.attributedPlaceholder = placeholderAttributedString(isFirstResponder: isFirstResponder)
me.textField.backgroundColor = isFirstResponder ? Asset.Colors.whiteTwo.color : .white
if me.useCancelButton {
me.showsCancelButton = isFirstResponder
}
if me.useBookmarkButton {
me.showsBookmarkButton = !isFirstResponder
}
})
.disposed(by: disposeBag)
}
public override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public override func awakeFromNib() {
super.awakeFromNib()
commonInit()
}
public override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
commonInit()
}
private func commonInit() {
bind()
}
}
extension Reactive where Base: SearchBar {}
import UIKit
import RxSwift
import RxCocoa
@IBDesignable
public final class SearchHeaderView: UIView {
@IBOutlet private weak var searchBar: SearchBar!
@IBOutlet private weak var cartContainerView: UIView!
private let disposeBag = DisposeBag()
public override init(frame: CGRect) {
super.init(frame: frame)
loadFromNib()
commonInit()
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public override func awakeFromNib() {
super.awakeFromNib()
loadFromNib()
commonInit()
}
public override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
loadFromNib()
commonInit()
}
private func commonInit() {
bind()
}
private func bind() {
// ↓ This doesn't work in some iOS 18 devices.
searchBar.textField.rx.isFirstResponder
.bind(to: cartContainerView.rx.isHidden)
.disposed(by: disposeBag)
}
}
extension SearchAndCartHeaderView: NibOwnerLoadable {}
Crash occurs in @MainActor class or function in iOS 14
Apps built and distributed targeting Xcode 16 version swift6 crash on iOS 14 devices.
We create a static library and put it in our app's library.
Crash occurs in all classes or functions of the static library (@MainActor in front).
It does not occur from iOS / iPadOS 15.
If you change the minimum supported version of the static library to iOS 11, a crash occurs, and if you change it to iOS 14, a crash does not occur.
Is there a way to keep the minimum version of the static library at iOS 11 and prevent crashes?
In the code below, changes to the destination value aren't captured by ViewA if:
ViewB is navigated to by changing the destination property of ViewModel.
ViewA is embedded in a NavigationLink or another navigationDestination.
For example, the return button in ViewB doesn't work when accessed from ContentWithinNavigationLink, but it works from ContentDirect.
I've also noticed that the code works if I move the presentingViewB property to the ViewModel class. However, in real code, that significantly increases the complexity of ViewModel, as I have more than ten destinations to handle. Each bound with different shapes of data. I'd prefer to store an enum value in ViewModel, listen to it in ViewA, and then convert it to boolean flags and properties in ViewA—just for iOS 16 compatibility. For iOS 17 and above, the enum works perfectly with navigationDestination(item:destination:).
class ViewModel: ObservableObject {
@Published var destination = ""
func gotoB() {
destination = "ViewB"
}
func reset() {
destination = ""
}
}
struct ContentWithinNavigationLink: View {
var body: some View {
NavigationStack {
NavigationLink {
ViewA()
} label: {
Text("Goto A")
}
}
}
}
struct ContentDirect: View {
var body: some View {
NavigationStack {
ViewA()
}
}
}
struct ViewA: View {
@State private var presentingViewB = false
@StateObject private var viewModel = ViewModel()
var body: some View {
Button {
viewModel.gotoB()
} label: {
Text("goto ViewB")
}
.navigationDestination(isPresented: $presentingViewB) {
ViewB().environmentObject(viewModel)
}
.onChange(of: viewModel.destination) { newValue in
if newValue == "ViewB" {
presentingViewB = true
} else {
presentingViewB = false
}
}
}
}
struct ViewB: View {
@EnvironmentObject var viewModel: ViewModel
var body: some View {
Button {
viewModel.reset()
} label: {
Text("Return")
}
.navigationBarBackButtonHidden()
}
}
The reason of using code like
Button {
viewModel.gotoB()
} label: {
Text("goto ViewB")
}
in ViewA is because in real code the Button is actually several subviews where the navigation-triggering code is deeply nested.
We are reaching out for guidance after encountering 2nd repeated "Guideline 4.3(a) - Design - Spam" rejections for our WeNote app. Here’s a brief timeline of our journey:
2018: We launched the WeNote Android app on Google Play Store.
2019: We started promoting WeNote on YouTube and began development of the WeNote iOS app. Our progress was publicly visible on our Trello board and discussed on the Apple Developer forum.
August 17, 2021: We filed an official complaint with Apple regarding a *** company infringing on our app logo, title, and description. The issue was resolved when *** agreed to update their app’s branding.
2022 Year: *** company is terminated from App Store.
June 2022: WeNote for iOS was officially released on the Apple App Store.
June 17, 2024: We received a rejection from the Apple Review team citing Guideline 4.3(a) - Design - Spam: “We noticed your app shares a similar binary, metadata, and/or concept as apps previously submitted by a terminated Apple Developer Program account. Submitting similar or repackaged apps is a form of spam that creates clutter and makes it difficult for users to discover new apps.”
We successfully resolved this issue by providing documentation about the previous incident on August 17, 2021.
November 22, 2024: Unfortunately, we received the same rejection message again, despite having already informed Apple of the previous case.
Request for Assistance:
We are now seeking guidance from the community or anyone with experience in navigating similar issues. We’ve provided Apple with all the necessary evidence and explanations regarding the previous incident, but our appeal was rejected.
How can we resolve this issue, and prevent future rejections?
Some Background on WeNote:
To help provide context, I’d like to highlight what makes WeNote stand out compared to other apps in the same category:
WeNote is an all-in-one solution: While most apps in the market focus on one function—whether it’s note-taking, to-do lists, or calendar management—WeNote uniquely combines all three into a single app. This integration offers users a seamless experience to manage tasks, notes, and schedules in one place.
Proven user satisfaction: We are proud to have over 7,000 user reviews, with an average rating of 4.8 stars. This high rating reflects our users' satisfaction with the app’s features and functionality, as well as its ability to meet their needs in a way that other apps do not.
We believe these features make WeNote a valuable and unique tool for users, and we continue to prioritize quality and user experience in our development.
I need to check how long we can run an app in background which act as a consumer of data / control filter. What is the max time we get to run our app in background without any of these app strategies?
https://developer.apple.com/documentation/backgroundtasks/choosing-background-strategies-for-your-app
Hi everyone,
I have an iPad with iOS 18 and used my old device to sync data. There is a trusted CA certificate on my old device. After device data synchronization, the certificate was not synchronized on the iPad. When I tried to manually install the CA certificate on my iPad, it was not in the device's certificate trust settings.
Environment
• iOS Version: iOS 18
• Device: iPad mini 5
Thank you
Recently I've been trying to play some AV1-encoded streams on my iPhone 15 Pro Max. First, I check for hardware support:
VTIsHardwareDecodeSupported(kCMVideoCodecType_AV1); // YES
Then I need to create a CMFormatDescription in order to pass it into a VTDecompressionSession. I've tried the following:
{
mediaType:'vide'
mediaSubType:'av01'
mediaSpecific: {
codecType: 'av01' dimensions: 394 x 852
}
extensions: {{
CVFieldCount = 1;
CVImageBufferChromaLocationBottomField = Left;
CVImageBufferChromaLocationTopField = Left;
CVPixelAspectRatio = {
HorizontalSpacing = 1;
VerticalSpacing = 1;
};
FullRangeVideo = 0;
}}
}
but VTDecompressionSessionCreate gives me error -8971 (codecExtensionNotFoundErr, I assume).
So it has something to do with the extensions dictionary? I can't find anywhere which set of extensions is necessary for it to work 😿.
VideoToolbox has convenient functions for creating descriptions of AVC and HEVC streams (CMVideoFormatDescriptionCreateFromH264ParameterSets and CMVideoFormatDescriptionCreateFromHEVCParameterSets), but not for AV1.
As of today I am using XCode 15.0 with iOS 17.0.0 SDK.
Iam trying to notarize with notarytool command with app-specific password.
xcrun notarytool submit <Path> --apple-id <APPLE_ID> --password <APP_SPECIFIC_PASSWORD> --team-id <Team-ID>
But it fails with error Error: HTTP status code: 401. Unable to authenticate. Invalid session. Ensure that all authentication arguments are correct.
Tried generating new app-specific password, still failing.
Tried storing password in keychain with store-credentials option, again failing.
--verbose option with store-credentials showing below error
This process stores your credentials securely in the Keychain. You reference these credentials later using a profile name.
Validating your credentials...
[06:05:28.854Z] Info [API] Initialized Notary API with base URL: https://appstoreconnect.apple.com/notary/v2/\
[06:05:28.854Z] Info [API] Preparing GET request to URL: https://appstoreconnect.apple.com/notary/v2/test?, Parameters: [:], Custom Headers: private<Dictionary<String, String>>
[06:05:28.855Z] Debug [AUTHENTICATION] Delaying current request to refresh app-specific password token.
[06:05:28.855Z] Info [API] Preparing GET request to URL: https://appstoreconnect.apple.com/notary/v2/asp?, Parameters: [:], Custom Headers: private<Dictionary<String, String>>
[06:05:28.855Z] Debug [AUTHENTICATION] Authenticating request to '/notary/v2/asp' with Basic Auth. Username: , Password: private, Team ID:
[06:05:28.856Z] Debug [TASKMANAGER] Starting Task Manager loop to wait for asynchronous HTTP calls.
[06:05:30.194Z] Debug [API] Received response status code: 401, message: unauthorized, URL: https://appstoreconnect.apple.com/notary/v2/asp?, Correlation Key:
[06:05:30.195Z] Error [TASKMANAGER] Completed Task with ID 2 has encountered an error.
[06:05:30.195Z] Debug [TASKMANAGER]Ending Task Manager loop.
Error: HTTP status code: 401. Unable to authenticate. Invalid session. Ensure that all authentication arguments are correct.
What is the immersive space projection method? erp, fisheye, cube
We want to achieve the same effect as Apple immersive
i was update my iPhone 15 pro max on IOS 18.2 beta versio. I am fasing the issu. When i am playing Pubg Game, the notification always Come down and game stop. And when i try to On “Guided Access” the Guided access also not workin. Plzzz fix it. And i have another issue with iPhone when i open any app or any documents its very difficult to Go Back. i have to use left hand to go back or always Use Both hands. If it’s possible the “Go Back” option is available on both left and right side. right hander also easily use iPhone on One hand. give us a option “Go Back” option on Right also. Its very easy for us. Thank u soo much🩷🩷
I was trying to set custom audio output device for a generated audio on macCatalyst.
While using let status = AudioUnitSetProperty(outputUnit,
kAudioOutputUnitProperty_CurrentDevice,
kAudioUnitScope_Global,
0,
&outputDeviceID,
UInt32(MemoryLayout.size))
kAudioOutputUnitProperty_CurrentDevice is invalid, and status = -10879, indicating an error.
STEPS TO REPRODUCE
Set Run Destination to MacOS and run the program. "AudioUnitSetProperty: 0" should be printed, indicating it works fine.
Set Run Destination to Mac Catalyst and run the program. "Error setting output device: -10879" should be printed, indicating an error.
we run into this error please help
--> Provisioning profile failed qualification
Profile doesn't support Tap to Pay on Iphone
---> Provisioning profile failed qualification
Profile doesn't include the com.apple.developer.proximity-reader.payment.acceptance entitlement
Hello,
I seem to be unable to change TabView's background color (not the bar, but the background of the entire TabView), no matter what I try.
What I am looking for:
To make the TabView's background clear.
My code:
TabView(selection: $activeScreen) {
Screen1()
.tabItem {
Label("Menu", systemImage: "list.dash")
}
}
Screen1 is defined as:
struct Screen1: View {
var body: some View {
VStack {
Text("Hello")
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
What I have tried, based on suggestions online:
Changing UITabBarAppearance in init(), and .onAppear()
TabView().background(.clear)
In all cases, the TabView's background remains either white or black, depending on the device's theme. I can change the background behind it by placing it in a ZStack, but that is not what I am looking for, I want the background itself to be clear.
The only way that TabView will honor .background(.clear) is if I add the following:
.tabViewStyle(.page)
.indexViewStyle(.page(backgroundDisplayMode: .always))
But this changes the style of the TabView, which is not the desired behavior.
Any help would be greatly appreciated, thank you!
Hello, all,
I'm new to iOS development and working on a project with the following setup:
Architecture:
Windows PC running Ubuntu (WSL) hosting a WebSocket Server with self-signed SSL
Python GUI application as a client to control iOS app
iOS app as another client on physical iPhone
Server running on wss://***.***.***.1:8001 (this is the mobile hotspot IP from Windows PC which the iPhone is needed to connect to as well)
Current Status:
✓ Server successfully created and running
✓ Python GUI connects and functions properly
✓ iOS app initially connects and communicates for 30 seconds
✗ iOS connection times out after 30 seconds
✗ Map updates from GUI don't sync to iOS app
Error Message in Xcode terminal:
WebSocket: Received text message
2024-11-25 15:49:03.678384-0800 iVEERS[1465:454666] Task <CD21B8AD-86D9-4984-8C48-8665CD069CC6>.<1> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2103, _NSURLErrorFailingURLSessionTaskErrorKey=LocalWebSocketTask <CD21B8AD-86D9-4984-8C48-8665CD069CC6>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalWebSocketTask <CD21B8AD-86D9-4984-8C48-8665CD069CC6>.<1>"
), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=wss://***.***.***.1:8001/, NSErrorFailingURLKey=wss://***.***.***.1:8001/, _kCFStreamErrorDomainKey=4}
Technical Details:
Using iOS built-in URLSessionWebSocketTask for WebSocket connection
Self-signed SSL certificate
Transport security settings configured in Info.plist
Map updates use base64 encoded PNG data
Questions:
What's causing the timeout after 30 seconds?
How can I maintain a persistent WebSocket connection?
Why aren't map updates propagating to the iOS client?
Any guidance/suggestions would be greatly appreciated. Please let me know if additional code snippets would help on what I currently have.
Both appleIDs(create and modify/save) sign in iCloud.
I use the following code to modify and save records:
self.containerIdentifier).publicCloudDatabase
database.fetch(withRecordID: CKRecord.ID(recordName:groupID), completionHandler: { record, error in
if error == nil && record != nil {
if let iDs : [String] = record!.object(forKey: "memberIDs") as? Array {
if iDs.count < self.maxMemberCount {
if let mems: [String] = record!.object(forKey: "memberNames") as? Array {
if !(mems as NSArray).contains(name) {
var members = mems
members.append(name)
record!.setObject(members as CKRecordValue, forKey: "memberNames")
var iDs : [String] = record!.object(forKey: "memberIDs") as! Array
iDs.append(self.myMemberID)
record!.setObject(iDs as CKRecordValue, forKey:"memberIDs")
database.save(record!, completionHandler: { record, error in
if error == nil {
} else {
completion(error as NSError?)
dPrint("Error : \(String(describing: error))")
}
})
}else{
let DBError : NSError = NSError(domain: "DBError", code: 89, userInfo: ["localizedDescription": NSLocalizedString("Your nickname already used.", comment:"")])
completion(DBError)
print("change your nickname")
}
}else{
print("group DB error")
let DBError : NSError = NSError(domain: "DBError", code: 88, userInfo: ["localizedDescription": NSLocalizedString("Please try later.", comment:"")])
completion(DBError)
}
}
}else{
print("Error : \(String(describing: error))")
}
})
I received the following error message:
?Error saving records: <CKError 0x600000bbe970: "Service Unavailable" (6/NSCocoaErrorDomain:4099); "Error connecting to CloudKit daemon. This could happen for many reasons, for example a daemon exit, a device reboot, a race with the connection inactivity monitor, invalid entitlements, and more. Check the logs around this time to investigate the cause of this error."; Retry after 5.0 seconds>
baseNSError@0 NSError domain: "CKErrorDomain" - code: 6
_userInfo __NSDictionaryI * 4 key/value pairs 0x000060000349e300
[0] (null) "NSLocalizedDescription" : "Error connecting to CloudKit daemon. This could happen for many reasons, for example a daemon exit, a device reboot, a race with the connection inactivity monitor, invalid entitlements, and more. Check the logs around this time to investigate the cause of this error."
key __NSCFConstantString * "NSLocalizedDescription" 0x00000001117155a0
value __NSCFConstantString * "Error connecting to CloudKit daemon. This could happen for many reasons, for example a daemon exit, a device reboot, a race with the connection inactivity monitor, invalid entitlements, and more. Check the logs around this time to investigate the cause of this error." 0x000000011057e700
[1] (null) "CKRetryAfter" : Int32(5)
key __NSCFConstantString * "CKRetryAfter" 0x000000011057c680
value NSConstantIntegerNumber? Int32(5) 0x00000001105c2ed0
[2] (null) "CKErrorDescription" : "Error connecting to CloudKit daemon. This could happen for many reasons, for example a daemon exit, a device reboot, a race with the connection inactivity monitor, invalid entitlements, and more. Check the logs around this time to investigate the cause of this error."
key __NSCFConstantString * "CKErrorDescription" 0x0000000110568d00
value __NSCFConstantString * "Error connecting to CloudKit daemon. This could happen for many reasons, for example a daemon exit, a device reboot, a race with the connection inactivity monitor, invalid entitlements, and more. Check the logs around this time to investigate the cause of this error." 0x000000011057e700
[3] (null) "NSUnderlyingError" : domain: "NSCocoaErrorDomain" - code: 4099
key __NSCFConstantString * "NSUnderlyingError" 0x0000000111715540
value NSError? domain: "NSCocoaErrorDomain" - code: 4099 0x00006000016cc300
Hello,
I am building a swift macOS app and have noticed issues today with delivering APN's to both development and production devices. Similar to this thread the only way I can get them to deliver temporarily is to do one of:
Change the bundle ID of my app to a new bundle ID, then start it up. I will usually get the first notification.
Reset my network (either wired ethernet or wifi, typically both)
Using the push notifications console for development sends, I see the message "discarded as device was offline" in the delivery log even though the device is still online and was just registered when I got back the deviceToken.
If I set an expiration on development notifications then the delivery log says "stored for device power considerations" and the notification will then send once I do one of the above steps (new bundle or reset network).
Previous to today the notifications were sending immediately and I had no issues getting them. Is there something I can do to fix this problem, is it a problem with the APN provider, or is it something else I haven't thought of?
A unique ID for an expiration-based notification is 1755def8-1a44-cbcf-c64b-64e435c30f81, and a non-expiry is d7a72b46-0c64-4500-0abc-3734f9efbd90.
When an app is trying to access identities put in the keychain by cryptotokenkit extension, the user gets asked a permission pop-up
which reads
'Token Access Request"
would like access a token provided by: "
with 2 options 'Don't allow' and 'OK'
I accidently clicked "Don't allow" and now can't access identities put in crypto token kit.
How can I reset the preference?
I tried to install the flang-new compiler from Homebrew on Sequoia OSX. Complex division is broken because file divdc3 is missing. This file comes from libclang_rt.osx.a, a standard LLVM library. This library is missing on OSX.
program test
integer, parameter :: n=2
complex(kind=8), dimension(n,n) :: V
complex(kind=8) :: PER
V(1,1)=cmplx(4.0,2.0)
V(2,2)=cmplx(5.0,3.0)
V(1,2)=0.0
V(2,1)=0.5
PER=cmplx(1.2,1.2)
V(:,:)=V(:,:)/PER
end program test
alainhebert@Alains-MacBook-Air-2 test_complex % flang-new test.f90
Undefined symbols for architecture arm64:
“___divdc3”, referenced from:
__QQmain in test-fc2bb3.o
ld: symbol(s) not found for architecture arm64
flang-new: error: linker command failed with exit code 1 (use -v to see invocation)