Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-fcm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
react-native-fcm
Commits
7557b00e
Commit
7557b00e
authored
Sep 07, 2018
by
Libin Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add createNotificationChannel
parent
b884852e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
170 additions
and
156 deletions
+170
-156
index.d.ts
index.d.ts
+170
-156
No files found.
index.d.ts
View file @
7557b00e
declare
module
"
react-native-fcm
"
{
declare
module
"
react-native-fcm
"
{
type
FCMEventType
=
type
FCMEventType
=
"
FCMTokenRefreshed
"
|
"
FCMNotificationReceived
"
|
'
FCMDirectChannelConnectionChanged
'
;
|
"
FCMTokenRefreshed
"
export
module
FCMEvent
{
|
"
FCMNotificationReceived
"
|
"
FCMDirectChannelConnectionChanged
"
;
export
namespace
FCMEvent
{
const
RefreshToken
=
"
FCMTokenRefreshed
"
;
const
RefreshToken
=
"
FCMTokenRefreshed
"
;
const
Notification
=
"
FCMNotificationReceived
"
;
const
Notification
=
"
FCMNotificationReceived
"
;
const
DirectChannelConnectionChanged
:
'
FCMDirectChannelConnectionChanged
'
const
DirectChannelConnectionChanged
:
"
FCMDirectChannelConnectionChanged
"
;
}
}
export
modul
e
RemoteNotificationResult
{
export
namespac
e
RemoteNotificationResult
{
const
NewData
=
"
UIBackgroundFetchResultNewData
"
;
const
NewData
=
"
UIBackgroundFetchResultNewData
"
;
const
NoData
=
"
UIBackgroundFetchResultNoData
"
;
const
NoData
=
"
UIBackgroundFetchResultNoData
"
;
const
ResultFailed
=
"
UIBackgroundFetchResultFailed
"
;
const
ResultFailed
=
"
UIBackgroundFetchResultFailed
"
;
}
}
export
modul
e
WillPresentNotificationResult
{
export
namespac
e
WillPresentNotificationResult
{
const
All
=
"
UNNotificationPresentationOptionAll
"
;
const
All
=
"
UNNotificationPresentationOptionAll
"
;
const
None
=
"
UNNotificationPresentationOptionNone
"
;
const
None
=
"
UNNotificationPresentationOptionNone
"
;
}
}
export
modul
e
NotificationType
{
export
namespac
e
NotificationType
{
const
Remote
=
"
remote_notification
"
;
const
Remote
=
"
remote_notification
"
;
const
NotificationResponse
=
"
notification_response
"
;
const
NotificationResponse
=
"
notification_response
"
;
const
WillPresent
=
"
will_present_notification
"
;
const
WillPresent
=
"
will_present_notification
"
;
...
@@ -26,23 +28,23 @@ declare module "react-native-fcm" {
...
@@ -26,23 +28,23 @@ declare module "react-native-fcm" {
}
}
export
enum
NotificationCategoryOption
{
export
enum
NotificationCategoryOption
{
CustomDismissAction
=
'
UNNotificationCategoryOptionCustomDismissAction
'
,
CustomDismissAction
=
"
UNNotificationCategoryOptionCustomDismissAction
"
,
AllowInCarPlay
=
'
UNNotificationCategoryOptionAllowInCarPlay
'
,
AllowInCarPlay
=
"
UNNotificationCategoryOptionAllowInCarPlay
"
,
PreviewsShowTitle
=
'
UNNotificationCategoryOptionHiddenPreviewsShowTitle
'
,
PreviewsShowTitle
=
"
UNNotificationCategoryOptionHiddenPreviewsShowTitle
"
,
PreviewsShowSubtitle
=
'
UNNotificationCategoryOptionHiddenPreviewsShowSubtitle
'
,
PreviewsShowSubtitle
=
"
UNNotificationCategoryOptionHiddenPreviewsShowSubtitle
"
,
None
=
'
UNNotificationCategoryOptionNone
'
None
=
"
UNNotificationCategoryOptionNone
"
}
}
export
enum
NotificationActionOption
{
export
enum
NotificationActionOption
{
AuthenticationRequired
=
'
UNNotificationActionOptionAuthenticationRequired
'
,
AuthenticationRequired
=
"
UNNotificationActionOptionAuthenticationRequired
"
,
Destructive
=
'
UNNotificationActionOptionDestructive
'
,
Destructive
=
"
UNNotificationActionOptionDestructive
"
,
Foreground
=
'
UNNotificationActionOptionForeground
'
,
Foreground
=
"
UNNotificationActionOptionForeground
"
,
None
=
'
UNNotificationActionOptionNone
'
None
=
"
UNNotificationActionOptionNone
"
}
}
export
enum
NotificationActionType
{
export
enum
NotificationActionType
{
Default
=
'
UNNotificationActionTypeDefault
'
,
Default
=
"
UNNotificationActionTypeDefault
"
,
TextInput
=
'
UNNotificationActionTypeTextInput
'
,
TextInput
=
"
UNNotificationActionTypeTextInput
"
}
}
export
interface
Notification
{
export
interface
Notification
{
...
@@ -50,7 +52,7 @@ declare module "react-native-fcm" {
...
@@ -50,7 +52,7 @@ declare module "react-native-fcm" {
opened_from_tray
:
boolean
;
opened_from_tray
:
boolean
;
from
:
string
;
from
:
string
;
notification
:
{
notification
:
{
title
?:
string
title
?:
string
;
body
:
string
;
body
:
string
;
icon
:
string
;
icon
:
string
;
};
};
...
@@ -100,7 +102,7 @@ declare module "react-native-fcm" {
...
@@ -100,7 +102,7 @@ declare module "react-native-fcm" {
export
interface
ScheduleLocalNotification
extends
LocalNotification
{
export
interface
ScheduleLocalNotification
extends
LocalNotification
{
id
:
string
;
id
:
string
;
fire_date
:
number
;
fire_date
:
number
;
repeat_interval
?:
"
week
"
|
"
day
"
|
"
hour
"
repeat_interval
?:
"
week
"
|
"
day
"
|
"
hour
"
;
}
}
export
interface
Subscription
{
export
interface
Subscription
{
...
@@ -127,8 +129,14 @@ declare module "react-native-fcm" {
...
@@ -127,8 +129,14 @@ declare module "react-native-fcm" {
export
class
FCM
{
export
class
FCM
{
static
requestPermissions
():
Promise
<
void
>
;
static
requestPermissions
():
Promise
<
void
>
;
static
getFCMToken
():
Promise
<
string
>
;
static
getFCMToken
():
Promise
<
string
>
;
static
on
(
event
:
"
FCMTokenRefreshed
"
,
handler
:
(
token
:
string
)
=>
void
):
Subscription
;
static
on
(
static
on
(
event
:
"
FCMNotificationReceived
"
,
handler
:
(
notification
:
Notification
)
=>
void
):
Subscription
;
event
:
"
FCMTokenRefreshed
"
,
handler
:
(
token
:
string
)
=>
void
):
Subscription
;
static
on
(
event
:
"
FCMNotificationReceived
"
,
handler
:
(
notification
:
Notification
)
=>
void
):
Subscription
;
static
subscribeToTopic
(
topic
:
string
):
void
;
static
subscribeToTopic
(
topic
:
string
):
void
;
static
unsubscribeFromTopic
(
topic
:
string
):
void
;
static
unsubscribeFromTopic
(
topic
:
string
):
void
;
static
getInitialNotification
():
Promise
<
Notification
>
;
static
getInitialNotification
():
Promise
<
Notification
>
;
...
@@ -147,11 +155,17 @@ declare module "react-native-fcm" {
...
@@ -147,11 +155,17 @@ declare module "react-native-fcm" {
static
getBadgeNumber
():
Promise
<
number
>
;
static
getBadgeNumber
():
Promise
<
number
>
;
static
send
(
id
:
string
,
data
:
any
):
void
;
static
send
(
id
:
string
,
data
:
any
):
void
;
static
enableDirectChannel
():
void
static
enableDirectChannel
():
void
;
static
isDirectChannelEstablished
():
Promise
<
boolean
>
static
isDirectChannelEstablished
():
Promise
<
boolean
>
;
static
getAPNSToken
():
Promise
<
string
>
static
getAPNSToken
():
Promise
<
string
>
;
static
setNotificationCategories
(
categories
:
NotificationCategory
[]):
void
;
static
setNotificationCategories
(
categories
:
NotificationCategory
[]):
void
;
static
createNotificationChannel
(
config
:
{
id
:
string
;
name
:
string
;
description
?:
string
;
priority
?:
string
;
});
}
}
export
default
FCM
;
export
default
FCM
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment