ReScript bindings for
@react-native-community/react-native-push-notification-ios.
Exposed as ReactNativePushNotificationIOS module.
@rescript-react-native/push-notification-ios X.y.* means it's compatible with
@react-native-community/react-native-push-notification-ios X.y.*
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 @rescript-react-native/push-notification-ios
# or
yarn add @rescript-react-native/push-notification-ios@rescript-react-native/push-notification-ios should be added to
bs-dependencies in your bsconfig.json:
{
//...
"bs-dependencies": [
"@rescript/react",
"rescript-react-native",
// ...
+ "@rescript-react-native/push-notification-ios"
],
//...
} type t; // abstract typetype 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 =
"";type deliveredNotification = {
identifier: string
date: option(string)
title: option(string)
body: option(string)
category: option(string)
threadId: option(string)
userInfo: option(Js.Json.t),
};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),
};type registrationError('a) = {
message: string,
code: int,
details: Js.t('a),
};type permissions = {
alert: bool,
badge: bool,
sound: bool,
lockScreen: bool,
notificationCenter: bool,
};type requestPermissionsOptions;
[@bs.obj]
external requestPermissionsOptions:
(~alert: bool=?, ~badge: bool=?, ~sound: bool=?, unit) =>
requestPermissionsOptions =
"";type fetchResult;
[@bs.obj]
external fetchResult:
(~_NewData: string=?, ~_NoData: string=?, ~_ResultFailed: string=?, unit) =>
fetchResult =
"";Notification.t => option(Js.Json.t)Notification.t => option(string)Notification.t => option(Js.Json.t)Notification.t => option(string)Notification.t => option(string)Notification.t => boolNotification.t => option(int)Notification.t => option(Js.Json.t)Notification.t => option(string)localNotification => unitlocalNotification => unitunit => unitunit => unit(array(deliveredNotification) => unit)(~identifiers: array(string)) => unitint => unit(int => unit) => unitunit => unitJs.Json.t => unit(array(formattedLocalNotification) => unit) => unit (
[@bs.string]
[
| `notification(Notification.t => unit)
| `localNotification(Notification.t => unit)
| `register((~deviceToken: string) => unit)
| `registrationError(registrationError('a) => unit)
]
) =>
unit(
[@bs.string]
[
| `notification(Notification.t => unit)
| `localNotification(Notification.t => unit)
| `register((~deviceToken: string) => unit)
| `registrationError(registrationError('a) => unit)
]
) =>
unitunit => Js.Promise.t(permissions)requestPermissionsOptions => Js.Promise.t(permissions)unit => unit(unit => permissions) => unitfetchResult => unitunit => Js.Promise.t(Js.Nullable.t(Notification.t))Check the changelog for more informations about recent releases.
Read the contribution guidelines before contributing.
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.