agilebits / onepassword-app-extension

1Password Extension for iOS Apps
2.58k stars 311 forks source link

Airmail is listed as provider #379

Closed alexanderjrobinson closed 7 years ago

alexanderjrobinson commented 7 years ago

Running the demo or in my own app Airmail is listed along with 1Password.

A screenshot is attached. I don't know if this is an issue with Airmail or something with the provider types that the extension filters on. Any suggestions would be appreciated. Here is the output from the console.

2017-07-05 16:32:34.790188-0400 App Demo for iOS[1042:540930] [MC] Reading from public effective user settings.
2017-07-05 16:32:34.839018-0400 App Demo for iOS[1042:540930] [MC] Filtering mail sheet accounts for bundle ID: com.agilebits.App-Demo-for-iOS, source account management: 1
2017-07-05 16:32:34.839587-0400 App Demo for iOS[1042:540930] [MC] Result: YES
2017-07-05 16:32:34.839623-0400 App Demo for iOS[1042:540930] [MC] Filtering mail sheet accounts for bundle ID: com.agilebits.App-Demo-for-iOS, source account management: 1
2017-07-05 16:32:34.840011-0400 App Demo for iOS[1042:540930] [MC] Result: YES

img_0205

gks commented 7 years ago

Hi @alexanderjrobinson !

It looks like maybe this is a potential bug on Airmail's side. If you look in the OnePasswordExtension.m you'll see at the top a series of "Available App Extension Actions." Note that each of those specifies a specific action that the 1Password App Extension can take (Find, Save, Change, and Fill). These are fairly generic using the "org.appextension" reverse domain so that other password manager applications can implement this as well, it's part of what we strived for with our app extension, making it a standard API that any other password manager could use to reduce duplication effort for developers to support multiple password managers.

Now if you look at the - (void)findLoginForURLString:(nonnull NSString *)URLString forViewController:(nonnull UIViewController *)viewController sender:(nullable id)sender completion:(nonnull OnePasswordLoginDictionaryCompletionBlock)completion method in the implementation file, which begins on line 50. On line 66 we specify one of those item types (and do so in other methods) so we tell the activity sheet what type of item is being interacted with.

This causes the app extension framework from Apple to show only items that say they support this type. It sounds like Airmail is saying they support one or more of our activity types. For further details see Declaring Supported Data Types for a Share or Action Extension from Apple. Notably the bit about the "registeredTypeIdentifiers" parts.

My suspicion here is that Airmail is somehow specifying that they handle one (or more) of our type identifiers. If you'd like I can get in touch with them and ask. For now I'm closing this issue but if you think I'm off the mark here we can certainly investigate further and I can try to create a proof of concept to demonstrate it.

Let me know if that helps or if you have any further questions.

alexanderjrobinson commented 7 years ago

I agree. Feel free to contact them. I will file a bug report with Airmail as well.

Thanks!