Toggle navigation
Toggle navigation
This project
Loading...
Sign in
장연우
/
WELLO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
soonmyeong2
2019-11-16 14:09:55 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bf8c82152a447acaf04626e53c0e7d9e351eacef
bf8c8215
1 parent
4d7735ed
make push alarm file
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
.gitignore
push_messaging.py
vip/app/src/main/java/com/example/vip/SearchActivity.kt
.gitignore
0 → 100644
View file @
bf8c821
wello_firebase_SDKKey.json
\ No newline at end of file
push_messaging.py
0 → 100644
View file @
bf8c821
from
firebase_admin
import
messaging
from
firebase_admin
import
credentials
import
firebase_admin
cred
=
credentials
.
Certificate
(
'wello_firebase_SDKKey.json'
)
default_app
=
firebase_admin
.
initialize_app
(
cred
)
def
send_to_topic
():
# [START send_to_topic]
# The topic name can be optionally prefixed with "/topics/".
topic
=
'c1_1'
# See documentation on defining a message payload.
message
=
messaging
.
Message
(
title
=
'wef'
,
data
=
{
'score'
:
'850'
,
'time'
:
'2:45'
,
},
topic
=
topic
,
)
# Send a message to the devices subscribed to the provided topic.
response
=
messaging
.
send
(
message
)
# Response is a message ID string.
print
(
'Successfully sent message:'
,
response
)
send_to_topic
()
vip/app/src/main/java/com/example/vip/SearchActivity.kt
View file @
bf8c821
...
...
@@ -81,17 +81,16 @@ class SearchActivity : AppCompatActivity() {
key
.
add
(
temp
.
toString
())
}
}
no_search
.
setVisibility
(
View
.
GONE
)
policy_scroll_view
.
setVisibility
(
View
.
VISIBLE
)
for
(
i
in
key
)
{
val
key_query
=
database
.
orderByChild
(
"Policy"
).
equalTo
(
"$i"
)
key_query
.
addListenerForSingleValueEvent
(
object
:
ValueEventListener
{
override
fun
onDataChange
(
dataSnapshot
:
DataSnapshot
)
{
//Toast.makeText(getBaseContext(), dataSnapshot.getValue().toString(), Toast.LENGTH_SHORT).show()
no_search
.
setVisibility
(
View
.
GONE
)
policy_scroll_view
.
setVisibility
(
View
.
VISIBLE
)
for
(
memoSnapshot
in
dataSnapshot
.
children
){
val
memo
=
memoSnapshot
.
getValue
(
MemoItem
::
class
.
java
)
...
...
@@ -113,7 +112,6 @@ class SearchActivity : AppCompatActivity() {
if
(
key
.
size
==
0
)
{
policy_scroll_view
.
setVisibility
(
View
.
GONE
)
no_search
.
setVisibility
(
View
.
VISIBLE
)
}
//////////
...
...
Please
register
or
login
to post a comment