Skip to content

Commit

Permalink
fix: add haptics
Browse files Browse the repository at this point in the history
  • Loading branch information
siandreev committed Dec 11, 2024
1 parent c8e06c4 commit 058fe68
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions apps/tablet/ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def capacitor_pods
pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera'
pod 'CapacitorClipboard', :path => '../../node_modules/@capacitor/clipboard'
pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device'
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications'
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
Expand Down
8 changes: 7 additions & 1 deletion apps/tablet/ios/App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ PODS:
- CapacitorCordova (6.2.0)
- CapacitorDevice (6.0.2):
- Capacitor
- CapacitorHaptics (6.0.2):
- Capacitor
- CapacitorPreferences (6.0.3):
- Capacitor
- CapacitorPushNotifications (6.0.3):
Expand Down Expand Up @@ -77,6 +79,7 @@ DEPENDENCIES:
- "CapacitorClipboard (from `../../node_modules/@capacitor/clipboard`)"
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
- "CapacitorDevice (from `../../node_modules/@capacitor/device`)"
- "CapacitorHaptics (from `../../node_modules/@capacitor/haptics`)"
- "CapacitorPreferences (from `../../node_modules/@capacitor/preferences`)"
- "CapacitorPushNotifications (from `../../node_modules/@capacitor/push-notifications`)"
- "CapacitorSplashScreen (from `../../node_modules/@capacitor/splash-screen`)"
Expand Down Expand Up @@ -106,6 +109,8 @@ EXTERNAL SOURCES:
:path: "../../node_modules/@capacitor/ios"
CapacitorDevice:
:path: "../../node_modules/@capacitor/device"
CapacitorHaptics:
:path: "../../node_modules/@capacitor/haptics"
CapacitorPreferences:
:path: "../../node_modules/@capacitor/preferences"
CapacitorPushNotifications:
Expand All @@ -120,6 +125,7 @@ SPEC CHECKSUMS:
CapacitorClipboard: 4443c3cdb7c77b1533dfe3ff0f9f7756aa8579df
CapacitorCordova: b33e7f4aa4ed105dd43283acdd940964374a87d9
CapacitorDevice: 9efd479d71d1baad74b75df531184c3f730eaa48
CapacitorHaptics: 4fc15afe22b123d093e6ace24d95e8e3b1f261b9
CapacitorPreferences: f3eadae2369ac3ab8e21743a2959145b0d1286a3
CapacitorPushNotifications: 9b178e010634d2f7bfca97b81478503463f86b6c
CapacitorSplashScreen: fd8bf1bf9081d9aa8817b7cd37d740d1bdaf2fb2
Expand All @@ -132,6 +138,6 @@ SPEC CHECKSUMS:
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47

PODFILE CHECKSUM: f9d707744c97cd8f502d129ac50e6f2a2abd9aca
PODFILE CHECKSUM: 909da498bd070920c1661b81df41f840cf5ecf80

COCOAPODS: 1.16.2
1 change: 1 addition & 0 deletions apps/tablet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@capacitor/clipboard": "^6.0.1",
"@capacitor/core": "latest",
"@capacitor/device": "^6.0.2",
"@capacitor/haptics": "^6.0.2",
"@capacitor/ios": "^6.1.2",
"@capacitor/preferences": "^6.0.2",
"@capacitor/push-notifications": "^6.0.3",
Expand Down
20 changes: 13 additions & 7 deletions apps/tablet/src/libs/appSdk.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import {
BaseApp,
CookieService,
IAppSdk,
KeychainPassword,
TouchId,
CookieService, NotificationService
NotificationService,
TouchId
} from "@tonkeeper/core/dist/AppSdk";
import packageJson from '../../package.json';
import { TabletStorage } from './storage';
import { Clipboard } from '@capacitor/clipboard';
import { getWindow } from './utils';
import packageJson from "../../package.json";
import { TabletStorage } from "./storage";
import { Clipboard } from "@capacitor/clipboard";
import { getWindow } from "./utils";
import { Biometric, SecureStorage } from "./plugins";
import { CapacitorCookies } from "@capacitor/core";
import { Device } from '@capacitor/device';
import { Device } from "@capacitor/device";
import { Haptics, NotificationType } from "@capacitor/haptics";

export class KeychainTablet implements KeychainPassword {
setPassword = async (publicKey: string, mnemonic: string) => {
Expand Down Expand Up @@ -79,6 +81,10 @@ export class TabletAppSdk extends BaseApp implements IAppSdk {
version = packageJson.version ?? 'Unknown';

targetEnv = TABLET_APPLICATION_ID;

hapticNotification = (type: 'success' | 'error') => {
return Haptics.notification({type: type === 'success' ? NotificationType.Success : NotificationType.Error});
};
}

export const getTabletOS = async ()=> {
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,15 @@ __metadata:
languageName: node
linkType: hard

"@capacitor/haptics@npm:^6.0.2":
version: 6.0.2
resolution: "@capacitor/haptics@npm:6.0.2"
peerDependencies:
"@capacitor/core": ^6.0.0
checksum: 10/986003d8327d914762f5c0a4f4b6e494654fa0c27344c2a1764f06d08895bce035d8105c0f2a571b8b8bd3bd2f72b08bdc2ad4e1167aa186632a7a16bb6118a2
languageName: node
linkType: hard

"@capacitor/ios@npm:^6.1.2":
version: 6.2.0
resolution: "@capacitor/ios@npm:6.2.0"
Expand Down Expand Up @@ -7521,6 +7530,7 @@ __metadata:
"@capacitor/clipboard": "npm:^6.0.1"
"@capacitor/core": "npm:latest"
"@capacitor/device": "npm:^6.0.2"
"@capacitor/haptics": "npm:^6.0.2"
"@capacitor/ios": "npm:^6.1.2"
"@capacitor/preferences": "npm:^6.0.2"
"@capacitor/push-notifications": "npm:^6.0.3"
Expand Down

0 comments on commit 058fe68

Please sign in to comment.