๐Ÿ””์•Œ๋ฆผ ์„œ๋ฒ„ - 23.02.10 ํ˜„์žฌ ์ƒํ™ฉ ์ •๋ฆฌ

์ดํ•˜์–€ยท2023๋…„ 2์›” 10์ผ
0

๐ŸŽฟ Smailegate(Winter-Devcamp)

๋ชฉ๋ก ๋ณด๊ธฐ
28/49
post-thumbnail

ํ˜„์žฌ ์ƒํ™ฉ

  • ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ

  • ํ…Œ์ŠคํŠธ

  1. Google PlayGround์—์„œ FCM์˜ ์—‘์„ธ์Šค ํ† ํฐ์„ ๊ฐ„๋‹จํžˆ ๊ฐ€์ ธ์˜ค๊ธฐ

  2. ๋กœ๊ทธ์ธํ•˜๊ธฐ

  3. Exchange authorization code for tokens ํด๋ฆญ

  4. ์—‘์„ธ์Šค ํ† ํฐ ๋ณต์‚ฌ

  5. postman์—์„œ ํ…Œ์ŠคํŠธ - send

{
    "targetToken":"ya29.a0AVvZVsr0-Rht_wrKSXxoGKy6c8CYAmyPTLliZDg2pOTQTOF8ce57jsoFONNj4Zj38nxoQXaxEyjvQyuzNq7-xyyVnPV4oMJfm_tnHQ-asn2ReHk89Pu8qkTOkpv7W1INOzoksFQoW_gWEIZK_x46mei55jG1aCgYKAZYSARMSFQGbdwaIq0TdVw_C-BscCCRTpNKAOw0163",
    "title": "23๋…„ 2์›” 10์ผ",
    "body": "push ์•Œ๋ฆผ ํ…Œ์ŠคํŠธ"
}

-> postman ์ƒ์—์„œ๋Š” 200 ok๊ฐ€ ๋œจ์ง€๋งŒ ์ธํ…”๋ฆฌ์ œ์ด ๋กœ๊ทธ์—์„œ๋Š” error๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

ya29.a0AVvZVsr0-Rht_wrKSXxoGKy6c8CYAmyPTLliZDg2pOTQTOF8ce57jsoFONNj4Zj38nxoQXaxEyjvQyuzNq7-xyyVnPV4oMJfm_tnHQ-asn2ReHk89Pu8qkTOkpv7W1INOzoksFQoW_gWEIZK_x46mei55jG1aCgYKAZYSARMSFQGbdwaIq0TdVw_C-BscCCRTpNKAOw0163 23๋…„ 2์›” 10์ผ push ์•Œ๋ฆผ ํ…Œ์ŠคํŠธ
{
  "error": {
    "code": 400,
    "message": "The registration token is not a valid FCM registration token",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
        "errorCode": "INVALID_ARGUMENT"
      }
    ]
  }
}

  • ํ˜น์‹œ๋‚˜ ์‹ถ์–ด, firebase ์ฝ˜์†”์—์„œ messaging์„ ์ด์šฉํ•ด๋ณด๋ ค Google playground์—์„œ ๋ฐ›์•˜๋˜ ์—‘์„ธ์Šค ํ† ํฐ์„ FCM ํ† ํฐ์œผ๋กœ ๋“ฑ๋กํ•˜์—ฌ ํ…Œ์ŠคํŠธํ•ด๋ดค๋‹ค.

    -> ํ ..... ์™„๋ฃŒ๋Š” ๋œจ๋Š”๋ฐ ๋ญ”๊ฐ€ ์•ˆ๋ณด๋‚ด์ง€๋Š” ๊ฒƒ ๊ฐ™๋‹ค. ํ™•์ธํ•  ๋ฐฉ๋ฒ•์ด ์—†๋‹ค.....๐Ÿคฆโ€โ™€๏ธ

reference

profile
์–ธ์  ๊ฐ€ ๋‚ด ์ฝ”๋“œ๋กœ ์„ธ์ƒ์— ๊ธฐ์—ฌํ•  ์ˆ˜ ์žˆ๋„๋ก, BE&Data Science ๊ฐœ๋ฐœ ๊ธฐ๋ก ๋…ธํŠธโ˜˜๏ธ

0๊ฐœ์˜ ๋Œ“๊ธ€