Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring mergeWithDefaults Method to Return Defaults #170

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eugenedw
Copy link

When calling the printer.pick method, the APPPrinter.m class method fails since options are expected, but none are passed.

    NSMutableDictionary* settings = [arguments objectAtIndex:0];
    NSArray* bounds = [settings objectForKey:@"bounds"];

(the settings are "null" here).

The decorator associated with the typescript resource for the plugin doesn't allow options to be provided and, subsequently, the option merge returns undefined for the params:

params = this.mergeWithDefaults(params);

I've implemented a workaround so that the plugin.js "mergeWithDefaults" returns the defaults when none are passed or an empty object when an empty object is passed in, but this seems like a hack.

this method is returning undefined when attempting to perform printer pick(s). as a result, underlying iOS processes fail as the "pick" method requires options be passed (particularly "bounds").
Issues arose when attempting to perform "pick" requests since the latest version (Typescript) of the plugin doesn't provide a means of sending options.
configuring options merge return defaults on empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant