-
Notifications
You must be signed in to change notification settings - Fork 12
/
PSSeeker.mm
59 lines (51 loc) · 2.25 KB
/
PSSeeker.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (c) 2021 udevs
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 3.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#import "PSSeeker.h"
@implementation PSSeeker
-(instancetype)init{
if ((self = [super init])){
_messagingCenter = [CPDistributedMessagingCenter centerNamed:PERSEUS_NYMPH_CENTER_IDENTIFIER];
rocketbootstrap_distributedmessagingcenter_apply(_messagingCenter);
}
return self;
}
-(NSDictionary *)getWisdom:(NSDictionary *)userInfo{
return [_messagingCenter sendMessageAndReceiveReplyName:@"getWisdom" userInfo:userInfo];
}
-(BOOL)sendVexillariusMessage:(NSString *)bundleIdentifier title:(NSString *)title subtitle:(NSString *)subtitle imageName:(NSString *)imageName timeout:(double)timeout option:(PSNymphBannerOption)option{
return [_messagingCenter sendMessageName:@"sendVexillariusMessage" userInfo:@{
@"bundleIdentifier" : bundleIdentifier ?: @"",
@"title" : title ?: @"Unlocked with Watch",
@"subtitle" : subtitle ?: @"Perseus",
@"imageName" : imageName ?: @"WatchSide",
@"timeout" : @(timeout ?: 2.0),
@"option" : @(option ?: PSNymphBannerOptionNone)
}];
}
-(BOOL)sendVexillariusMessageWithPid:(pid_t)pid title:(NSString *)title subtitle:(NSString *)subtitle imageName:(NSString *)imageName timeout:(double)timeout option:(PSNymphBannerOption)option{
return [_messagingCenter sendMessageName:@"sendVexillariusMessage" userInfo:@{
@"pid" : @(pid ?: -1),
@"title" : title ?: @"Unlocked with Watch",
@"subtitle" : subtitle ?: @"Perseus",
@"imageName" : imageName ?: @"WatchSide",
@"timeout" : @(timeout ?: 2.0),
@"option" : @(option ?: PSNymphBannerOptionNone)
}];
}
-(BOOL)pokeGizmo:(PSPokeGizmoType)pokeType{
return [_messagingCenter sendMessageName:@"pokeGizmo" userInfo:@{
@"pokeType" : @(pokeType)
}];
}
@end