Skip to content

Commit 82905db

Browse files
committed
chore: update readme
1 parent 1ec4276 commit 82905db

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: README.md

+22
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,28 @@ npm install react-native-key-command
1515

1616
`cd ios && pod install`
1717

18+
Changes required in your `AppDelegate.m`
19+
20+
```
21+
// add library imports in the top of your file
22+
#import <HardwareShortcuts.h>
23+
24+
@implementation AppDelegate
25+
26+
..
27+
28+
// Add keyCommands and handleKeyCommand methods in AppDelegate class
29+
- (NSArray *)keyCommands {
30+
return [HardwareShortcuts sharedInstance].keyCommands;
31+
}
32+
33+
- (void)handleKeyCommand:(UIKeyCommand *)keyCommand {
34+
[[HardwareShortcuts sharedInstance] handleKeyCommand:keyCommand];
35+
}
36+
37+
@end
38+
```
39+
1840
## Android
1941

2042
Changes required in your `MainActivity.java`

0 commit comments

Comments
 (0)