npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@reason-react-native/push-notification-ios

v1.7.2

Published

ReScript bindings for @react-native-community/push-notification-ios.

Downloads

4

Readme

@reason-react-native/push-notification-ios

Build Status Version Chat

ReScript / Reason bindings for @react-native-community/react-native-push-notification-ios.

Exposed as ReactNativePushNotificationIOS module.

@reason-react-native/push-notification-ios X.y.* means it's compatible with @react-native-community/react-native-push-notification-ios X.y.*

Installation

When @react-native-community/react-native-push-notification-ios is properly installed & configured by following their installation instructions, you can install the bindings:

npm install @reason-react-native/push-notification-ios
# or
yarn add @reason-react-native/push-notification-ios

@reason-react-native/push-notification-ios should be added to bs-dependencies in your bsconfig.json:

{
  //...
  "bs-dependencies": [
    "reason-react",
    "reason-react-native",
    // ...
+    "@reason-react-native/push-notification-ios"
  ],
  //...
}

Usage

Types

ReactNativePushNotificationIOS.Notification.t

  type t; // abstract type

ReactNativePushNotificationIOS.localNotification

type localNotification;

[@bs.obj]
external localNotification:
  (
    ~alertBody: string=?,
    ~alertTitle: string=?,
    ~alertAction: string=?,
    ~soundName: string=?,
    ~isSilent: bool=?,
    ~category: string=?,
    ~userInfo: Js.Json.t=?,
    ~applicationIconBadgeNumber: int=?,
    ~fireDate: Js.Date.t=?,
    ~repeatInterval: [@bs.string] [
                       | `minute
                       | `hour
                       | `day
                       | `week
                       | `month
                       | `year
                     ]
                       =?,
    unit
  ) =>
  localNotification =
  "";

ReactNativePushNotificationIOS.deliveredNotification

type deliveredNotification = {
  identifier: string
  date: option(string)
  title: option(string)
  body: option(string)
  category: option(string)
  threadId: option(string)
  userInfo: option(Js.Json.t),
};

ReactNativePushNotificationIOS.formattedLocalNotification

type formattedLocalNotification = {
  fireDate: option(string),
  alertAction: option(string),
  alertTitle: option(string),
  alertBody: option(string),
  applicationIconBadgeNumber: option(int),
  category: option(string),
  repeatInterval: option(string),
  soundName: option(string),
  userInfo: option(Js.Json.t),
};

ReactNativePushNotificationIOS.registrationError

type registrationError('a) = {
  message: string,
  code: int,
  details: Js.t('a),
};

ReactNativePushNotificationIOS.permissions

type permissions = {
  alert: bool,
  badge: bool,
  sound: bool,
  lockScreen: bool,
  notificationCenter: bool,
};

ReactNativePushNotificationIOS.requestPermissionsOptions

type requestPermissionsOptions;
[@bs.obj]
external requestPermissionsOptions:
  (~alert: bool=?, ~badge: bool=?, ~sound: bool=?, unit) =>
  requestPermissionsOptions =
  "";

ReactNativePushNotificationIOS.fetchResult

type fetchResult;
[@bs.obj]
external fetchResult:
  (~_NewData: string=?, ~_NoData: string=?, ~_ResultFailed: string=?, unit) =>
  fetchResult =
  "";

Methods

ReactNativePushNotificationIOS.Notification.getAlert

Notification.t => option(Js.Json.t)

ReactNativePushNotificationIOS.Notification.getTitle

Notification.t => option(string)

ReactNativePushNotificationIOS.Notification.getMessage

Notification.t => option(Js.Json.t)

ReactNativePushNotificationIOS.Notification.getSound

Notification.t => option(string)

ReactNativePushNotificationIOS.Notification.getCategory

Notification.t => option(string)

ReactNativePushNotificationIOS.Notification.getContentAvailable

Notification.t => bool

ReactNativePushNotificationIOS.Notification.getBadgeCount

Notification.t => option(int)

ReactNativePushNotificationIOS.Notification.getData

Notification.t => option(Js.Json.t)

ReactNativePushNotificationIOS.Notification.getThreadID

Notification.t => option(string)

ReactNativePushNotificationIOS.presentLocalNotification

localNotification => unit

ReactNativePushNotificationIOS.scheduleLocalNotification

localNotification => unit

ReactNativePushNotificationIOS.cancelAllLocalNotifications

unit => unit

ReactNativePushNotificationIOS.removeAllDeliveredNotifications

unit => unit

ReactNativePushNotificationIOS.getDeliveredNotifications

(array(deliveredNotification) => unit)

ReactNativePushNotificationIOS.removeDeliveredNotifications

(~identifiers: array(string)) => unit

ReactNativePushNotificationIOS.setApplicationIconBadgeNumber

int => unit

ReactNativePushNotificationIOS.getApplicationIconBadgeNumber

(int => unit) => unit

ReactNativePushNotificationIOS.cancelLocalNotifications

unit => unit

ReactNativePushNotificationIOS.cancelLocalNotificationsWithUserInfo

Js.Json.t => unit

ReactNativePushNotificationIOS.getScheduledLocalNotifications

(array(formattedLocalNotification) => unit) => unit

ReactNativePushNotificationIOS.addEventListener

  (
  [@bs.string]
  [
    | `notification(Notification.t => unit)
    | `localNotification(Notification.t => unit)
    | `register((~deviceToken: string) => unit)
    | `registrationError(registrationError('a) => unit)
  ]
  ) =>
  unit

ReactNativePushNotificationIOS.removeEventListener

(
  [@bs.string]
  [
    | `notification(Notification.t => unit)
    | `localNotification(Notification.t => unit)
    | `register((~deviceToken: string) => unit)
    | `registrationError(registrationError('a) => unit)
  ]
  ) =>
  unit

ReactNativePushNotificationIOS.requestPermissions

unit => Js.Promise.t(permissions)

ReactNativePushNotificationIOS.requestPermissionsWithOptions

requestPermissionsOptions => Js.Promise.t(permissions)

ReactNativePushNotificationIOS.abandonPermissions

unit => unit

ReactNativePushNotificationIOS.checkPermissions

(unit => permissions) => unit

ReactNativePushNotificationIOS.finish

fetchResult => unit

ReactNativePushNotificationIOS.getInitialNotification

unit => Js.Promise.t(Js.Nullable.t(Notification.t))

Changelog

Check the changelog for more informations about recent releases.


Contribute

Read the contribution guidelines before contributing.

Code of Conduct

We want this community to be friendly and respectful to each other. Please read our full code of conduct so that you can understand what actions will and will not be tolerated.