use js key for browser provider

This commit is contained in:
Kyle Spearrin 2016-06-02 18:09:25 -04:00
parent 7ab247db01
commit 8c1ac478a2
1 changed files with 8 additions and 2 deletions

View File

@ -131,14 +131,20 @@ namespace Bit.iOS.Extension
private void Button_TouchUpInside(object sender, EventArgs e) private void Button_TouchUpInside(object sender, EventArgs e)
{ {
NSDictionary itemData = null; NSDictionary itemData = null;
if(ProviderType == UTType.PropertyList)
{
var fillScript = new FillScript(Details);
var scriptJson = JsonConvert.SerializeObject(fillScript, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
var scriptDict = new NSDictionary(AppExtensionWebViewPageFillScript, scriptJson);
itemData = new NSDictionary(NSJavaScriptExtension.FinalizeArgumentKey, scriptDict);
}
if(ProviderType == UTTypeAppExtensionFindLoginAction) if(ProviderType == UTTypeAppExtensionFindLoginAction)
{ {
itemData = new NSDictionary( itemData = new NSDictionary(
AppExtensionUsernameKey, "me@example.com", AppExtensionUsernameKey, "me@example.com",
AppExtensionPasswordKey, "mypassword"); AppExtensionPasswordKey, "mypassword");
} }
else if(ProviderType == UTType.PropertyList else if(ProviderType == UTTypeAppExtensionFillBrowserAction
|| ProviderType == UTTypeAppExtensionFillBrowserAction
|| ProviderType == UTTypeAppExtensionFillWebViewAction) || ProviderType == UTTypeAppExtensionFillWebViewAction)
{ {
var fillScript = new FillScript(Details); var fillScript = new FillScript(Details);