today-extension

WCSession and Today Widget

自古美人都是妖i 提交于 2019-12-04 15:59:13
问题 I've an app with a today extension and a watch app. From the main app WCSession works fine and data is transferred to the watch and received correctly but when I try to send or receive data through the WCSession in the today widget the property paired and watchAppInstalled of the session are set to false so calling transferUserInfo: does nothing and session:didReceiveUserInfo: is never called. I know I can open the app using openURL and then send the new data but I want to do that without

Today Extension with UICollectionView different behaviour compared to Single View Application

浪子不回头ぞ 提交于 2019-12-04 08:33:16
I try to add a collection view to a Today Extension with specifying the items per row of 3 items and also with setting the section insets for with 20 for top, left, bottom and right. When I do this in a Single View Application everything is like expected, but when I do the same programmatically for the Today Extension the collection view looks different, especially the space of the right and bottom seems not to be like in the Single View Application. What's the reason why there is this difference? I expected the same behaviour for the Today Extension like in the Single View Application. To

Change NCWidgetDisplayMode programmatically in IOS10 Widget

ぐ巨炮叔叔 提交于 2019-12-04 08:13:40
I am looking to programmatically change the height of a today extension. As the iOS10 SDSK introduced NCWidgetDisplayMode I am trying to use it to programmatically change the height of my preferredContentSize . I have implemented widgetActiveDisplayModeDidChange : @available(iOSApplicationExtension 10.0, *) func widgetActiveDisplayModeDidChange(activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) { if (activeDisplayMode == NCWidgetDisplayMode.Compact) { self.preferredContentSize = maxSize } else { self.preferredContentSize = CGSize(width: maxSize.width, height: 280) } } I

MagicalRecord (CoreData) + Today Extension (iOS8)… Will They Play?

夙愿已清 提交于 2019-12-04 03:15:13
Hoping you can help. I'm adding Today support to my app, which uses MagicalRecord https://github.com/magicalpanda/MagicalRecord to managing all my CoreData stuff. I'm tearing my hair out trying to understand how to surface my data into the Today extension. I have enabled app groups as outlined here http://blog.sam-oakley.co.uk/post/92323630293/sharing-core-data-between-app-and-extension-in-ios-8 however all the documentation and StackOverflow posts I'm reading relate to using CoreData directly. MagicalRecord does a lot of the hard work for you, which is why I used it as I was totally new to it

How to launch a parent iOS App from its App Extension

北慕城南 提交于 2019-12-03 12:14:48
Does any one know how to launch the parent app from the app extension's view controller? I just want to launch the main app from its app extension. In the WWDC session Creating Extensions for iOS and OS X, Part 1 around the 22 minute mark the say to use the openURL:completionHandler: method from the UIViewController's extensionContext to open a custom URL scheme [self.extensionContext openURL:[NSURL URLWithString:@"your-app-custom-url-scheme://your-internal-url"] completionHandler:nil]; arcticmatt I asked a similar question here: Communicating with/opening Containing app from Share extension .

Today Widget Extension Height - iOS10

…衆ロ難τιáo~ 提交于 2019-12-03 10:49:05
The height for the Today's widget view mode cannot be set for compact Mode. No matter whatever value I set. It sets the height of the widget to a default value. The expanded mode works perfect and the value is properly set and reflected in the widget. I have already added this line in my viewDidLoad() method. self.extensionContext?.widgetLargestAvailableDisplayMode = .expanded Here is the code. The value of maxSize cannot be changed too as its a constant. func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) { //self

Today Extension Crashes before launching on iOS 8.1.2

本小妞迷上赌 提交于 2019-12-03 10:28:07
I've been making a today extension that downloads articles from a feed and display the latest ones. The whole thing worked fine on iOS 8, still worked on iOS 8.1, then came iOS 8.1.2 and we started having complaints about the today extension not working anymore. I tried debugging on iOS 8.1.2 devices, and before the extension even launch, it crashes with this error : Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: <__NSConcreteUUID 0x174027280> 5AFB07AB-5DCD-46FE-8D07-44DE0F3789F2)' I have read this post about

WCSession and Today Widget

大兔子大兔子 提交于 2019-12-03 10:13:28
I've an app with a today extension and a watch app. From the main app WCSession works fine and data is transferred to the watch and received correctly but when I try to send or receive data through the WCSession in the today widget the property paired and watchAppInstalled of the session are set to false so calling transferUserInfo: does nothing and session:didReceiveUserInfo: is never called. I know I can open the app using openURL and then send the new data but I want to do that without leaving Notification Center. Does anyone know a nice workaround for this problem? If the watch app is

Inconsistent Today Widget behavior breaks subview's height constraints

坚强是说给别人听的谎言 提交于 2019-12-02 04:58:04
问题 This question is related to another question I just posted on Stackoverflow: Layout Constraint Conflicts in Default Today Widget I added a Today Extension as a target to my app, removed the default "Hello World" label that's inside the widget's root view and added a plain UIView in its place. I gave the view a yellow color and pinned it to all edges of the root view - the same way the label was constrained. Then I added another constraint to the yellow view in order to give it a fixed height

Inconsistent Today Widget behavior breaks subview's height constraints

本小妞迷上赌 提交于 2019-12-02 00:45:48
This question is related to another question I just posted on Stackoverflow: Layout Constraint Conflicts in Default Today Widget I added a Today Extension as a target to my app, removed the default "Hello World" label that's inside the widget's root view and added a plain UIView in its place. I gave the view a yellow color and pinned it to all edges of the root view - the same way the label was constrained. Then I added another constraint to the yellow view in order to give it a fixed height of 100px. When I launch the app (tested on simulator and device) that height constraint is simply