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
8adfea4f
Commit
8adfea4f
authored
Jun 26, 2017
by
Libin Lu
Committed by
GitHub
Jun 26, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #449 from cooperka/patch-2
Support Android activity aliases
parents
3f5c41ed
613b3462
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java
...in/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java
+8
-12
No files found.
android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java
View file @
8adfea4f
...
@@ -41,16 +41,11 @@ public class FIRLocalMessagingHelper {
...
@@ -41,16 +41,11 @@ public class FIRLocalMessagingHelper {
sharedPreferences
=
(
SharedPreferences
)
mContext
.
getSharedPreferences
(
PREFERENCES_KEY
,
Context
.
MODE_PRIVATE
);
sharedPreferences
=
(
SharedPreferences
)
mContext
.
getSharedPreferences
(
PREFERENCES_KEY
,
Context
.
MODE_PRIVATE
);
}
}
public
Class
getMainActivityClass
()
{
public
String
getMainActivityClassName
()
{
String
packageName
=
mContext
.
getPackageName
();
String
packageName
=
mContext
.
getPackageName
();
Intent
launchIntent
=
mContext
.
getPackageManager
().
getLaunchIntentForPackage
(
packageName
);
Intent
launchIntent
=
mContext
.
getPackageManager
().
getLaunchIntentForPackage
(
packageName
);
String
className
=
launchIntent
.
getComponent
().
getClassName
();
String
className
=
launchIntent
.
getComponent
().
getClassName
();
try
{
return
className
;
return
Class
.
forName
(
className
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
}
private
AlarmManager
getAlarmManager
()
{
private
AlarmManager
getAlarmManager
()
{
...
@@ -59,8 +54,8 @@ public class FIRLocalMessagingHelper {
...
@@ -59,8 +54,8 @@ public class FIRLocalMessagingHelper {
public
void
sendNotification
(
Bundle
bundle
)
{
public
void
sendNotification
(
Bundle
bundle
)
{
try
{
try
{
Class
intentClass
=
getMainActivityClass
();
String
intentClassName
=
getMainActivityClassName
();
if
(
intentClass
==
null
)
{
if
(
intentClass
Name
==
null
)
{
return
;
return
;
}
}
...
@@ -197,7 +192,8 @@ public class FIRLocalMessagingHelper {
...
@@ -197,7 +192,8 @@ public class FIRLocalMessagingHelper {
mContext
.
sendOrderedBroadcast
(
i
,
null
);
mContext
.
sendOrderedBroadcast
(
i
,
null
);
if
(!
mIsForeground
||
bundle
.
getBoolean
(
"show_in_foreground"
)){
if
(!
mIsForeground
||
bundle
.
getBoolean
(
"show_in_foreground"
)){
Intent
intent
=
new
Intent
(
mContext
,
intentClass
);
Intent
intent
=
new
Intent
();
intent
.
setClassName
(
mContext
,
intentClassName
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_SINGLE_TOP
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_SINGLE_TOP
);
intent
.
putExtras
(
bundle
);
intent
.
putExtras
(
bundle
);
intent
.
setAction
(
bundle
.
getString
(
"click_action"
));
intent
.
setAction
(
bundle
.
getString
(
"click_action"
));
...
@@ -232,8 +228,8 @@ public class FIRLocalMessagingHelper {
...
@@ -232,8 +228,8 @@ public class FIRLocalMessagingHelper {
}
}
public
void
sendNotificationScheduled
(
Bundle
bundle
)
{
public
void
sendNotificationScheduled
(
Bundle
bundle
)
{
Class
intentClass
=
getMainActivityClass
();
String
intentClassName
=
getMainActivityClassName
();
if
(
intentClass
==
null
)
{
if
(
intentClass
Name
==
null
)
{
return
;
return
;
}
}
...
...
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