11
votes

When I run my Today Extension on the simulator everything works fine and it displays the following as expected:

enter image description here

However when I run it on my devices (iPod touch and iPhone 5s) the body won't show (don't mind the title and icon, that was changed)

enter image description here

I attached the debugger to my extension and I got this:

enter image description here

I have no idea what all of this means...

I removed all code for the Today Extension to check if there was a problem with my code and nothing changed so I doubt theres a problem with my code. Any suggestions on how to fix this would be greatly appreciated.

(I do have app groups enabled if thats of any significance)

8
Hi, I'm having the same problem, where you able to find some solution? Thanksestemendoza
I got to the point that Xcode tells me that I have the executable signed with invalid entitlements. For this I changed the today extension's scheme and set "Ask on Launch" on Executable dropdown. Then execute extension on device and choose the first option that Xcode tells you.estemendoza
Hi @estemendoza I haven't found a solution yet however I will let you know if I do. I'm not entirely sure what you're saying in your second comment... Are you saying that your extension is working now or not?Jarryd Baillie
No, my extension it's not working. I made that comment only to supply a little bit more of my experience pointing that it might be an issue related with code signing. I checked the logs on the device and every time I used the extension, it generated a crash log, but I couldn't make any sense of it and then I found that issue of entitlements.estemendoza
@estemendoza oh ok, I haven't had that issue yet... have you got app groups enabled? if so make sure that the provisioning profile you're using supports the app group service. that might be the problem.Jarryd Baillie

8 Answers

12
votes

Make sure extension target version

Please make sure your extension target version is correct. Xcode'd give you the highest version by default such as 8.3, and if your iOS version is lower than it, Xcode'd give your a crash.

5
votes

I found out that I was accessing my app group with the wrong suitename. Just make sure you access the app group with "group.something.something" not just "something.something"

4
votes

I found the solution for my case. I just had to specify arm64 as valid architecture for the widget target.

On the Widget Target

Build Settings > Valid Architectures

I was having just armv7 and armv7s. I added arm64 and it worked like charm in my 5s device

1
votes

Few points to remember while using app extensions

  • Bundle Identifier for the target extension should be com.companyName.AppName.ExtensionName

  • You need to have separate AppID for the target extension, with identifier specified as com.companyName.AppName.ExtensionName and create provisioning profile with this AppID.

  • Also, the appGroupID created should be embedded in both the AppIDs(for application as well as extension).

0
votes

Since you didn't share any piece of code, I cannot help you with a specific answer. Please try to debug your widget by using following steps Debug->Attach to Process->(select your widget from the menu) and debug your viewdidload viewwillappear and - (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler methods. Hope it helps.

0
votes

The sources of my problems:

  • on simulator viewDidLoad was called each time, on the device the view is loaded once and only viewWillAppear is called.
  • the widget does not receive core data changes notifications
  • do not call NCWidgetController.widgetController().setHasContent from widgetPerformUpdateWithCompletionHandler. The best place to use it (mostly) is your containing app, not the widget itself.

hope this helps someone

0
votes

In my case I set preferred content size and it is starting working on device

self.preferredContentSize = CGSizeMake(UIScreen.mainScreen().nativeBounds.width, 100.0)

0
votes

I had an issue using custom ViewController in my Share Extension. It turns out that the resources are limited in Extension mini-apps, so when my Extension was generating thumbnails, it crashed the extension because too many background threads were being used. Reducing thumbnail generation to a single one at a time fixed the issue.

The confusing part was that this limitation was not seen in Simulator, only on a real device.