-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclusively use inferred type identifiers #52
Exclusively use inferred type identifiers #52
Conversation
This definitely won't work. Passing in the type identifier is necessary in a number of cases, including:
The only changes you need to make in order to satisfy #49 are:
All of the other changes in a4ce4c6 should be reverted in order to not break existing functionality. |
Not explicitly true. Sharing a GIF to the Message activity works just fine with no type specified
Not true. I’m unable to successfully provide GIF data to the Message activity so long as I am returning
Yeah this is true. We could get rid of those initializers...? |
Can you give me a quick code sample of how you're using XExtensionItemSource to share your GIF data that doesn't work when I'm very concerned about removing type identifiers - even if iOS is able to automatically determine the type of data in cases like GIFs, this certainly won't work for all files (and even if it works for Messages, does it work for general share extensions)? |
I implemented my proposal here and sharing GIFs via Messages works great using something like Any more details on what's going wrong in your case? |
In my case I’m not providing |
I see. I can confirm that behavior too - if you tell it you're giving it a kUTTypeURL, Messages won't successfully attach an animated GIF from an NSData object. You can work around it simply by writing the GIF to a file and returning the file URL as the activity item. Though it'd be nice to be able to attach NSData rather than a URL, I really don't think this outweighs the lost functionality if we removed the other stuff. Thoughts? |
Related: #49
We should be able to lazily provide items that don’t match the placeholder’s type, in order to e.g. provide a GIF if the message activity is selected. This requires using our function to calculate the item’s type rather than the type identifier that was provided when the item source was initialized.
The only other place where
self.typeIdentifier
was being used was in theUIActivityItemSource
protocol’sactivityViewController:dataTypeIdentifierForActivityType:
method, but that seemed to be causing a problem due to the mismatch. I’ve removed it and everything seems to work fine.Totally possible that I’m overlooking something here – please take a look through and let me know if you think this is necessary for some reason.