๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐ŸŽ iOS

[iOS] APNs ๋“ฑ๋ก ํ›„ ํ‘ธ์‹œ ํ…Œ์ŠคํŠธํ•˜๋Š”๋ฒ• - Push Notifications Console / Tester

by Danna 2023. 10. 15.
728x90
728x90

โœจ Push Notifications Console ์„ ์ด์šฉํ•˜๋ฉด ์‰ฝ๊ฒŒ ํ…Œ์ŠคํŠธ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค

์• ํ”Œ์—์„œ ์ œ๊ณตํ•˜๋Š” ํ‘ธ์‹œ ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•œ ์›นํŽ˜์ด์ง€ (๊ธ€ ์ž‘์„ฑ ์ „์—๋Š” ๋‚˜์˜ค๊ธฐ ์ „์ด๋ผ ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•๋„ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค๐Ÿฅน)
- https://developer.apple.com/videos/play/wwdc2023/10025/
- https://developer.apple.com/notifications/push-notifications-console/

์•ฑ์—์„œ APNs ๋“ฑ๋ก ํ›„์— ์„œ๋ฒ„ ๋””ํŽœ๋˜์‹œ ์—†์ด ํ…Œ์ŠคํŠธํ•˜๊ธฐ

๐Ÿ‰ A macOS, Linux, Windows app to test push notifications on iOS and Android
https://github.com/onmyway133/PushNotifications
์ปค๋งจ๋“œ๋ผ์ธ์œผ๋กœ๋„ ๊ฐ€๋Šฅํ•จ..
https://developer.apple.com/documentation/usernotifications/sending_push_notifications_using_command-line_tools

์‚ฌ์ „ ์ž‘์—…

  • ํ‘ธ์‹œ ์ธ์ฆ์„œ ๋ฐœ๊ธ‰ p12 ๋˜๋Š” p8
  • ํ”„๋กœ์ ํŠธ์—์„œ APNs ์„ค์ • ์ถ”๊ฐ€
  • ์•ฑ์—์„œ APNs ๋“ฑ๋ก ์ฝ”๋“œ ์ž‘์„ฑ UNUserNotificationCenterDelegate
  • ํ‘ธ์‹œ ๊ถŒํ•œ ํ—ˆ์šฉ

ํ•„์š”ํ•œ ๊ฒƒ

  • ํ‘ธ์‹œ ์ธ์ฆ์„œ p12 ๋˜๋Š” p8
    • p12 : CERTIFICATE ํƒญ์— ๋“ฑ๋ก
    • p8 : TOKEN ํƒญ์— ๋“ฑ๋ก
  • ์•ฑ์˜ bundle id
  • ์•ฑ์—์„œ APNs ์— ๋“ฑ๋กํ›„์— ์ „๋‹ฌ๋ฐ›์€ device token
  • ํ‘ธ์‹œ ๋ณด๋‚ผ ๋•Œ ๋ณด์—ฌ์งˆ ์‘๋‹ต
{
  "aps": {
    "alert": {
      "title":"push title", 
      "body": "body"
    }
  },
  "articleId": 62,
  "pushType" : "article1"
}
 
728x90
728x90