MCPcopy Create free account
hub / github.com/NativeScript/firebase / deserialize

Function deserialize

packages/firebase-messaging-core/index.ios.ts:19–42  ·  view source on GitHub ↗
(data: any)

Source from the content-addressed store, hash-verified

17const onNotificationTapCallbacks: Set<(message: any, remoteMessage?: any) => void> = new Set();
18
19function deserialize(data: any): any {
20 if (data instanceof NSNull) {
21 return null;
22 }
23
24 if (data instanceof NSArray) {
25 let array = [];
26 for (let i = 0, n = data.count; i < n; i++) {
27 array[i] = deserialize(data.objectAtIndex(i));
28 }
29 return array;
30 }
31
32 if (data instanceof NSDictionary) {
33 let dict = {};
34 for (let i = 0, n = data.allKeys.count; i < n; i++) {
35 let key = data.allKeys.objectAtIndex(i);
36 dict[key] = deserialize(data.objectForKey(key));
37 }
38 return dict;
39 }
40
41 return data;
42}
43
44export class MessagingCore implements IMessagingCore {
45 _APNSToken;

Callers 2

_onMessageMethod · 0.70
_onNotificationTapMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected