After running app, if i open the share extension in safari it's not working. But if i run on chrome,then open in safar it is working. Can you give me solution for running share extension in both browsers. In .plist i'm using this code.
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
<key>NSExtensionJavaScriptPreprocessingFile</key>
<string>DemoPreprocessor</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
This is mine.It works.
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>20</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>0</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
Related
Our apps Action Extension needs to support all types of attachments.
It works almost everywhere, the only case I can't get to work is when I try to share a PDF file opened in Safari. For example this one:
https://carlosicaza.com/swiftbooks/SwiftLanguage.pdf
The app is not even appearing on the Share Sheet in Safari, I think there must be something missing in the NSExtensionActivationRule in the info.plist of the Action Extension target.
This is what the NSExtensionActivationRule looks like at the moment. I tried several things but no luck so far.
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>ShareSheet</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
I have the following in my extension's plist
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsFileURLWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
So my extension shows up in Photos and Snapchat, but not Dropbox.
What should I tweak to get listed in dropbox share choices?
And the documentation for the missing key is/was here:
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/AppExtensionKeys.html#//apple_ref/doc/uid/TP40014212-SW11
I've try to add swift compiler custom flag in target through XCode Templates
Default
<key>Targets</key>
<array>
<dict>
<key>Configurations</key>
<dict>
<key>Debug</key>
<dict/>
<key>Release</key>
<dict/>
</dict>
<key>Name</key>
<string>___PACKAGENAME___</string>
<key>SharedSettings</key>
<dict>
<key>OTHER_SWIFT_FLAGS</key>
<array>
<key>Debug</key>
<string>-DDEBUG</string>
</array>
</dict>
</dict>
</array>
Template
I want to access only debug key. Is it possible?
You were almost there!
This is how the TemplateInfo.plist should look like
<key>Targets</key>
<array>
<dict>
<key>Configurations</key>
<dict>
<key>Debug</key>
<dict>
<key>OTHER_SWIFT_FLAGS</key>
<array>
<string>-DDEBUG</string>
</array>
</dict>
</dict>
</dict>
</array>
And here is the result
I'm about to make a settings for graphical stuff in a separate .plist. I have linked it from the Root.plist, but only the device only shows the group titles. Because i can't upload the images I paste the code here.
<plist version="1.0">
<dict>
<key>StringsTable</key>
<string>Graphics</string>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Background Settings</string>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Moving background</string>
<key>Identifier</key>
<string>moveEnabled</string>
<key>Default Value</key>
<true/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Display Nebulas</string>
<key>Identifier</key>
<string>nebulasEnabled</string>
<key>Default Value</key>
<true/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Display Stars</string>
<key>Identifier</key>
<string>starsEnabled</string>
<key>Default Value</key>
<true/>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Explosion Settings</string>
</dict>
</array>
</dict>
</plist>
This is the part, where only titles shows, and this is how I linked it:
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Graphic Settings</string>
<key>File</key>
<string>Graphics</string>
</dict>
Thanks for help.
make sure none of the elements in the PreferenceSpecifiers's array are missing a "required" key/value pair.
You can find Apple's reference for every shema element here.
I had the same issue, it worked for me!
My app started crashing mysteriously today, when running via Xcode. I tracked the problem to the settings not being available, and in fact, looking at the settings app for my app, I see:
Going to my Settings.bundle in Xcode, specifically Root.plist, I get this error message:
So, the file has been corrupted. Disturbing, but not too worrisome. I get a copy of the file from last night (thanks TimeMachine). I do a diff between that file and the one I have now, and I see no difference. I go back a few days until I find a version that is different. Unfortunately that was when I seriously revamped the root.plist file, so I can't find anything corrupted in the latest version.
Also, the app only crashes on a new iPhone where my app was never installed before. My other iPhones don't crash when running the same app via Xcode, but all show an empty Settings window as in the screenshot above. I think that maybe despite the corrupted root.plist, the actual NSUSerDefaults are still on the iPhones that at one point had a non-corrupt root.plist, but on the new iPhone there is no NSUSerDefaults, which leads to some bad things in my app.
Here is my plist content. Can you spot anything that is corrupted? Thanks. (I already checked SO: Empty Settings Bundle in Xcode 4.2 and it doesn't help.)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Initial Magnification</string>
<key>Values</key>
<array>
<integer>1</integer>
<integer>2</integer>
<integer>3</integer>
</array>
<key>Titles</key>
<array>
<string>1x</string>
<string>2x</string>
<string>3x</string>
</array>
<key>Key</key>
<string>LuminInitialMagnificationKey</string>
<key>DefaultValue</key>
<integer>2</integer>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Large Lock Button</string>
<key>Key</key>
<string>LuminLockButtonEmphasis</string>
<key>DefaultValue</key>
<true/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Picture-in-Picture Frame</string>
<key>Key</key>
<string>LuminOutlineEnabled</string>
<key>DefaultValue</key>
<true/>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Sound</string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>LuminFocusBeepKey</string>
<key>Title</key>
<string>Focus Beep</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Share Options</string>
</dict>
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Mail</string>
<key>File</key>
<string>EmailSettings</string>
</dict>
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Tweet</string>
<key>File</key>
<string>TweetSettings</string>
</dict>
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Facebook</string>
<key>File</key>
<string>FacebookSettings</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>History</string>
<key>FooterText</key>
<string>Tagged images will not be deleted. Dropbox mirroring is queued until WiFi connectivity is available.</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Delay Before Saving</string>
<key>Values</key>
<array>
<string>1</string>
<string>3</string>
<string>5</string>
<string>7</string>
</array>
<key>DefaultValue</key>
<string>3</string>
<key>Titles</key>
<array>
<string>1 second</string>
<string>3 seconds</string>
<string>5 seconds</string>
<string>7 seconds</string>
</array>
<key>Key</key>
<string>LuminTimeToWaitBeforeHistoryKey</string>
</dict>
<dict>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>Title</key>
<string>Number of Images to Keep</string>
<key>Key</key>
<string>LuminNumberOfHistoryFilesKey</string>
<key>DefaultValue</key>
<string>100</string>
<key>KeyboardType</key>
<string>NumberPad</string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>LuminDropboxActive</string>
<key>Title</key>
<string>Mirror to Dropbox</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>Lumin™ © 2011-2012 M. Zabetian & BitsOnTheGo.com. All rights reserved. Special Thanks to Tim Smith and AppliedDesign.tv.</string>
</dict>
<dict>
<key>Type</key>
<string>PSTitleValueSpecifier</string>
<key>DefaultValue</key>
<string>Unknown</string>
<key>Title</key>
<string>Version</string>
<key>Key</key>
<string>AppVersionStringKey</string>
</dict>
</array>
<key>StringsTable</key>
<string>Root</string>
</dict>
</plist>
I have resolved this. I replaced
Zabetian & BitsOnTheGo.com
with
Zabetian and BitsOnTheGo.com
I had to use another text editor as Xcode wouldn't open the file as it claimed it was corrupted. After replacing that ampersand, Xcode could open it and I could build and run my app and see the full Settings pane.
Not sure if this counts as a bug in Xcode or not. Depends whether it is legal to have "&" and characters like it in a settings plist. Not sure why it wouldn't be.