Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ npx cap sync
### pinCheck()

```typescript
pinCheck() => Promise<{ value: string; }>
pinCheck() => Promise<{ value: boolean; }>
```

**Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
**Returns:** <code>Promise&lt;{ value: boolean; }&gt;</code>

--------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ public void pinCheck(PluginCall call) {
try {
KeyguardManager keyguardManager = (KeyguardManager) this.getContext().getSystemService(Context.KEYGUARD_SERVICE);
System.out.println(keyguardManager.isKeyguardSecure());
if (keyguardManager.isKeyguardSecure()) {
status = true;
} else {
status = false;
}
status = keyguardManager.isKeyguardSecure();
System.out.println(status);
JSObject ret = new JSObject();
ret.put("value", status);
Expand Down
2 changes: 1 addition & 1 deletion ios/Plugin/PinCheck.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

@objc public class PinCheck: NSObject {
@objc public func pinCheck(_ value: String) -> String {
@objc public func pinCheck(_ value: Bool) -> Bool {
print(value)
return value
}
Expand Down
2 changes: 1 addition & 1 deletion src/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface PinCheckPlugin {
pinCheck(): Promise<{ value: string }>
pinCheck(): Promise<{ value: boolean }>
}
4 changes: 2 additions & 2 deletions src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { WebPlugin } from '@capacitor/core';
import type { PinCheckPlugin } from './definitions';

export class PinCheckWeb extends WebPlugin implements PinCheckPlugin {
async pinCheck(): Promise<{ value: string }> {
async pinCheck(): Promise<{ value: boolean }> {
console.log('pin check not working on web');
return {
value : 'false'
value : false
}
}
}