Browse Source

Wrap check / requestNotifications to avoid mocking

Mathieu Acthernoene 5 years ago
parent
commit
8310b03822
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      src/index.ts

+ 9
- 2
src/index.ts View File

@@ -211,8 +211,15 @@ export async function request(
211 211
   return RESULTS.UNAVAILABLE;
212 212
 }
213 213
 
214
-export const checkNotifications = RNPermissions.checkNotifications;
215
-export const requestNotifications = RNPermissions.requestNotifications;
214
+export function checkNotifications(): Promise<NotificationsResponse> {
215
+  return RNPermissions.checkNotifications();
216
+}
217
+
218
+export function requestNotifications(
219
+  options: NotificationOption[],
220
+): Promise<NotificationsResponse> {
221
+  return RNPermissions.requestNotifications(options);
222
+}
216 223
 
217 224
 export default {
218 225
   PERMISSIONS,