Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
0f60e406
Commit
0f60e406
authored
Mar 30, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix manifest, fix service
parent
54f73773
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
31 deletions
+37
-31
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+19
-17
RoomParkMessageService.kt
...om/biganto/visual/roompark/data/RoomParkMessageService.kt
+18
-14
No files found.
app/src/main/AndroidManifest.xml
View file @
0f60e406
...
@@ -14,10 +14,23 @@
...
@@ -14,10 +14,23 @@
android:screenOrientation=
"userPortrait"
android:screenOrientation=
"userPortrait"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme.Launch"
>
android:theme=
"@style/AppTheme.Launch"
>
<activity
android:name=
".base.RoomParkMainActivity"
android:configChanges=
"fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:windowSoftInputMode=
"stateHidden|adjustPan"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<service
<service
android:name=
".data.RoomParkMessageService"
android:name=
".data.RoomParkMessageService"
android:enabled=
"true"
android:enabled=
"true"
android:exported=
"false"
>
android:exported=
"true"
android:permission=
"com.google.android.c2dm.permission.SEND"
>
<intent-filter>
<intent-filter>
<action
android:name=
"com.google.firebase.MESSAGING_EVENT"
/>
<action
android:name=
"com.google.firebase.MESSAGING_EVENT"
/>
...
@@ -25,9 +38,9 @@
...
@@ -25,9 +38,9 @@
<!--
<!--
Set custom default icon. This is used when no icon is set for incoming notification messages.
Set custom default icon. This is used when no icon is set for incoming notification messages.
See README(https://goo.gl/l4GJaQ) for more.-->
See README(https://goo.gl/l4GJaQ) for more.-->
<meta-data
<meta-data
android:name=
"com.google.firebase.messaging.default_notification_icon"
android:name=
"com.google.firebase.messaging.default_notification_icon"
android:resource=
"@drawable/ic_bell_on"
/>
android:resource=
"@drawable/ic_bell_on"
/>
<!--
<!--
Set color used with incoming notification messages. This is used when no color is set for the incoming
Set color used with incoming notification messages. This is used when no color is set for the incoming
...
@@ -35,21 +48,10 @@
...
@@ -35,21 +48,10 @@
-->
-->
<meta-data
<meta-data
android:name=
"com.google.firebase.messaging.default_notification_color"
android:name=
"com.google.firebase.messaging.default_notification_color"
android:resource=
"@color/colorAccent"
/>
android:resource=
"@color/colorAccent"
/>
</service>
</service>
<activity
android:name=
".base.RoomParkMainActivity"
android:configChanges=
"fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:windowSoftInputMode=
"stateHidden|adjustPan"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/RoomParkMessageService.kt
View file @
0f60e406
...
@@ -7,25 +7,29 @@ import timber.log.Timber
...
@@ -7,25 +7,29 @@ import timber.log.Timber
class
RoomParkMessageService
:
FirebaseMessagingService
()
{
class
RoomParkMessageService
:
FirebaseMessagingService
()
{
}
override
fun
onNewToken
(
p0
:
String
)
{
super
.
onNewToken
(
p0
)
Timber
.
d
(
"NEW TOKEN REGISTERED: ${p0}"
)
}
fun
onMessageReceived
(
remoteMessage
:
RemoteMessage
)
{
// ...
override
fun
onMessageReceived
(
remoteMessage
:
RemoteMessage
)
{
// ...
// TODO(developer): Handle FCM messages here.
// TODO(developer): Handle FCM messages here.
// Not getting messages here? See why this may be: https://goo.gl/39bRNJ
// Not getting messages here? See why this may be: https://goo.gl/39bRNJ
Timber
.
d
(
"From: ${remoteMessage.from}"
)
Timber
.
d
(
"From: ${remoteMessage.from}"
)
// Check if message contains a data payload.
// Check if message contains a data payload.
if
(
remoteMessage
.
data
.
size
>
0
)
{
if
(
remoteMessage
.
data
.
size
>
0
)
{
Timber
.
d
(
"Message data payload: %s"
,
remoteMessage
.
data
)
Timber
.
d
(
"Message data payload: %s"
,
remoteMessage
.
data
)
if
(
/* Check if data needs to be processed by long running job */
true
)
{
// For long-running tasks (10 seconds or more) use Firebase Job Dispatcher.
if
(
/* Check if data needs to be processed by long running job */
true
)
{
// For long-running tasks (10 seconds or more) use Firebase Job Dispatcher.
// scheduleJob()
// scheduleJob()
}
else
{
// Handle message within 10 seconds
}
else
{
// Handle message within 10 seconds
// handleNow()
// handleNow()
}
}
}
}
// Check if message contains a notification payload.
// Check if message contains a notification payload.
if
(
remoteMessage
.
notification
!=
null
)
{
if
(
remoteMessage
.
notification
!=
null
)
{
Timber
.
d
(
"Message Notification Body: %s"
,
remoteMessage
.
notification
!!
.
body
)
Timber
.
d
(
"Message Notification Body: %s"
,
remoteMessage
.
notification
!!
.
body
)
}
}
// Also if you intend on generating your own notifications as a result of a received FCM
// Also if you intend on generating your own notifications as a result of a received FCM
// message, here is where that should be initiated. See sendNotification method below.
// message, here is where that should be initiated. See sendNotification method below.
}
}
}
\ No newline at end of file
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