chat, // 채팅
study_update,
study_delegate,
study_delete,
apply_new,
apply_reject,
notice_new,
notice_update,
push_test
// apply_allow,
Alert
Payload = {
"pushEvent": "해당 이벤트", // string
"study_id": 링크할 스터디아이디, // int
"alert_id": "해당 알림의 ID" // int
};
----------------------------------
ex)
Payload = {
"pushEvent": "notice_new",
"study_id": 1,
"alert_id": 242
};
Chat
ex)
Payload = {
"pushEvent": "chat",
"study_id": 1,
"nickname": "닉네임",
"message": "메시지",
"date": 1609747430726 (unix time)
}
iOS
payload: {
"encoding" : "utf8",
"payload": {
"pushEvent": "push_test",
"study_id": 1,
"alert_id": 242
},
"compiled": false,
"aps": {
"sound": "default",
"alert": "푸시알림 테스트 - test(유저)" ,
"badge": 40,
},
"expiry": 1610863119,
"priority": 10,
"topic": "com.Terminal-iOS"
}
Android
fcm: {
"notification": {
"title": "터미널 title"
"body": "푸시알림 테스트 - test(유저)",
},
"payload": {
"pushEvent": "push_test",
"study_id": 1,
"alert_id": 242,
"badge": 40
}
}
안드 위에처럼하면 "payload" 부분 데이터를 못받음
아래처럼 notification 안에 넣어줘야함
fcm: {
"notification": {
"title": "터미널 title"
"body": "푸시알림 테스트 - test(유저)",
"badge": 40,
"payload": {
"pushEvent": "push_test",
"study_id": 1,
"alert_id": 242
}
}
}
확인해봤는데 notification 안에 payload, badge를 넣을 수가 없대요
fcm: {
"notification": {
"title": "터미널 title"
"body": "푸시알림 테스트 - test(유저)",
},
"data": {
"pushEvent": "push_test",
"study_id": "1",
"alert_id": "242",
"badge": "40"
}
}
fcm: {
"notification": {
"title": "터미널 title"
"body": "푸시알림 테스트 - test(유저)",
},
"data": {
"title": "터미널 title"
"body": "푸시알림 테스트 - test(유저)",
"pushEvent": "push_test",
"study_id": "1",
"alert_id": "242",
"badge": "40"
}
}