-
Notifications
You must be signed in to change notification settings - Fork 407
Closed
Description
ApnsPayload is typed as:
export interface ApnsPayload {
/**
* The `aps` dictionary to be included in the message.
*/
aps: Aps;
[customData: string]: object;
}However, that prevents from passing string values as custom data.
Note that according to Apple
Your custom keys must have values with primitive types, such as dictionary, array, string, number, or Boolean. Custom keys are available in the userInfo dictionary of the UNNotificationContent object delivered to your app.
So I think the correct types should be something like either:
[customData: string]: any;or
[customData: string]: JSON;
interface JSON {
[x: string]: string|number|boolean|Date|JSON|JSONArray;
}
interface JsonArray extends Array<string|number|boolean|Date|JSON|JSONArray> { }