today-extension

Can we incorporate the Speech Recognition framework with Today Extension

青春壹個敷衍的年華 提交于 2019-12-20 03:09:42
问题 I am trying to build a widget which has a speech button. When I press it , it should convert the speech uttered to text. However when I try to record the voice , AVAudioEngine fails to start. Is it because AVAudioEngine is not allowed in Today Extension? 回答1: Searching the internet I seem to have found my answer. The short answer is no, you can't record Audio in extension. 来源: https://stackoverflow.com/questions/44365523/can-we-incorporate-the-speech-recognition-framework-with-today-extension

Use AppDelegate in today extension

我怕爱的太早我们不能终老 提交于 2019-12-19 21:45:09
问题 I'm trying to build an today extension for my app. I'm using CoreData and NSFetchedResultsController and get the following error: Use of undeclared type 'AppDelegate' In this line of code: var appDel: AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate. Does someone know how to solve this error / use AppDelegate in the today extension and would like to help me? 回答1: A Today Extension isn't an application, so UIApplication and AppDelegate aren't available. I'm not for sure

Use AppDelegate in today extension

我是研究僧i 提交于 2019-12-19 21:43:06
问题 I'm trying to build an today extension for my app. I'm using CoreData and NSFetchedResultsController and get the following error: Use of undeclared type 'AppDelegate' In this line of code: var appDel: AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate. Does someone know how to solve this error / use AppDelegate in the today extension and would like to help me? 回答1: A Today Extension isn't an application, so UIApplication and AppDelegate aren't available. I'm not for sure

How to pick one from multiply widgets for home screen using 3d touch?

人走茶凉 提交于 2019-12-19 18:28:34
问题 When I was using only one today widget it was very simple and was like this: Now I added a second today widget to my app, and it is like this: Why it disappeared? What is wrong? Shouldnt be there two today widgets? Can I decide what widget should be preferred here? Apple says: Choose a widget for the quick action list . If your app has multiple widgets, pick one to appear in the quick action menu that appears when someone applies pressure to your app icon on the Home screen using 3D Touch.

How to access current firebase user from iOS Today Extension?

你说的曾经没有我的故事 提交于 2019-12-19 08:27:32
问题 We're building a today widget on top of our iOS app which is working with Firebase. However we're struggling to access current signed-in user from the extension. The user at the main app is anonymous so passing credentials via shared container is not an option. The only way that I found is passing uid and generate custom token to sign in but I was hoping to find out better way to share FIRUser between my main app and app extension. What would be the best way to achieve this? 回答1: You can

NSUserDefaultsDidChangeNotification and Today Extensions

China☆狼群 提交于 2019-12-17 18:33:07
问题 I am developing an iPhone app with a Today Extension . The app has a Model module that loads from/saves to NSUserDefaults . Since I want this information to be available to both the main app and the extension, I use an app group: let storage = NSUserDefaults(suiteName: "group.etc.etc.etc...") Both the app and the extension can access the information without any problem. The main app occasionally might create a local notification to present to the user. That notification has two actions

Today App Extension Widget Tap To Open Containing App

自作多情 提交于 2019-12-17 07:14:52
问题 I've implemented a Today widget for my application +Quotes which displays the day's quote within the notification center with the help of these Apple Docs. What I'd like to accomplish is opening the Containing App, in this case +Quotes, when the user taps the +Quotes widget within their Today notification view, not entirely sure what to call this, as Calendar would if you tapped it in the Today view. I've tried overlaying a button over the label which would call -(void)openURL:(NSURL *)URL

Load file in Today extension

a 夏天 提交于 2019-12-14 03:42:40
问题 I've been trying to create a Today extension that needs access to a .plist file in the documents directory. I have setup the App group for both the app and the extension. While I have seen examples for NSUserDefaults , I couldn't find anything for accessing files. I tried accessing the file like this (which works in the app itself) let paths = NSSearchPathForDirectoriesInDomains( .DocumentDirectory, .UserDomainMask, true) let documentsDirectory = paths[0] as String let filePath = "\

Observing Notification in Today Widget which is posted from main app

天大地大妈咪最大 提交于 2019-12-13 03:58:44
问题 I have declared notification name in a swift file which has target membership of both main app and today widget: let SpecialKey = Notification.Name("howLongNotif") Then in my main app view controller, I am posting notification when location is updated (background mode for location updates is on): NotificationCenter.default.post(name: SpecialKey, object: nil, userInfo: nil) In my today widget viewDidLoad, I am observing it like this: NotificationCenter.default.addObserver(self, selector:

Save/Delete to HealthKit With WatchKit and Widget (Today Extension)?

淺唱寂寞╮ 提交于 2019-12-13 02:54:32
问题 Here is a question that I know has an answer since I see apps that do this functionality. I have tried (writing directly, using background fetch) but nothing works. I found an app currently on the app store with the functionality that I am looking for. With Background Fetch set to OFF and main app NOT running in background. I go to the Widget and add an item. I open HealthKit and I see the data there as expected. I would like to do the same for my app. I would like my today extension (widget)