Posts

Post not yet marked as solved
0 Replies
253 Views
I created a new iOS app with a keyboard extension. I added a UITextView to it, but when I tap on it, it crashes somewhere in outside of my code. This is pretty much the keyboard extension template with the UITextView added: (In KeyboardViewController):         super.viewDidLoad()                  // Perform custom UI setup here         self.nextKeyboardButton = UIButton(type: .system)                  self.nextKeyboardButton.setTitle(NSLocalizedString("Next Keyboard", comment: "Title for 'Next Keyboard' button"), for: [])         self.nextKeyboardButton.sizeToFit()         self.nextKeyboardButton.translatesAutoresizingMaskIntoConstraints = false                  self.nextKeyboardButton.addTarget(self, action: #selector(handleInputModeList(from:with:)), for: .allTouchEvents)                 self.view.addSubview(self.nextKeyboardButton)                  self.nextKeyboardButton.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true         self.nextKeyboardButton.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true                  self.textView = UITextView(frame: .zero)         guard let textView = self.textView else { return }                  textView.attributedText = NSAttributedString(string: "test keyboard")         textView.translatesAutoresizingMaskIntoConstraints = false         textView.layer.borderColor = UIColor.blue.cgColor         textView.layer.borderWidth = 2                  view.addSubview(textView)                  NSLayoutConstraint.activate([             textView.topAnchor.constraint(equalTo: view.topAnchor, constant: 10),             textView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 10),             textView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 10),             textView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 10),         ])     } What’s interesting is that in my actual app, the same code works as long as Full Access is granted for the keyboard. From what I understand, UITextViews should work even if Full Access isn’t granted. Has anyone had any experience with putting a UITextView into a keyboard extension not running with Ful Access?
Posted
by leftspin.
Last updated
.
Post not yet marked as solved
0 Replies
317 Views
Hi all, I have an app which is essentially a keyboard extension. Some features of the keyboard require a subscription to work, and this subscription can be bought in the main app. My question is, can the keyboard extension use StoreKit 2 to verify the validity of a subscription created in the main app? If this isn't possible (due to sandboxing or whatever), I suppose I can just write status information that's shared using an app group, but the problem with this is that the app is likely to run seldomly. This mean that if the subscription is cancelled or lapses, the main app may not see it for a while, and the keyboard will continue to functions even though it has expired. One other thing I've thought of is maybe to share the receipt of the purchase with the extension, and have the keyboard sync and verify the receipt periodically with Apple's servers. Is this the proper way to do it? Thanks!
Posted
by leftspin.
Last updated
.