soonmyeong2

make env

wello_firebase_SDKKey.json
<?php
//쿼리
$query = "select * from wello.policy";
\ mysql_select_db("admin", $conn);
mysql_query("set 정책명 utf8"); //간단히 이거 한줄이면 되네
$result = mysql_query($query, $conn);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$res['정책명'] = urlencode($row["정책명"]);
$res['링크'] = urlencode($row["링크"]);
$arr["result"][] = $res;
}
$json = json_encode ($arr);
$json = urldecode ($json);
print $json;
mysql_close($conn);
?>
\ No newline at end of file
import firebase_admin
from firebase_admin import credentials
from firebase_admin import messaging
from firebase_admin import datetime
cred = credentials.Certificate("./wello_firebase_SDKKey.json")
wello = firebase_admin.initialize_app(cred)
topic = 'news'
# See documentation on defining a message payload.
message = messaging.Message(
android=messaging.AndroidConfig(
ttl=datetime.timedelta(seconds=3600),
priority='normal',
notification=messaging.AndroidNotification(
title='기성이와',
body='률이안나',
icon='',
color='#f45342',
sound='default'
),
),
data={
'score': '850',
'time': '2:45',
},
topic=topic
)
response = messaging.send(message)
print('Successfully sent message:', response)
This diff could not be displayed because it is too large.
......@@ -17,7 +17,7 @@ class PushingActivity : AppCompatActivity() {
subscribeButton.setOnClickListener {
Log.d(TAG, "Subscribing to weather topic")
// [START subscribe_topics]
FirebaseMessaging.getInstance().subscribeToTopic("news")
FirebaseMessaging.getInstance().subscribeToTopic("kisung")
.addOnCompleteListener { task ->
var msg = getString(R.string.msg_subscribed)
if (!task.isSuccessful) {
......