iOS 8 Today widget does not appear when running the project
Asked Answered
K

5

9

I have an app with 2 targets and added a today widget. When I run it it doesn't appear on the today notifications Edit/ in the "Do not include" section, where it normally appears the first time with my other apps. Any idea what could be going wrong? I get the entitlements missing warning for the extension but i get this for the ones that work too ( have tried adding one, doesn't help).

Also if i try attach it as a process under the debug menu, it does not appear there at all/

I have tried deleting app from simulator and resetting etc, I have tried with another app that has multiple targets as i thought this may be the problem but the other one works.

Anyone else have a similar experience or can suggest anything?

Edit 6 Oct 2014: I still haven't found a solution, but my project does not use arm64. Could this be the issue ? i have tried removing arm64 from other projects but I think Xcode 6 doesn't allow it so I can't test it, does anyone know if this is a possibility?

Karakoram answered 28/9, 2014 at 10:8 Comment(2)
I think that (lack of arm64) is the problem - can't remember where I read it though.Geldens
#26236833Harriman
P
33

In my case, the reason for the widget not being shown in the list of widget was a too high deployment target number. For the widget, I had 9.0. However, I downgraded my iPhone from 9.0 to 8.4 and forgot to change it for the widget.

After changing it to 8.4, the widget immediately appeared on the iPhone.

Property answered 31/7, 2015 at 15:52 Comment(1)
This was basically my issue as well, but with a twist. I had my main app set to a deployment target of 8.2 but the widget, by default, came in as 9.x (don't remember the minor version). Since I was testing in an 8.4 simulator, the widget did not appear. My point, is I assumed that the widget would take the same deployment target as the main app. It did not.Emmi
W
5

Make sure you're running the containing app not the extension in the simulator.

Wallasey answered 24/2, 2017 at 4:39 Comment(0)
E
4

I have seen this issue when there is a mismatch in the bundleID between the app and the extension.

Example (Correct):

App bundleid: com.yourcompany.myapp

Ext bundleid: com.yourcompany.myapp.myextension

The extension needs to have the entire bundleID of the app, followed by its own name.

Erde answered 9/11, 2014 at 6:12 Comment(0)
C
0

Make sure:

  1. "Deployment Target" is same to containing app's (@vomako 's answer);
  2. Bundle ID follows correct format: "com.yourcompany.myapp.myextension", while your containing app's is "com.yourcompany.myapp" (@RohitGupta 's answer);
  3. While debugging, you need to run widget/extension scheme (not containing app's scheme here. But if archive to submit to App Store, use containing app's scheme);
  4. "Build Settings"'s "WRAPPER_EXTENSION" is "appex".

Point 4 was not mentioned in all answers (even official doc), but happened in my case.

I created Today Widget for my existing project in a workspace, not works at all. However, when I create pure new project with Today Widget, it works well. Then I compare the Build Setting one by one and found this difference: The one created for my existing project is "app", not "appex".

After changing it to "appex", works.


Also, as tips, in order to pass App Review, you must:

  • Include the arm64 (iOS) or x86_64 architecture (MacOS) in widget/extension's Architectures build settings;
  • Specify “iPhone/iPad” (sometimes called universal) as the targeted device family for your app extension, no matter which targeted device family you choose for your containing app;
  • A containing app that links to an embedded framework must include the arm64 (iOS) or x86_64 (OS X) architecture build setting;
  • Always choose “Frameworks” as your Copy Files build phase destination (do not choose the “SharedFramework” destination instead).
Cytolysin answered 28/8, 2017 at 13:34 Comment(0)
K
0

In my case the Build phase "Embed App Extensions" of the app target was missing the appex file:

Missing appex file

Kamila answered 30/6, 2020 at 19:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.