iOS Google drive "Send a copy" not showing app extension - ios

I have setup NSExtensionActivationRule for audio, video, pdf and so on. I am able to see my app extension in photo app, files app and safari browser. but in case of Google drive, if i choose "Send a copy" , my app extension is not shown in that for the file types mentioned above. Can I know what activation rule can make my app visible in google drive as well?

Although it is an experience-based talk, instead of defining conditions that can be shared by plist, it is necessary to define sharing conditions in detail
The explanation is also written in Apple's official document below.
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/AppExtensionKeys.html#//apple_ref/doc/uid/TP40014212-SW36
You can create a custom subquery as described in the document below.
https://developer.apple.com/jp/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html
Try it with subquery.
It is troublesome to create once. You can do something. When trying with "TRUEPREDICATE", the application which is not displayed is displayed. If you use this to change to subquery's method, it should be displayed!
(It seems that this setting can not be used at the time of release, so it is necessary to change it when creating subquery)
Even when changing the search keyword to subquery, it remained in StackOverFlow.
Question about subquery
iOS Share Extension with custom SUBQUERY for NSExtensionActivationRule
Knowledge of predicate grammar is necessary to create subquery.
It is embarrassing what I made. This solved it.

Related

How to modify a ShareViewController so that choosing an app in the share sheet results in saving media and launching the selected app?

The ability to import media files from various apps (like Photos, Files, WhatsApp) to an app I am building (referred to as "My App" from hereon) using a share button is what I am seeking to achieve.
The user interaction process should be as follows:
Step 1: Select media file from any app
Step 2: tap share button which should list "My App" among others
So far, I have been able to get my app listed on the sharesheet sorted based on this article. I have also looked at this post that makes use of SLComposeServiceViewController which caters to the more of a social media like popup from a sharesheet. Neither of these have helped reach a solution.
However, I am unable to achieve my desired outcome from user action of selecting "My App" from the sharesheet, which is:
a. have selected media copied into a directory accessible to "My App"; and
b. launch "My App" in the View that shows the contents of this directory. (As the capitalisation of View demonstrates, I am writing "My App" in SwiftUI.)
Working through the aforementioned tutorial, I was unable to figure out how to achieve the described outcome; this might have to with my quite limited experience of to manipulating UIViewControllers, which I have managed to avoid so far with SwiftUI.
Any guidance on this matter would be highly appreciated.
For those looking for a pure SwiftUI and code-only approach way of solving the problem of importing media/data into your app, the most straightforward solution I found was to use .fileImporter in a View. An excellent explanation and example code is available here. The only drawback is that your app is not on the sharesheet but that is okay, in my opinion/use case.
The beauty of this solution is that:
It is code only and doesn't require you to mess around with the info.plist file to define the UTI as per this tutorial
better yet, you do not deal with the Share Extensions and the corresponding ShareViewController, which is no fun to figure out for a purely SwiftUI-based developer.

How do I export text from iOS Notes app to my app?

I know this is possible and is something many big apps do, but I can't figure out among UTIs, extensions, UIActivityTypes, etc. which spell I need to use for this in particular. I'm trying to add my app to the list of apps that appear when you hit the export button in the Notes app on iOS because I want to be able to take a bunch of text inside a note and repeatedly and safely send it into my app.
I want my app to appear in this list, exporting directly from Notes. There appear to be duplicates of this question that are very old claiming that "exporting from Notes app is not possible for third party apps", but I think they're either now wrong or answering a different question because as you can see in the above screenshot, Messenger is plainly able to do this.
It does not look like registering UTIs gets this done for me. I went ahead and registered my app to all sorts of UTIs, but all that happens is my app ends up in popups like this one, which appears when trying to open a txt file, which is not what I'm looking for. Unless there is some other UTI that does not conform to public.data or public.content which I need to be using, in which case I'd be happy to hear it.
I used one of my allotted support requests to ask Apple, and after some time and back and forth I was able to get my answer! Here is what they said:
Your project is missing a Share app extension. Start by reviewing the
App Extension Programming Guide:
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/index.html#//apple_ref/doc/uid/TP40014214-CH20-SW1
Information specific to the Share extension point:
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Share.html#//apple_ref/doc/uid/TP40014214-CH12-SW1
You don’t need to register the text content type in your
CFBundleDocumentTypes. as you’ve done in your sample. However, you
will need to provide an activation rule for the extension point, such
as the one shown in this section of the document (the section titled
Declaring Supported Data Types for a Share or Action Extension):
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW1
See specifically the predicate example that activates the extension if
an attachment with the com.adobe.pdf UTI is present. You will need to
do something similar, to cover the UTIs for content you would like
your share extension to consume. As a starting point, you can consume
text with the public.text UTI. For more common UTIs, please see this
document:
https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1
I also found the bits about providing an activation rule to be super confusing, and this answer helped that: How do I set NSExtensionActivationRule predicates?

Google Contacts Dir in Google Sites

I am currently making a Google Site where I would like to embed my contacts. The contacts I am referring to can be found if I log into my gmail account and click on ->Mail->Contacts on the upper left hand corner. Then, on the next page, I click the "Other Contacts" link.
I have tried using a google spreadsheet to read in this data and then displaying that in the Google Site. However, I ran into a few issues. I tried the IMPORTHTML("https://mail.google.com/mail/u/0/#contacts/group/26ae/Other+Contacts","table",1). This didn't return anything. I tried to change the second parameter to 'list' and for the third parameter, I went up to 30 so I doubt that is the issue.
I also tried this approach but no luck. https://www.import.io/post/how-to-get-live-web-data-into-a-spreadsheet-without-ever-leaving-excel/
What would be the best way to resolve this issue of getting those contacts to show up in my site?
I see three options:
Export your contacts to a CSV and import that into a sheet. The downside is that this is not syncing, it is a static update, so maintaining contacts can be problematic.
Use this addon. I have never used it and can offer no advice either way. I believe your domain Admin will need to set it up and I do not think it populates a spreadsheet, so you won't be able to embed your contacts.
Write a custom Google Apps Script. The benefit here is you could use a script to also display the contacts in a clean fashion, with the name as a link, or otherwise. The downside here is you need to write a script. It is javascript based so if you have someone who can do that, it may be your best option. I have done this for a staff directory, which lists all of our domain accounts:

Is Share Extension appropriate for my case?

I must do the following:
a user chooses a photo using the share functionality in the Photos app;
just like, eg., WhatsApp, the photo "reaches" the app;
the app does something with the photo;
The photo must NOT be uploaded instantly: it must receive the photo and store it (then, IF the user wants, he can upload the photo).
I was thinking to use Share Extensions when I red the following:
Make sure that the Share extension point is appropriate for your purpose. The best Share extensions make it easy for users to share content with websites. If you want to create an extension that lets users perform a different task with their content or that gives users updates on information they care about, the Share extension point is not the right choice.
(source: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Share.html#//apple_ref/doc/uid/TP40014214-CH12-SW1)
Problem is, now, I don't know anymore if Share Extensions can do what I need to do. Moreover, any online tutorial (and the original docs too) talks about a Share Extension Template that must have been removed from XCode 8.1 (I see everywhere screenshots of a template I can't use).
The Share Extension was what I needed: it's absolutely up to you what to do with the file you are sharing. That is: you can freely create an App Group and store it to send it at a later time, no need for an instant upload. Moreover, you can change the appearance of the controls and perform validation of your content. So, in a smaller number of cases, share extension can be used with a slightly different purpose than intended.

Quickly browse localized app store descriptions in other languages and/or countries?

As I am writing and translating localized app store descriptions for my app, I thought it would be handy to read other same-category apps' localized descriptions. However this has become more complicated than I had hoped (e.g., don't really want to change my Mac's language setting on top of my iTunes store country preference). Plus I have had limited success doing this on with OS X and iOS.
Can someone suggest a quick and easy way to look at app store descriptions in another language? I am sure I am missing something obvious here, for example currently I am poking around App Annie to see if it has archived localized descriptions.
Yes, there is a solution. You can use the urls that Apple provides and read the app description from there:
Head over to http://linkmaker.itunes.apple.com/ and you will see that there you can select a country.
For example, searching for "Twitter" in iOS apps and US you get (after removing the trailing url garbage):
https://itunes.apple.com/us/app/twitter/id333903271?mt=8
Now just change the country code. E.g., German and Italian:
https://itunes.apple.com/de/app/twitter/id333903271?mt=8
https://itunes.apple.com/it/app/twitter/id333903271?mt=8
The best way is to modify URL and view it in browser.
If you open an app using URL:
itunes.apple.com/app/APP_NAME/ID
(for example: https://itunes.apple.com/app/zuko-monsters/id545619234?mt=8)
you can just add country code after first part:
itunes.apple.com/de/app/APP_NAME/ID
itunes.apple.com/us/app/APP_NAME/ID
(for example: https://itunes.apple.com/de/app/zuko-monsters/id545619234?mt=8)

Resources