SPIRIT-21 / cordova-plugin-1password

Plugin for adding 1Password App Extension into Cordova/PhoneGap Apps
MIT License
12 stars 4 forks source link

Whats the issues with iPads? #6

Open pke opened 7 years ago

pke commented 7 years ago

Why are they explicitly not supported?

RaphyFischer commented 7 years ago

Because, the AgileBits OnePassword extension on iOS needs a parameter "sender" on several methods like finLoginForUrlString. I didn't find any possible solution for this problem so the plugin will crash, when executed on a iPad.

pke commented 7 years ago

Can u not protect the calls so at least it wouldn't crash?

pke commented 7 years ago

I can't see any incompatibilities reported over at 1password about ipads. Have u tried their code on an ipad?

RaphyFischer commented 7 years ago

Hey there,

sorry for the long time not responding! If you look closely to the OnePasswordExtension.h file over at the repo of AgileBits you can see lines like these in the comments : " @param sender The sender which triggers the share sheet to show. UIButton, UIBarButtonItem or UIView. Can also be nil on iPhone, but not on iPad." This line can be found on several functions which read data from the OnePassword Extension. I have tried sending several objects but the extension kept crashing when I used it on an iPad. I can use from the Cordova Plugin scope. I also opened an issue over at the AgileBits repo but could not get an actual answer why this param is needed and for what it is being used.(see : https://github.com/AgileBits/onepassword-app-extension/issues/310) You are completly right I could implement an check for operation on an iPad so the Plugin will not crash but give an error message instead. Unfortunately I do not have any time to do so. I try to find time to implement this in a way, the plugin will run stable. I will let you know when I fixed this!

Kind regards Raphael

pke commented 7 years ago

The fix is actually pretty easy. You hand in the plugins webView. See https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Public/CDVPlugin.h#L57 Each Cordova plugin has access to its hosting webview.

RaphyFischer commented 7 years ago

Hey @pke

back when I tried to fix I think I tried using this parameter. Maybe there were some updates and it now works. I would appreciate if you could try this out. Like I said I do not have time to do so. Also I don't have an Mac and easy testing app laying around. If this soloutin works it would be awsome and you could start a pull request! :)

Thanks for your time!