parse url for older extension

This commit is contained in:
Kyle Spearrin 2017-04-24 18:05:23 -04:00
parent 04f486b003
commit 83a89566ac

View file

@ -310,7 +310,7 @@ namespace Bit.iOS.Extension
} }
private bool ProcessItemProvider(NSItemProvider itemProvider, string type, Action<NSDictionary> dictAction, private bool ProcessItemProvider(NSItemProvider itemProvider, string type, Action<NSDictionary> dictAction,
Action<NSString> stringAction = null) Action<NSUrl> urlAction = null)
{ {
if(!itemProvider.HasItemConformingTo(type)) if(!itemProvider.HasItemConformingTo(type))
{ {
@ -327,14 +327,14 @@ namespace Bit.iOS.Extension
_context.ProviderType = type; _context.ProviderType = type;
var dict = list as NSDictionary; var dict = list as NSDictionary;
var str = list as NSString; var url = list as NSUrl;
if(dict != null && dictAction != null) if(dict != null && dictAction != null)
{ {
dictAction(dict); dictAction(dict);
} }
else if(str != null && stringAction != null) else if(url != null && urlAction != null)
{ {
stringAction(str); urlAction(url);
} }
else else
{ {
@ -407,11 +407,11 @@ namespace Bit.iOS.Extension
} }
_context.Details = DeserializeDictionary<PageDetails>(dict[Constants.AppExtensionWebViewPageDetails] as NSDictionary); _context.Details = DeserializeDictionary<PageDetails>(dict[Constants.AppExtensionWebViewPageDetails] as NSDictionary);
}, (urlString) => }, (url) =>
{ {
if(urlString != null) if(url != null)
{ {
_context.UrlString = urlString; _context.UrlString = url.AbsoluteString;
} }
}); });
} }