-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathapi.txt
67 lines (53 loc) · 1.05 KB
/
api.txt
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
60
61
62
63
64
65
66
67
Websocket API Protocol
=== Objects ===
"""
ObjectName {
requiredProp: type
optionalProp: type?
}
"""
Location {
lat: float,
lon: float,
geohash: string? (generated if not provided)
}
Message {
author: string,
content: {
text?: string,
attachment?: string,
},
location: Location,
replyTo?: string,
reactions: {
[key: string]: int,
}
}
UserProfile {
displayName: string,
profilePicture: int,
}
===
=== Client -> Server Methods ===
"""
methodName(
arguments / inputs...
) ack -> ackResponse
"""
// Must be called at least once before calling any other methods
updateLocation(
location: Location
ack: func?
) ack -> "success"
sendMessage(
message: Message
ack: func?
) ack -> "success"
getNearbyUsers(
callback: func(nearbyUserUids: { [uid: string]: UserProfile }) -> _,
) callback -> map of nearby user uids to user profiles
// Call after the client has already updated their profile document in firestore
notifyUpdateProfile(
ack: func?
) ack -> "success"
===