{"id":18782869,"url":"https://github.com/rescript-react-native/push-notification-ios","last_synced_at":"2025-04-13T12:08:51.225Z","repository":{"id":40724337,"uuid":"236776228","full_name":"rescript-react-native/push-notification-ios","owner":"rescript-react-native","description":"ReScript bindings for @react-native-community/react-native-push-notification-ios","archived":false,"fork":false,"pushed_at":"2023-05-07T21:11:57.000Z","size":255,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-13T12:08:44.149Z","etag":null,"topics":["notification-ios","push-notifications","react","react-native","rescript","rescript-react","rescript-react-native"],"latest_commit_sha":null,"homepage":"","language":"ReScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rescript-react-native.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-01-28T16:04:11.000Z","updated_at":"2024-11-05T00:20:26.000Z","dependencies_parsed_at":"2023-07-18T14:30:39.442Z","dependency_job_id":null,"html_url":"https://github.com/rescript-react-native/push-notification-ios","commit_stats":{"total_commits":38,"total_committers":6,"mean_commits":6.333333333333333,"dds":0.3157894736842105,"last_synced_commit":"7daf5de84e911ecc319070f5b44e8ea1f61f7ec3"},"previous_names":["reason-react-native/push-notification-ios"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fpush-notification-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fpush-notification-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fpush-notification-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fpush-notification-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rescript-react-native","download_url":"https://codeload.github.com/rescript-react-native/push-notification-ios/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710431,"owners_count":21149190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["notification-ios","push-notifications","react","react-native","rescript","rescript-react","rescript-react-native"],"created_at":"2024-11-07T20:37:19.964Z","updated_at":"2025-04-13T12:08:51.199Z","avatar_url":"https://github.com/rescript-react-native.png","language":"ReScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@rescript-react-native/push-notification-ios`\n\n[![Build Status](https://github.com/rescript-react-native/push-notification-ios/workflows/Build/badge.svg)](https://github.com/rescript-react-native/push-notification-ios/actions)\n[![Version](https://img.shields.io/npm/v/@rescript-react-native/push-notification-ios.svg)](https://www.npmjs.com/@rescript-react-native/push-notification-ios)\n[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f\u0026label=ReScript%20Forum\u0026server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)\n\n[ReScript](https://rescript-lang.org) bindings for\n[`@react-native-community/react-native-push-notification-ios`](https://github.com/react-native-push-notification-ios/push-notification-ios).\n\nExposed as `ReactNativePushNotificationIOS` module.\n\n`@rescript-react-native/push-notification-ios` X.y.\\* means it's compatible with\n`@react-native-community/react-native-push-notification-ios` X.y.\\*\n\n## Installation\n\nWhen\n[`@react-native-community/react-native-push-notification-ios`](https://github.com/react-native-push-notification-ios/push-notification-ios)\nis properly installed \u0026 configured by following their installation instructions,\nyou can install the bindings:\n\n```console\nnpm install @rescript-react-native/push-notification-ios\n# or\nyarn add @rescript-react-native/push-notification-ios\n```\n\n`@rescript-react-native/push-notification-ios` should be added to\n`bs-dependencies` in your `bsconfig.json`:\n\n```diff\n{\n  //...\n  \"bs-dependencies\": [\n    \"@rescript/react\",\n    \"rescript-react-native\",\n    // ...\n+    \"@rescript-react-native/push-notification-ios\"\n  ],\n  //...\n}\n```\n\n## Usage\n\n### Types\n\n#### `ReactNativePushNotificationIOS.Notification.t`\n\n```rescript\n  type t; // abstract type\n```\n\n#### `ReactNativePushNotificationIOS.localNotification`\n\n```rescript\ntype localNotification;\n\n[@bs.obj]\nexternal localNotification:\n  (\n    ~alertBody: string=?,\n    ~alertTitle: string=?,\n    ~alertAction: string=?,\n    ~soundName: string=?,\n    ~isSilent: bool=?,\n    ~category: string=?,\n    ~userInfo: Js.Json.t=?,\n    ~applicationIconBadgeNumber: int=?,\n    ~fireDate: Js.Date.t=?,\n    ~repeatInterval: [@bs.string] [\n                       | `minute\n                       | `hour\n                       | `day\n                       | `week\n                       | `month\n                       | `year\n                     ]\n                       =?,\n    unit\n  ) =\u003e\n  localNotification =\n  \"\";\n```\n\n#### `ReactNativePushNotificationIOS.deliveredNotification`\n\n```rescript\ntype deliveredNotification = {\n  identifier: string\n  date: option(string)\n  title: option(string)\n  body: option(string)\n  category: option(string)\n  threadId: option(string)\n  userInfo: option(Js.Json.t),\n};\n```\n\n#### `ReactNativePushNotificationIOS.formattedLocalNotification`\n\n```rescript\ntype formattedLocalNotification = {\n  fireDate: option(string),\n  alertAction: option(string),\n  alertTitle: option(string),\n  alertBody: option(string),\n  applicationIconBadgeNumber: option(int),\n  category: option(string),\n  repeatInterval: option(string),\n  soundName: option(string),\n  userInfo: option(Js.Json.t),\n};\n```\n\n#### `ReactNativePushNotificationIOS.registrationError`\n\n```rescript\ntype registrationError('a) = {\n  message: string,\n  code: int,\n  details: Js.t('a),\n};\n```\n\n#### `ReactNativePushNotificationIOS.permissions`\n\n```rescript\ntype permissions = {\n  alert: bool,\n  badge: bool,\n  sound: bool,\n  lockScreen: bool,\n  notificationCenter: bool,\n};\n```\n\n#### `ReactNativePushNotificationIOS.requestPermissionsOptions`\n\n```rescript\ntype requestPermissionsOptions;\n[@bs.obj]\nexternal requestPermissionsOptions:\n  (~alert: bool=?, ~badge: bool=?, ~sound: bool=?, unit) =\u003e\n  requestPermissionsOptions =\n  \"\";\n```\n\n#### `ReactNativePushNotificationIOS.fetchResult`\n\n```rescript\ntype fetchResult;\n[@bs.obj]\nexternal fetchResult:\n  (~_NewData: string=?, ~_NoData: string=?, ~_ResultFailed: string=?, unit) =\u003e\n  fetchResult =\n  \"\";\n```\n\n### Methods\n\n#### `ReactNativePushNotificationIOS.Notification.getAlert`\n\n```rescript\nNotification.t =\u003e option(Js.Json.t)\n```\n\n#### `ReactNativePushNotificationIOS.Notification.getTitle`\n\n```rescript\nNotification.t =\u003e option(string)\n```\n\n#### `ReactNativePushNotificationIOS.Notification.getMessage`\n\n```rescript\nNotification.t =\u003e option(Js.Json.t)\n```\n\n#### `ReactNativePushNotificationIOS.Notification.getSound`\n\n```rescript\nNotification.t =\u003e option(string)\n```\n\n#### `ReactNativePushNotificationIOS.Notification.getCategory`\n\n```rescript\nNotification.t =\u003e option(string)\n```\n\n#### `ReactNativePushNotificationIOS.Notification.getContentAvailable`\n\n```rescript\nNotification.t =\u003e bool\n```\n\n#### `ReactNativePushNotificationIOS.Notification.getBadgeCount`\n\n```rescript\nNotification.t =\u003e option(int)\n```\n\n#### `ReactNativePushNotificationIOS.Notification.getData`\n\n```rescript\nNotification.t =\u003e option(Js.Json.t)\n```\n\n#### `ReactNativePushNotificationIOS.Notification.getThreadID`\n\n```rescript\nNotification.t =\u003e option(string)\n```\n\n#### `ReactNativePushNotificationIOS.presentLocalNotification`\n\n```rescript\nlocalNotification =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.scheduleLocalNotification`\n\n```rescript\nlocalNotification =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.cancelAllLocalNotifications`\n\n```rescript\nunit =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.removeAllDeliveredNotifications`\n\n```rescript\nunit =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.getDeliveredNotifications`\n\n```rescript\n(array(deliveredNotification) =\u003e unit)\n```\n\n#### `ReactNativePushNotificationIOS.removeDeliveredNotifications`\n\n```rescript\n(~identifiers: array(string)) =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.setApplicationIconBadgeNumber`\n\n```rescript\nint =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.getApplicationIconBadgeNumber`\n\n```rescript\n(int =\u003e unit) =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.cancelLocalNotifications`\n\n```rescript\nunit =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.cancelLocalNotificationsWithUserInfo`\n\n```rescript\nJs.Json.t =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.getScheduledLocalNotifications`\n\n```rescript\n(array(formattedLocalNotification) =\u003e unit) =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.addEventListener`\n\n```rescript\n  (\n  [@bs.string]\n  [\n    | `notification(Notification.t =\u003e unit)\n    | `localNotification(Notification.t =\u003e unit)\n    | `register((~deviceToken: string) =\u003e unit)\n    | `registrationError(registrationError('a) =\u003e unit)\n  ]\n  ) =\u003e\n  unit\n```\n\n#### `ReactNativePushNotificationIOS.removeEventListener`\n\n```rescript\n(\n  [@bs.string]\n  [\n    | `notification(Notification.t =\u003e unit)\n    | `localNotification(Notification.t =\u003e unit)\n    | `register((~deviceToken: string) =\u003e unit)\n    | `registrationError(registrationError('a) =\u003e unit)\n  ]\n  ) =\u003e\n  unit\n```\n\n#### `ReactNativePushNotificationIOS.requestPermissions`\n\n```rescript\nunit =\u003e Js.Promise.t(permissions)\n```\n\n#### `ReactNativePushNotificationIOS.requestPermissionsWithOptions`\n\n```rescript\nrequestPermissionsOptions =\u003e Js.Promise.t(permissions)\n```\n\n#### `ReactNativePushNotificationIOS.abandonPermissions`\n\n```rescript\nunit =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.checkPermissions`\n\n```rescript\n(unit =\u003e permissions) =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.finish`\n\n```rescript\nfetchResult =\u003e unit\n```\n\n#### `ReactNativePushNotificationIOS.getInitialNotification`\n\n```rescript\nunit =\u003e Js.Promise.t(Js.Nullable.t(Notification.t))\n```\n\n## Changelog\n\nCheck the [changelog](./CHANGELOG.md) for more informations about recent\nreleases.\n\n---\n\n## Contribute\n\nRead the\n[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)\nbefore contributing.\n\n## Code of Conduct\n\nWe want this community to be friendly and respectful to each other. Please read\n[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)\nso that you can understand what actions will and will not be tolerated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-react-native%2Fpush-notification-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frescript-react-native%2Fpush-notification-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-react-native%2Fpush-notification-ios/lists"}