Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
cd8607d6
Commit
cd8607d6
authored
Jul 30, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use common notification channel for FCM
parent
aaafba43
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
2 deletions
+7
-2
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+4
-0
app/src/main/java/app/insti/MainActivity.java
app/src/main/java/app/insti/MainActivity.java
+1
-1
app/src/main/java/app/insti/notifications/NotificationIntentService.java
...va/app/insti/notifications/NotificationIntentService.java
+1
-1
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
cd8607d6
...
...
@@ -116,6 +116,10 @@
</intent-filter>
</service>
<meta-data
android:name=
"com.google.firebase.messaging.default_notification_channel_id"
android:value=
"@string/default_notification_channel_id"
/>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/app/insti/MainActivity.java
View file @
cd8607d6
...
...
@@ -125,7 +125,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
NotificationManager
mNotificationManager
=
(
NotificationManager
)
getSystemService
(
Context
.
NOTIFICATION_SERVICE
);
// The id of the channel.
String
id
=
"INSTIAPP_CHANNEL"
;
String
id
=
getResources
().
getString
(
R
.
string
.
default_notification_channel_id
)
;
// The user-visible name of the channel.
CharSequence
name
=
"InstiApp"
;
...
...
app/src/main/java/app/insti/notifications/NotificationIntentService.java
View file @
cd8607d6
...
...
@@ -122,7 +122,7 @@ public class NotificationIntentService extends JobIntentService {
if
(
timediff
<=
30
&&
timediff
>
0
)
{
// Change this to 30*10000 for testing
NOTIFICATION_ID
=
event
.
getEventID
().
hashCode
();
final
NotificationCompat
.
Builder
builder
=
new
NotificationCompat
.
Builder
(
getApplicationContext
(),
"INSTIAPP_CHANNEL"
);
final
NotificationCompat
.
Builder
builder
=
new
NotificationCompat
.
Builder
(
getApplicationContext
(),
getResources
().
getString
(
R
.
string
.
default_notification_channel_id
)
);
builder
.
setContentTitle
(
event
.
getEventName
())
.
setAutoCancel
(
true
)
.
setColor
(
getResources
().
getColor
(
R
.
color
.
colorAccent
))
...
...
app/src/main/res/values/strings.xml
View file @
cd8607d6
...
...
@@ -39,4 +39,5 @@
<string
name=
"drawer_open"
>
Open the drawer
</string>
<string
name=
"drawer_close"
>
Close the drawer
</string>
<string
name=
"default_notification_channel_id"
>
INSTIAPP_NOTIFS
</string>
</resources>
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