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

Add QR method #1

Open
jalmirante opened this issue Jun 25, 2023 · 0 comments
Open

Add QR method #1

jalmirante opened this issue Jun 25, 2023 · 0 comments

Comments

@jalmirante
Copy link

Good evening, I was able to add the qr method manually, at least it works for me.

I would appreciate it if you could incorporate this method into the plugin accordingly as it is very useful.

Thanks in advance for the plugin that works excellent and is very useful.

File: SunmiPlugin.java

@PluginMethod(returnType = PluginMethod.RETURN_NONE)
public void qr(PluginCall call) throws RemoteException {
if (mPrinterService != null) {
String data = call.getString("data");
int size = call.getInt("size");
int errorlevel = call.getInt("errorlevel");

        mPrinterService.printQRCode(data, size, errorlevel, null);
    }
}

File: definitions.ts

qr(options: {
data: string;
size: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
errorlevel: 0 | 1 | 2 | 3;
}): void;

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

No branches or pull requests

1 participant