I have decided to remove a widget extension from my app. So this particular widget type is no longer supported. So I completely removed the extension from my project, including all the code and the respective target.
Installed Widgets Break After Update
When I now update my app with this new version, the old widgets are still there, but blank because they can't update anymore as there is no more widget extension or code to handle the updates.
Is there any way to
automatically remove all widgets of a given extension from the user's home screen or
at least declare the widget somehow as "deprecated" so the widget only displays a warning message that it's no longer supported?
The Best Thing I Could Come Up With
My emergency plan is to keep the extension in my app for a while, replace the existing widget UI with the warning text and set the supported widget families for this widget to an empty array. This should prevent the widget from appearing in the widget gallery. Then, a couple of months later, when 95% of my users have updated and hopefully read the warning, I can finally delete the widget extension. This is the best idea I could come up with, but it's far from ideal as it will still break for some users who haven't updated yet when I delete the extension.
So is there a robust way to remove a widget extension without breaking the widgets my users have already installed on their home screen?
After submitting a TSI, according to Apple: until now there is no clean way. Springboard is supposed to remove them, but there are still cases where it fails to do so. I submitted a bug report.
Related
I only see installs for my main app in the "App Analytics" section, but nothing regarding extensions like widgets. Where can I find that information?
It does not. You can use the WidgetCenter.shared.getCurrentConfigurations(_:) when your app is launched to get information about which widgets the user have added to their home screen.
You can then send this information to your analytics source of choice.
I've been having trouble understanding why my today widget isn't working after integrating the react-native-push-notification into my application. Has anyone experienced this problem? For example, I'm trying to display something as simple as: <Text>Hello World</Text> in my today widget. I followed the procedures to implement the widget in this article. https://medium.com/#jamesrochabrun/local-notifications-are-a-great-way-to-send-notifications-to-the-user-without-the-necessity-of-an-b3187e7176a3
I used zo0r/react-native-push-notification to implement local notification functionality.
Make sure the linked frameworks and libraries are the same for both the widget and the project in which it resides. Once I made them the same, the widget contained the react-native view.
I'm playing with XCode7 beta, trying to test the shiny new "Content Blocker Extension". The example class is adopting the same NSExtensionRequestHandling protocol as the (already known) Sharing extension. The essential difference from Sharing extension is that the class is a plain NSObject, not a *ViewController subclass because, you know, a Blocker Extension isn't supposed to be showing any UI feedback. That's my understanding at least. Anyway the crucial method beginRequestWithExtensionContext which is supposed to feed the blocker declaration JSON to the extension point, does not get invoked. The extension does have TRUEPREDICATE as its NSExtensionActivationRule and Safari does acknowledge the existence of my host app in the new Safari config "Content Blockers". But still no cigar.
Does anybody know if it's even supposed to be already working this early in the beta or was it just a press release?
And, oh, while we're at it, is there any documentation of that declarative JSON format or it's just my Google-Fu failing me? :)
How do you know the extension isn't getting invoked?
I built a very quick test app and did a simple NSLog() from the beginRequestWithExtensionContext method and it was getting called when the extension was switched on.
Also, fwiw, there's +[SFContentBlockerManager reloadContentBlockerWithIdentifier:completionHandler:] which lets you trigger an update from the main app, at will.
There isn't any documentation yet, but I found that some characters in the url prevent the load of the JSON
They are (the one I found, might be more): +(as prefix) , $, |, ^
Is there any documentation of that declarative JSON format
The webkit.org blog post below seems to be the current best "official" documentation of the Content Blocker JSON format.
https://www.webkit.org/blog/3476/content-blockers-first-look/
Use the device console to view a live log of the device. There you will see your NSLog() calls.
Choose Window -> Devices from the Xcode menu.
Choose the device in the left column.
Click the up-triangle at the bottom left of the right hand panel to show the device console.
By default, a today extension appears in the extension list for my app as soon as the app is installed.
What I'd like to know is - is there a way, documented or undocumented, that this can extension be enabled or disabled dynamically? By disabled, I mean that it won't even appear in the list of extensions if the user tries to add it.
Hacky answers are OK if necessary, I'd really like to be able to do this.
It doesn't look like it. The exact mechanism for populating that list is not documented, but it appears that if an app bundle contains a valid, properly signed today extension, that extension appears in the user's list.
To make it disappear then, you'd have to somehow rename or move the extension bundle, or break its code signature. That might be possible with a jailbroken device, but otherwise you can't modify the contents of your app bundle at run time.
My app contains a today widget. After installation of the app, the widget is not loaded by default. I must add it manually in edit area of Today widgets.
Is it possible to make the widget automatically appear after I install my app?
No unfortunately this is not possible.