I'm having problems creating an In-App Purchase.
It throws the following Error message: "An error has occurred. Try again later."
And inspecting it with the browser dev tools reveals this:
{
"errors" : [ {
"id" : "...",
"status" : "409",
"code" : "ENTITY_ERROR.IAP_CREATION_NOT_ALLOWED",
"title" : "You cannot create new in-app purchase.",
"source" : {
"pointer" : "/data/id"
}
}
]
}
There was a pending agreement, and we have accepted it yesterday, but I am still getting the same error.
Overview
Post
Replies
Boosts
Views
Activity
before I got the ios 18 I did not have a time limit but now I do yes I can ignore it after a certain time p but I would still like it to be gone
I have several CoreML models that I've set up to run in sequence where one of the outputs from each model is passed as one of the inputs to the next.
For the most part, there is very little overhead in between each sub-model "chunk":
However a couple of the models (eg the first two above) spend a noticeable amount of time in "Prepare Neural Engine Request". From Instruments, it seems like this is spent doing some sort of model loading.
Given that I'm calling these models in sequence and in a fixed order, is there some way to reduce or amortize this cost? Thanks!
Hello,
I have a SwiftUI view with the following state variable:
@State private var startDate: Date = Date()
@State private var endDate: Date = Date()
@State private var client: Client? = nil
@State private var project: Project? = nil
@State private var service: Service? = nil
@State private var billable: Bool = false
Client, Project, and Service are all SwiftData models. I have some view content that binds to these values, including Pickers for the client/project/service and a DatePicker for the Dates.
I have an onAppear listener:
.onAppear {
switch state.mode {
case .editing(let tt):
Task {
await MainActor.run {
startDate = tt.startDate
endDate = tt.endDate
client = tt.client
project = tt.project
service = tt.service
billable = tt.billable
}
}
default:
return
}
}
This works as expected. However, if I remove the Task & MainActor.run, the values do not fully update. The DatePickers show the current date, the Pickers show a new value but tapping on them shows a nil default value.
What is also extremely strange is that if tt.billable is true, then the view does update as expected.
I am using Xcode 15.4 on iOS simulator 17.5. Any help would be appreciated.
For Sign in With Apple I recieve an expected flow including an ask to share or hide my email along with a message like this
'Create an account for Apple {some_company} using your Apple ID “{email}”.'
However when i sign into an existing account i get the same flow, where on other apps i see a message like this ~ "Do you want to continue using {some_company} with your Apple ID “{email}”?
How can i configure this for my own app?
Note: it always logs me into the correct existing account, i'm just trying to make sure users go through the correct flow in the apple popup when their account already exists.
This afternoon notarization started throwing an error in terminal. I confirmed that the NOTARIZE_APP_LOG was created, but empty. I have been notarizing our apps on this machine (intel-12.7) with Xcode 13.4.1 for over a year without issue. Any suggestions would be greatly appreciated
9192 Bus error: 10 xcrun notarytool submit --apple-id "$ASC_USERNAME" --password "$ASC_PASSWORD" --team-id "$ASC_TEAM" "$ZIP_PATH" > "$NOTARIZE_APP_LOG" 2>&1
Translated Report (Full Report Below)
Process: notarytool [9192]
Path: /Library/Developer/CommandLineTools/usr/bin/notarytool
Identifier: notarytool
Version: ???
Code Type: X86-64 (Native)
Parent Process: bash [2167]
Responsible: Terminal [2142]
User ID: 501
Date/Time: 2024-07-02 16:29:33.5256 -0600
OS Version: macOS 12.7 (21G816)
Report Version: 12
Bridge OS Version: 8.0 (21P365)
Anonymous UUID: 9AFB52C6-5CA1-7AE0-C249-9D090ABDFD28
Time Awake Since Boot: 820 seconds
System Integrity Protection: enabled
Crashed Thread: 1 Dispatch queue: nio.nioTransportServices.connectionchannel
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000700009d77ff0
Exception Codes: 0x0000000000000002, 0x0000700009d77ff0
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SIGNAL, Code 10 Bus error: 10
Terminating Process: exc handler [9192]
I am using NWconnection to force some requests to go through cellular data. Everything works fine, except I keep calling connection.receive and don't know when the transfer is complete.
// Setting up the connection:
let tcpOptions = NWProtocolTCP.Options()
let parameters = NWParameters(tls: .init(), tcp: tcpOptions)
parameters.requiredInterfaceType = .cellular
port = port ?? NWEndpoint.Port(443)
// ...
NWConnection(to: .hostPort(host: NWEndpoint.Host(host),port: port), using: parameters)
// Receiving data once the connection is ready
func receive(withConnection connection: NWConnection, completion: @escaping dataCompletion) {
connection.receive(minimumIncompleteLength: 1, maximumLength: Int.max) { [self] data, contentContext, isComplete, error in
if let data = data {
receivedData.append(data)
print(contentContext)
if isComplete || error != nil || connection.state != .ready {
cancelConnection(connection)
} else {
processor?.receive(withConnection: connection, completion: completion)
}
} else {
cancelConnection(connection)
}
}
}
I am consuming regular HTTP endpoints. The data in receive comes in chunks but isComplete parameter never becomes true, so I don't know when to stop and send the complete receivedData back.
I've thought of adding a timeout, but it seems kind of hacky. Is there a better solution?
I created an application in xcode 13, and I need to install it on my iPhone 12 iOS 18.
I already went to the Apple Developers website and downloaded the files
iOS_17.5_Simulator_Runtime.dmg and also the file iOS_18_beta_Simulator_Runtime.dmg
I copied them to the folder on my Mac
/Library/Developer/CoreSimulator/Profiles/Runtimes/
And even so, when I opened xcode and went to deployment info, the most recent iOS version is still 15.2 and the last one I downloaded doesn't appear.
what should I do ?
I preferably want to install iOS 18 beta on my iPhone 12
I have a menu bar extra app that includes a sub-menu for lesser used functions. The sub menu implements .keyboardShortcut for a few of the menu items. When the app is first the active app, the keyboard shortcuts only produce a beep UNTIL the sub menu has been accessed. Once the sub-menu has loaded, the keyboard shortcuts work as expected.
I should note that the MenuBarExtra is using the .window display mode, if that's important. The submenu appears with a button press within the MenuBarExtra.
Is there a method to expose the keyboard shortcuts to the system before the view has loaded?
Hi all,
I've noticed some weird behavior when working NavigationStack paired with a NavigationPath, and I'm wondering if it's by design or perhaps a bug.
In short:
I'm experiencing that every time I push a new view to the NavigationPath, all the previous views appear to init and deinit, which can cause all sorts of problems if you aren't aware of it happening. It's seems like .navigationDestination(for: ) is run once per item in the path that is given to the NavigationStack. So if you add 3 items it'll run 3 times when adding the third view. But the original views and their state are kept.
Is this happening because pushing a view to the stack is seen as a state change? And is it intended?
The longer explanation:
So I'm developing an app in pure SwiftUI and I'm trying to establish a way of navigating through a router / coordinator. I like that my ViewModels can determine when navigation should happen and not the view. E.g. Normally I'd like to prepare some sort of data that should be transferred to the next view.
I've prepared an example project which you can use to check out the issue.
It's not a full example of my setup, but it's small enough to show what I'm experiencing. It can be found here:
https://github.com/Kimnyhuus/NavigationStackDemo
The structure is:
Router
App
RootView
AppleView + AppleViewModel
BananaView + BananaViewModel
PearView + PearViewModel
So the Router is an ObservableObject that contains a @Published NavigationPath object + functions for adding / removing to / from stack.
I've also added an enum here which defines the destinations that the Router can take an navigate to.
RootView is setup with a NavigationStack which is setup with the NavigationPath in the parameter:
NavigationStack(path: $router.navPath) { ... }
RootView also have the router setup as an EnvironmentObject:
.environmentObject(router)
This enables the other views to interact with the router and push new views to the stack.
Each view is initialized with its corresponding VM. The VMs contain nothing other than init and deinit, a variable containing the initialized id + a @Published num which can be set from the view. This is to keep track of the instances in the prints to the console. Each view can navigate to the two other views.
You can try and run the project yourselves, but I've made an example of the inits/deinits that happens here.
First, I'm navigating from RootView -> AppleView which is expected. The router prints from func navigate(to destination: Destination) that a view has been pushed to the stack. The RootView prints, when .navigationDestination(for: Destination.self) { ...} is triggered, and it says we're navigating to .apple. And then we see that the AppleVM is inited. All like expected.
||| Router: add to navPath: 1
||| NavStack: Destination .apple
||| Init ☀️: AppleViewModel, id: 879, num: 0
Then I navigate from AppleView -> BananaView and the weird stuff starts happening. We see that a second view has been added to the stack. BananaVM is inited like we'd expect. But then the previous actions seem to run again but with new instances.
||| Router: add to navPath: 2
||| NavStack: Destination .banana
||| Init ☀️: BananaViewModel, id: 167, num: 0
||| NavStack: Destination .apple
||| Init ☀️: AppleViewModel, id: 492, num: 0
Then I navigate from BananaView -> PearView and it's continuing.
It's now clear that .navigationDestination(for: Destination.self) { ... } is run once per item in the stack.
||| Router: add to navPath: 3
||| NavStack: Destination .pear
||| Init ☀️: PearViewModel, id: 436, num: 0
||| NavStack: Destination .banana
||| Init ☀️: BananaViewModel, id: 292, num: 0
||| NavStack: Destination .apple
||| Init ☀️: AppleViewModel, id: 434, num: 0
||| Deinit 🔥: AppleViewModel, id: 492, num: 0
Finally I navigate from PearView to AppleView and it's just piling on.
||| Router: add to navPath: 4
||| NavStack: Destination .apple
||| Init ☀️: AppleViewModel, id: 738, num: 0
||| NavStack: Destination .pear
||| Init ☀️: PearViewModel, id: 564, num: 0
||| NavStack: Destination .banana
||| Init ☀️: BananaViewModel, id: 769, num: 0
||| Deinit 🔥: BananaViewModel, id: 292, num: 0
||| NavStack: Destination .apple
||| Init ☀️: AppleViewModel, id: 283, num: 0
||| Deinit 🔥: AppleViewModel, id: 434, num: 0
Navigating back towards the RootView, you can see that it again inits and deinits different instances of the view models.
You’ll notice the original ones with state being deinit’ed where it has a number higher than 0 in “num”.
||| Router: rm navPath: 3
||| NavStack: Destination .banana
||| Init ☀️: BananaViewModel, id: 222, num: 0
||| Deinit 🔥: BananaViewModel, id: 769, num: 0
||| NavStack: Destination .pear
||| Init ☀️: PearViewModel, id: 801, num: 0
||| Deinit 🔥: PearViewModel, id: 564, num: 0
||| NavStack: Destination .apple
||| Init ☀️: AppleViewModel, id: 173, num: 0
||| Deinit 🔥: AppleViewModel, id: 283, num: 0
||| Deinit 🔥: AppleViewModel, id: 738, num: 0
||| Router: rm navPath: 2
||| NavStack: Destination .banana
||| Init ☀️: BananaViewModel, id: 26, num: 0
||| Deinit 🔥: BananaViewModel, id: 222, num: 0
||| NavStack: Destination .apple
||| Init ☀️: AppleViewModel, id: 744, num: 0
||| Deinit 🔥: AppleViewModel, id: 173, num: 0
||| Deinit 🔥: PearViewModel, id: 801, num: 0
||| Deinit 🔥: PearViewModel, id: 436, num: 3
||| Router: rm navPath: 1
||| NavStack: Destination .apple
||| Init ☀️: AppleViewModel, id: 401, num: 0
||| Deinit 🔥: AppleViewModel, id: 744, num: 0
||| Deinit 🔥: BananaViewModel, id: 26, num: 0
||| Deinit 🔥: BananaViewModel, id: 167, num: 2
||| Router: rm navPath: 0
||| Deinit 🔥: AppleViewModel, id: 401, num: 0
||| Deinit 🔥: AppleViewModel, id: 879, num: 1
What is making NavigationStack / .navigationDestination(for: ) run through all the previous items in the stack, every time the state changes in the NavigationPath?
I hope it's not too confusing with all the prints :-)
Please let me know if I need to add more info.
I've been trying to add an 'Info.plist' file this afternoon and get a recurring error that I haven't seen before. I see a lot of other people have posted similar errors over the time but I con't seen any solutions posted. I'd appreciate anyone reading this giving it a boost to perhaps have an engineer post a solution so others will not waste as much time on this as I have.
. Info.plist has the proper path, I do not have a 'script phase' or 'custom build rule', and I don't know what "Did you forget to declare this file as an output of a script phase or custom build rule" means. I've had Info.plists before, I'm just not sure why I'm getting this error or how to bypass it.
Adding the openAppWhenRun property to an AppIntent for a ControlWidgetButton causes the following error when the control is tapped in Control Center:
Unknown NSError The operation couldn’t be completed. (LNActionExecutorErrorDomain error 2018.)
Here’s the full ControlWidget and AppIntent code that causes the errorerror:
Should controls be able to open apps after the AppIntent runs, or is this a bug?
Hello everyone,
I'm having trouble with sending custom push notifications for Apple Wallet passes. Here's what I've done so far:
Registered a new pass: I receive a deviceToken for the pass.
Enabled Push Notifications: Push notifications for the Apple Wallet app and the specific pass are enabled on my phone.
Added the Key for Push Notifications: I've added the necessary key for push notifications.
I use following code to send the message via APNS:
const tokenKey = fs.readFileSync(options.tokenPath).toString();
jwtToken = sign({}, tokenKey, {
algorithm: 'ES256',
expiresIn: '1h',
issuer: options.teamId,
header: {
alg: 'ES256',
kid: options.keyId
}
});
const client = http2.connect('https://api.push.apple.com:443');
const notificationPayload = JSON.stringify({ aps: { "alert" : "Hello" } });
// and try
//{
// "aps": {
// "alert": "Your pass has been updated!",
// "sound": "default"
// },
// "pass-type-identifier": "pass.com.example.myPass",
// "serial-number": "123456789",
// "device-token": "<deviceToken>"
//}
const request = client.request({
':method': 'POST',
':path': `/3/device/${deviceToken}`,
'apns-topic': topicId,
'apns-push-type': 'alert',
'authorization': `bearer ${jwtToken}`,
'apns-priority': 10,
'content-type': 'application/json',
'content-length': Buffer.byteLength(notificationPayload)
});
return new Promise((resolve, reject) => {
request.on('response', (headers, flags) => {
for (const name in headers) {
console.log(`${name}: ${headers[name]}`);
}
});
request.on('data', (chunk: string) => console.log(chunk));
request.on('end', () => {
client.close();
resolve();
});
request.on('error', (err) => {
console.error('Error sending push notification:', err);
reject(err);
});
request.write(notificationPayload);
request.end();
});
When I send the message, I receive a :status:200 and a apns-ID, indicating that the message has been sent. However, I do not receive the custom push notifications on my phone. The pass updates are received without any issues, but the notifications are not.
Has anyone encountered this issue or know if it's possible to send custom push notifications for Apple Wallet passes in this manner? Any guidance on how to resolve this issue would be greatly appreciated.
I think I remember that requesting certain types of information / privacy-related access requires that the phone have a pin? Maybe location services? Anyway, is there a way for an app to require that a phone have a pin for the app to work?
How to set Tx power level for iphone
An app I'm developing uses a text data file to access some words. The app runs fine in all simulators and when directly hard-wired from my Mac to my iPhone. When I download it to App Store Connect and run the app in TestFlight the app runs fine except when it tries to access the data file. The error it gives me is that it can't access the same data that I access when running the app in the simulators.
Hello…!
I have bought an iPhone from flipkart on 07/10/2023 Which is around 10 months old and my battery health is decreased that is 89% I am facing issue of battery draining and phone heating while charging the phone.
Please solve my query what i have to do
Hi y'all,
After getting mono recording working, I want to differentiate my app from the standard voice memos to allow for stereo recording. I followed this tutorial (https://developer.apple.com/documentation/avfaudio/capturing_stereo_audio_from_built-in_microphones) to get my voice recorder to record stereo audio. However, when I look at the waveform in Audacity, both channels are the same. If I look at the file info after sharing it, it says the file is in stereo. I don't exactly know what's going on here. What I suspect is happening is that the recorder is only using one microphone. Here is the relevant part of my recorder:
// MARK: - Initialization
override init() {
super.init()
do {
try configureAudioSession()
try enableBuiltInMicrophone()
try setupAudioRecorder()
} catch {
// If any errors occur during initialization,
// terminate the app with a fatalError.
fatalError("Error: \(error)")
}
}
// MARK: - Audio Session and Recorder Configuration
private func enableBuiltInMicrophone() throws {
let audioSession = AVAudioSession.sharedInstance()
let availableInputs = audioSession.availableInputs
guard let builtInMicInput = availableInputs?.first(where: { $0.portType == .builtInMic }) else {
throw Errors.NoBuiltInMic
}
do {
try audioSession.setPreferredInput(builtInMicInput)
} catch {
throw Errors.UnableToSetBuiltInMicrophone
}
}
private func configureAudioSession() throws {
let audioSession = AVAudioSession.sharedInstance()
do {
try audioSession.setCategory(.record, mode: .default, options: [.allowBluetooth])
try audioSession.setActive(true)
} catch {
throw Errors.FailedToInitSessionError
}
}
private func setupAudioRecorder() throws {
let date = Date()
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.dateFormat = "yyyy-MM-dd, HH:mm:ss"
let timestamp = dateFormatter.string(from: date)
self.recording = Recording(name: timestamp)
guard let fileURL = recording?.returnURL() else {
fatalError("Failed to create file URL")
}
self.currentURL = fileURL
print("Recording URL: \(fileURL)")
do {
let audioSettings: [String: Any] = [
AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
AVLinearPCMIsNonInterleaved: false,
AVSampleRateKey: 44_100.0,
AVNumberOfChannelsKey: isStereoSupported ? 2 : 1,
AVLinearPCMBitDepthKey: 16,
AVEncoderAudioQualityKey: AVAudioQuality.max.rawValue
]
audioRecorder = try AVAudioRecorder(url: fileURL, settings: audioSettings)
} catch {
throw Errors.UnableToCreateAudioRecorder
}
audioRecorder.delegate = self
audioRecorder.prepareToRecord()
}
//MARK: update orientation
public func updateOrientation(withDataSourceOrientation orientation: AVAudioSession.Orientation = .front, interfaceOrientation: UIInterfaceOrientation) async throws {
let session = AVAudioSession.sharedInstance()
guard let preferredInput = session.preferredInput,
let dataSources = preferredInput.dataSources,
let newDataSource = dataSources.first(where: { $0.orientation == orientation }),
let supportedPolarPatterns = newDataSource.supportedPolarPatterns else {
return
}
isStereoSupported = supportedPolarPatterns.contains(.stereo)
if isStereoSupported {
try newDataSource.setPreferredPolarPattern(.stereo)
}
try preferredInput.setPreferredDataSource(newDataSource)
try session.setPreferredInputOrientation(interfaceOrientation.inputOrientation)
}
Here is the relevant part of my SwiftUI view:
RecordView()
.onAppear {
Task {
if await AVAudioApplication.requestRecordPermission() {
// The user grants access. Present recording interface.
print("Permission granted")
} else {
// The user denies access. Present a message that indicates
// that they can change their permission settings in the
// Privacy & Security section of the Settings app.
model.showAlert.toggle()
}
try await recorder.updateOrientation(interfaceOrientation: deviceOrientation)
}
}
.onReceive(NotificationCenter.default.publisher(for: UIDevice.orientationDidChangeNotification)) { _ in
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let orientation = windowScene.windows.first?.windowScene?.interfaceOrientation {
deviceOrientation = orientation
Task {
do {
try await recorder.updateOrientation(interfaceOrientation: deviceOrientation)
} catch {
throw Errors.UnableToUpdateOrientation
}
}
}
}
Here is the full repo: https://github.com/aabagdi/MemoMan/tree/MemoManStereo
Thanks for any leads!
Hello,
My app has gotten rejected because of guideline 5.1.1. My app required an account and a subscription to be used.
Can someone please let me know how they were able to get approved?
Would adding Apple sign in work?
Would letting the user browse the empty app work? They cant of anything without a subscription so I don’t know why this is getting declined.
I’ve asked if any of them would comply but the reviewer says they won’t offer any suggestions on app design, when that wasn’t the question. I just wanted to know if anything would make the app comply before I waste my time implementing anything.
Hi there, I have just recently had a go at trying to build an app using unreal engine. After much difficulty of finally getting the app to sign, build and deploy I am having issues with the app crashing immediately after opening it.
I have had a look at the crash log to find it including EXC_BAD_ACCESS (SIGSEGV) which I've come to understand means it may be accessing a value that doesn't exist. I was unable to understand or figure out any of the rest of it to find any clues on how to solve my issue.
If anyone could point me in the right direction as to why the app is crashing, it would be greatly appreciated.
crash log