MCPcopy Index your code
hub / github.com/callstack/agent-device / appendBroadcastExtra

Function appendBroadcastExtra

src/platforms/android/notifications.ts:43–64  ·  view source on GitHub ↗
(args: string[], key: string, value: unknown)

Source from the content-addressed store, hash-verified

41}
42
43function appendBroadcastExtra(args: string[], key: string, value: unknown): void {
44 if (typeof value === 'string') {
45 args.push('--es', key, value);
46 return;
47 }
48 if (typeof value === 'boolean') {
49 args.push('--ez', key, value ? 'true' : 'false');
50 return;
51 }
52 if (typeof value === 'number' && Number.isFinite(value)) {
53 if (Number.isInteger(value)) {
54 args.push('--ei', key, String(value));
55 return;
56 }
57 args.push('--ef', key, String(value));
58 return;
59 }
60 throw new AppError(
61 'INVALID_ARGS',
62 `Unsupported Android broadcast extra type for "${key}". Use string, boolean, or number.`,
63 );
64}

Callers 1

pushAndroidNotificationFunction · 0.85

Calls 2

pushMethod · 0.80
isFiniteMethod · 0.80

Tested by

no test coverage detected