Skip to content

Commit be7a3e1

Browse files
authored
[patch] make handler for promptForPushNotificationsWithUserResponse required in index.d.ts
The original types suggest that the handler is optional. However, running `OneSignal.promptForPushNotificationsWithUserRespons()`(without providing a handler) results in an "Invariant Violation: A valid callback must be supplied" error. Seeing as all the other methods have their handlers as required, I figured the bug was with the types and not the actual implementation.
1 parent 7bf6cfa commit be7a3e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ declare module 'react-native-onesignal' {
166166
* @param {(response:boolean)=>void} handler
167167
* @returns void
168168
*/
169-
promptForPushNotificationsWithUserResponse(handler?: (response: boolean) => void): void;
169+
promptForPushNotificationsWithUserResponse(handler: (response: boolean) => void): void;
170170

171171
/**
172172
* Disable the push notification subscription to OneSignal.
@@ -393,4 +393,4 @@ declare module 'react-native-onesignal' {
393393
}
394394
const OneSignal: OneSignal;
395395
export default OneSignal;
396-
}
396+
}

0 commit comments

Comments
 (0)