Posts

Post not yet marked as solved
4 Replies
4.5k Views
I'm starting to work on BLE and would like some advice on best practices or what to look out for if any one has been down this route.For example, if 3 people are wearing the same Polar Bluetooth HRM (i.e., in a Gym) when the app starts up and scans for perifierials & services how can I choose which device to select?CBCentralManagerScanOptionAllowDuplicatesKey is off by default, to avoid battery drain.Will the closest HRM (strongest signal) appear in the CBPeripheral didDiscoverServiceslist first?Is there a way for the user to 'save' their device? - since there is no pairing option or specific UID available that I am aware of.Thanks...
Posted
by blaine l.
Last updated
.
Post not yet marked as solved
0 Replies
389 Views
I published a new iPad app 30+ days ago with a few IAP items. Everything works correctly in testing. Now that it's a live app, everything is working as expected as well. You pay for a feature, the feature gets unlocked, and you get billed by Apple. This has been confirmed by myself and a few others who have made AIPs for the app. If the app is removed and added back, the restore purchases works as well. But the problem is that the Trends/Proceeds show $0.00 Why am I not getting paid? And why does App Connect not show any sales when there are confirmed sales since the first week it launched (over 30 days ago)? All documents and banking info are up to date and I can see revenue from my other apps (they don't have AIP).
Posted
by blaine l.
Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
I've added IAP to an iOS App that includes consumables and non-consumables. I'm going though each criteria for Testing at All Stages of Development with Xcode and Sandbox and Step 10 of Testing an Interrupted Purchase is not happening. For the transaction... I've set everything up I get the transactionState .failed and I call finishTransaction for the queue (as outlined in the docs) After accepting the agreement, the payment queue does not receive a new transaction. Is anyone experiencing the same thing? If yes, how to do get around updating the purchase? If I call restoreCompletedTransactions on the queue, it will pull the transaction (FYI - I am doing a single purchase on a consumable item to start). So does this mean I need to call up the queue on my own each time an interruption appears? (as there is no way to determine if and when the user completed the interrupted transaction). I would appreciate input and how to handle this gracefully so that I can update the UI. Thanks!
Posted
by blaine l.
Last updated
.
Post not yet marked as solved
0 Replies
432 Views
I have an iPad app that has 3 viewControllers. vcMain, vcMenu, vcInfo vcMenu and vcInfo are custom sized windows vcMain uses a segue to presentModally the vcMenu The vcMenu has an info buttons that uses a segue to presentModally the vcInfo After years, this no longer works as the vcMenu no longer appears to be the topmost window. 'Attempt to present vcInfo on vcMenu (from vcMenu whose view is not in the window hierarchy.' I can bypass this issue when setting isModalInPresentation to true when vcMenu appears, but I do not want to change the behavior of the vcMenu by having to add a 'Close' button Also setting isModalInPresentation to true in the info button function before calling performSegue does not work. It also does not work if I add a delay inside the function (ie perform a #selector). Any suggestions? Is there a new setting somewhere that I am missing? Here is the code... import UIKit class vcMain: UIViewController {     // all functions perfomed in storyboard     // a button uses a segue to open vcMenu with // Kind: presentModally     override func viewDidLoad() { super.viewDidLoad() } } class vcMenu: UIViewController {     let ID_POP_UP = "id1"     @IBAction func btnInfo(_ sender: UIButton) {         isModalInPresentation = true // get error         // performSegue(withIdentifier: ID_POP_UP, sender: nil)         perform(#selector(presentExampleController), with: nil, afterDelay: 2)     }     @objc private func presentExampleController() { // get error even if add a 2s delay         performSegue(withIdentifier: ID_POP_UP, sender: nil)     }     @IBAction func btnBack(_ sender: UIButton) {         isModalInPresentation = false         self.dismiss(animated: true, completion: nil)     }     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {         guard let segueId = segue.identifier else { return }         if segueId == ID_POP_UP { print("ID_POP_UP: \(ID_POP_UP)") }    // Just checking     }     override func viewDidAppear(_ animated: Bool) {         super.viewDidAppear(animated)         //isModalInPresentation = true      // no error     } } class vcInfo: UIViewController {     override func viewDidDisappear(_ animated: Bool) {         if let main = self.parent { main.isModalInPresentation = false } // testing         super.viewDidDisappear(animated)     }     @IBAction func btnCloseAll(_ sender: UIButton) {        self.view.window!.rootViewController?.dismiss(animated: true, completion: nil)  // close all popovers     } }
Posted
by blaine l.
Last updated
.
Post not yet marked as solved
1 Replies
474 Views
I have about 15 global Integer constants in my app. Half of them display zero. For example... struct Global {     struct lives {         static let free = 3         static let paid = 5     } } let CRATE_LOCATION_ZERO = CGPoint(x: -10000, y: -10000) Then later in code I try to use them... let purchasedApp = true let newLives = purchasedApp ? paid : free let newCrateLocation = CRATE_LOCATION_ZERO When I run the program and get these values, they are always zero. When I add a break point and check the values, they are also zero. The newLives will be 0 The CGPoint will be x:0, y:0 But not all the static (or constant) values end up being 0. Then some others have different values. I've also put up a video to show you what I mean. leckett.net/video/wierd.mov CPU and memory are all okay. I'm running Xcode 12.5.1 Has anybody experienced this?
Posted
by blaine l.
Last updated
.
Post not yet marked as solved
3 Replies
856 Views
I'd lke to hear peoples comments on what the best practices would be for the need to checking a condition before updating a User Interface element in iOS (including watchOS and tvOS).Here are some examples *1. An Undo button keeping track of changesfunc update(_ data: Data) { updateHistory(data: Data) if !btnUndo.isEnabled { btnUndo.isEnabled = true } // use this one or btnUndo.isEnabled = true // use this one? }2. Text in a label that hasn't changedvar timerMonitorHeartRate = Timer() func startMonitoring() { timerMonitorHeartRate.invalidate() timerMonitorHeartRate = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { [weak self] timer in self?.displayHeartRate() } } func displayHeartRate() { let heartRateValue = BLEHeartRate.value // value comes from some async function let heartRateString = String(format: "Heart Rate %1.2f", heartRateValue) if (lblHearRate.text != heartRateString) { lblHearRate.text = heartRateString } // use this one or lblHearRate.text = heartRateString // use this one? }* these exmples are just off the top of my head, I didn't check them for syntax, only to give you an idea of what I'm talking about.Should we check the conditon before updating an item or does the underlaying code do that for us (i.e., the button will not actually undergo a paint refresh since it will internally check and already know that it is enabled). If this is the case, would the same thing happen when updating a text property with the same text?
Posted
by blaine l.
Last updated
.
Post not yet marked as solved
0 Replies
409 Views
Hi - I'm implementing IAP and find the documentation a bit limited in error handling descriptions for the SKPaymentTransaction Failed Status and would like to know what others are doing. For example, Apple has some of their own messages that appear during an IAP. Also, when I user cancels somewhere along the way, some Apple messages appear depending on the context. (ie switch to a different store, not accepting T&Cs, change patent on the fly etc...). In other cases, they do not. Displaying the error description to the user seems to be too much detail. Displaying a generic Transaction Failed seems too limited. Plus always displaying a message for a failed transaction may be redundant. Does anyone have a recommend approach for what to display (or not display) for a failed transaction? Greatly appreciate it. Thanks a lot... Blaine
Posted
by blaine l.
Last updated
.
Post not yet marked as solved
0 Replies
449 Views
I'm using AVAudioPlayer to play background music in my app. When I invoke Siri, the player stops. After Siri answers the question background music no longer plays. How can I detect when Siri stops answering so that I can resume my background music?
Posted
by blaine l.
Last updated
.