Closed Bug 1228596 Opened 9 years ago Closed 9 years ago

Share actions not showing up in the Share menu.

Categories

(Firefox for iOS :: Browser, defect)

All
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios 1.4+ ---

People

(Reporter: jhugman, Assigned: jhugman)

Details

Attachments

(1 file)

"I noticed that none of our actions are available from within Firefox itself. They all show up in other apps, like Safari but in Firefox the three share options are gone.

Other share extensions, like Twitter, are also not shown anymore.

Works in 1.2 but not in 1.3. Most likely related to 1Password and the type of items we share out?

Can you open a bug for this and investigate please? Needs to be fixed otherwise we cannot ship this for 1.3. It is too big of a regression"
Twitter not showing up in master or v1.x.

Suspect the Info.plist in Client, ShareTo and SendTo. Checking…
Reverting the Info.plist changes hasn't changed anything. 

Not using the UIActivityItemSource as an activityItem does cause the problem to change; but does disable the feature.
Adding in logging for hitting the share menu button:

activityViewControllerPlaceholderItem is https://en.m.wikipedia.org/wiki/Main_Page
dataTypeIdentifierForActivityType nil

Selecting a menu option:

itemForActivityType com.apple.UIKit.activity.Print

This method gets called when the share menu is about to be displayed, but activityType is always nil.

     func activityViewController(activityViewController: UIActivityViewController, dataTypeIdentifierForActivityType activityType: String?) -> String {
        // Because of our UTI declaration, this UTI now satisfies both the 1Password Extension and the usual NSURL for Share extensions.
        print("dataTypeIdentifierForActivityType \(activityType)")
        return "org.appextension.fill-browser-action"
    }
Reading more about NSActivationRule, I'm still suspicious of ours in Info.plist.

Changing:

SUBQUERY ( 
	extensionItems, 
	$extensionItem, 
		SUBQUERY ( 
			$extensionItem.attachments, 
			$attachment,
			ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url"
		).@count == 1 
).@count == 1

to:

SUBQUERY (
	extensionItems,
	$extensionItem,
	SUBQUERY (
		$extensionItem.attachments,
		$attachment,
		(
			ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf"
			|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url"
			|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.file-url"
			|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.plain-text"
		)
	).@count == $extensionItem.attachments.@count
).@count == 1

in SendTo/Info.plist makes our extension show up. Still no twitter though.
The ShareTo/Info.plist and SendTo/Info.plist NSActivationRules are for extensions to select which applications an extension can open in.

> NSExtensionActivationRules should only need to match a single activity item for a share extension to be displayed
> http://openradar.appspot.com/radar?id=5616559737274368

Adding the ShareExtensionHelper (a UIActivityItemSource) into the items array means that extensions no longer match all items.

Checking how we might make the items array only have one item in.
Attached file Pull request
Fix provided by rad@agilebits.com
Attachment #8693541 - Flags: review?(sarentz)
Needs uplift, once landed.
Comment on attachment 8693541 [details] [review]
Pull request

LGTM
Attachment #8693541 - Flags: review?(sarentz) → review+
Whiteboard: [needsuplift]
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Assignee: nobody → jhugman
Whiteboard: [needsuplift]
This either made 1.4 or 1.3.
Hardware: Other → All
Target Milestone: --- → 1.4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: