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
d3e21a2d
Commit
d3e21a2d
authored
Nov 27, 2016
by
d4vidi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slightly refactor PushNotification to allow for easier overriding (aligns with wiki)
parent
40d2b6fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
android/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java
...tivenotifications/core/notification/PushNotification.java
+7
-4
No files found.
android/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java
View file @
d3e21a2d
...
@@ -38,7 +38,8 @@ public class PushNotification implements IPushNotification {
...
@@ -38,7 +38,8 @@ public class PushNotification implements IPushNotification {
}
}
@Override
@Override
public
void
onAppNotVisible
()
{}
public
void
onAppNotVisible
()
{
}
};
};
protected
PushNotification
(
Context
context
,
Bundle
bundle
,
AppLifecycleFacade
appLifecycleFacade
)
{
protected
PushNotification
(
Context
context
,
Bundle
bundle
,
AppLifecycleFacade
appLifecycleFacade
)
{
...
@@ -127,15 +128,17 @@ public class PushNotification implements IPushNotification {
...
@@ -127,15 +128,17 @@ public class PushNotification implements IPushNotification {
}
}
protected
Notification
buildNotification
(
PendingIntent
intent
)
{
protected
Notification
buildNotification
(
PendingIntent
intent
)
{
final
Notification
.
Builder
notificationBuilder
=
new
Notification
.
Builder
(
mContext
)
return
getNotificationBuilder
(
intent
).
build
();
}
protected
Notification
.
Builder
getNotificationBuilder
(
PendingIntent
intent
)
{
return
new
Notification
.
Builder
(
mContext
)
.
setContentTitle
(
mNotificationProps
.
getTitle
())
.
setContentTitle
(
mNotificationProps
.
getTitle
())
.
setContentText
(
mNotificationProps
.
getBody
())
.
setContentText
(
mNotificationProps
.
getBody
())
.
setSmallIcon
(
mContext
.
getApplicationInfo
().
icon
)
.
setSmallIcon
(
mContext
.
getApplicationInfo
().
icon
)
.
setContentIntent
(
intent
)
.
setContentIntent
(
intent
)
.
setDefaults
(
Notification
.
DEFAULT_ALL
)
.
setDefaults
(
Notification
.
DEFAULT_ALL
)
.
setAutoCancel
(
true
);
.
setAutoCancel
(
true
);
return
notificationBuilder
.
build
();
}
}
protected
void
postNotification
(
int
id
,
Notification
notification
)
{
protected
void
postNotification
(
int
id
,
Notification
notification
)
{
...
...
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