Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-notifications
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
冷佳娟
react-native-notifications
Commits
b22b57c1
Commit
b22b57c1
authored
Oct 27, 2016
by
Leon Mok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change unneeded lets to consts
parent
91ceadbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
index.ios.js
index.ios.js
+8
-9
No files found.
index.ios.js
View file @
b22b57c1
...
@@ -24,8 +24,8 @@ const _exportedEvents = [
...
@@ -24,8 +24,8 @@ const _exportedEvents = [
DEVICE_NOTIFICATION_RECEIVED_BACKGROUND_EVENT
,
DEVICE_NOTIFICATION_RECEIVED_BACKGROUND_EVENT
,
DEVICE_NOTIFICATION_OPENED_EVENT
DEVICE_NOTIFICATION_OPENED_EVENT
];
];
le
t
_notificationHandlers
=
new
Map
();
cons
t
_notificationHandlers
=
new
Map
();
le
t
_actionHandlers
=
new
Map
();
cons
t
_actionHandlers
=
new
Map
();
let
_actionListener
;
let
_actionListener
;
export
class
NotificationAction
{
export
class
NotificationAction
{
...
@@ -84,18 +84,17 @@ export default class NotificationsIOS {
...
@@ -84,18 +84,17 @@ export default class NotificationsIOS {
*/
*/
static
removeEventListener
(
type
:
string
,
handler
:
Function
)
{
static
removeEventListener
(
type
:
string
,
handler
:
Function
)
{
if
(
_exportedEvents
.
indexOf
(
type
)
!==
-
1
)
{
if
(
_exportedEvents
.
indexOf
(
type
)
!==
-
1
)
{
let
listener
=
_notificationHandlers
.
get
(
handler
);
const
listener
=
_notificationHandlers
.
get
(
handler
);
if
(
!
listener
)
{
if
(
listener
)
{
return
;
listener
.
remove
();
_notificationHandlers
.
delete
(
handler
);
}
}
listener
.
remove
();
_notificationHandlers
.
delete
(
handler
);
}
}
}
}
static
_actionHandlerDispatcher
(
action
:
Object
)
{
static
_actionHandlerDispatcher
(
action
:
Object
)
{
le
t
actionHandler
=
_actionHandlers
.
get
(
action
.
identifier
);
cons
t
actionHandler
=
_actionHandlers
.
get
(
action
.
identifier
);
if
(
actionHandler
)
{
if
(
actionHandler
)
{
action
.
notification
=
new
IOSNotification
(
action
.
notification
);
action
.
notification
=
new
IOSNotification
(
action
.
notification
);
...
@@ -180,7 +179,7 @@ export default class NotificationsIOS {
...
@@ -180,7 +179,7 @@ export default class NotificationsIOS {
* - `fireDate` : The date and time when the system should deliver the notification. if not specified, the notification will be dispatched immediately.
* - `fireDate` : The date and time when the system should deliver the notification. if not specified, the notification will be dispatched immediately.
*/
*/
static
localNotification
(
notification
:
Object
)
{
static
localNotification
(
notification
:
Object
)
{
le
t
notificationId
=
uuid
.
v4
();
cons
t
notificationId
=
uuid
.
v4
();
NativeRNNotifications
.
localNotification
(
notification
,
notificationId
);
NativeRNNotifications
.
localNotification
(
notification
,
notificationId
);
return
notificationId
;
return
notificationId
;
...
...
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