[RN Library ๐Ÿ“š] rn์—์„œ ํ‘ธ์‹œ์•Œ๋ฆผ ๋ณด๋‚ด๊ธฐ! firebase cloud messaging FCM ์„ธํŒ…ํ•˜๊ธฐ

๋„๋””ยท2021๋…„ 2์›” 2์ผ
5

RN Library ๐Ÿ“š

๋ชฉ๋ก ๋ณด๊ธฐ
10/12

์ž๋„ค! ์ด๋ฒˆ ์—…๋ฌด๋Š” rn์— ํ‘ธ์‰ฌ์•Œ๋ฆผ์„ ์„ธํŒ…ํ•˜๋Š” ๊ฑธ์„ธ
..
.. ์˜ค์ผ€์ด ...

firebase์—์„œ ์ง€์›ํ•˜๋Š” ํ‘ธ์‹œ์•Œ๋ฆผ ๊ธฐ๋Šฅ์ธ cloud messaging์„ ์„ธํŒ…ํ•ด๋ณด์ž. ์ง„์ซ˜ ์†”์ฐํžˆ ์ด๊ฑฐ ์„ธํŒ… ํ…Œ์ŠคํŠธํ•˜๋ฉด์„œ ๋‚ด ๋ช…์ค„์ด ์กฐ๊ธˆ ์ค„์–ด๋“ ๊ฑฐ ๊ฐ™๋‹ค.
ios์˜ ๊ฒฝ์šฐ๋Š” ๋‚ด ๊ฒฝํ—˜์œผ๋กœ ์•ฑ ์Šคํ† ์–ด์— ๋ฐฐํฌ๋œ ๊ฒฝ์šฐ์— ํ‘ธ์‹œ์•Œ๋ฆผ์ด ์ œ๋Œ€๋กœ ์ž‘๋™ํ•˜๋Š” ๋“ฏํ•˜๋‹ค. ๋งŒ์•ฝ ์•„๋‹ˆ๋ผ๋ฉด, ๋Œ“๊ธ€๋กœ ๊ฐ•ํ•œ ๋ฐ˜๋ฐ• ๋ถ€ํƒํ•œ๋‹ค.

๐Ÿฅ• ๋ชฉ์ฐจ

  1. Install
  2. iOS ํ‘ธ์‹œ๋ฉ”์‹œ์ง€ ํ™œ์„ฑํ™”
  3. fcm ์ˆ˜์‹  ๋ฐ›๊ธฐ
  4. iOS ํ‘ธ์‹œ๋ฉ”์‹œ์ง€ ์ด๋ฏธ์ง€ ๋ณด์ด๊ฒŒ ํ•˜๊ธฐ
  5. iOS ํ‘ธ์‹œ๋ฉ”์‹œ์ง€ ์ด๋ฏธ์ง€ ์„ธํŒ… ํ›„ Provisioning Profile ์ƒ์„ฑํ•˜๊ธฐ

์ฐธ๊ณ ์‚ฌ์ดํŠธ

rn FCM ๋ฌธ์„œ
rn FCM api ๋ฌธ์„œ

๐Ÿฅ• 1. Install

fcm์„ ์„ธํŒ…ํ•˜๋ ค๊ณ  ํ•˜๋Š” ๋‹น์‹ , firebase์˜ @react-native-firebase/app ์ •๋„๋Š” ์ด๋ฏธ ์„ค์น˜๊ฐ€ ๋˜์–ด์žˆ๊ฒ ์ฃ ?
android๋Š” ๊ฐ„๋‹จํ•œ ํŽธ์ธ๋ฐ, ios๋Š” Noti ์„ธํŒ…์ด android์— ๋น„ํ•ด ์–ด๋ ค์šด ํŽธ์ธ๋ฐ, ๋งˆ์Œ์˜ ์ค€๋น„๋Š” ๋˜์–ด์žˆ์œผ์‹œ๊ฒ ์ฃ ?
ios์˜ ๊ฐœ๋ฐœ์ž ์•„์ด๋””๋„ ์žˆ๊ฒ ์ฃ ? ios ๊ฐœ๋ฐœ์ž ๊ณ„์ • ๊ฒฐ์ œ๋„ ํ•ด๋†จ์„ ๊ฑฐ๊ตฌ์š”?
ios Bundle ID๋„ ์žˆ์„๊ฑฐ์˜ˆ์š”? ์œ„์—์„œ ๋งํ–ˆ๋“ฏ ์•ฑ์Šคํ† ์–ด์— ๋ฐฐํฌ๋„ ํ•ด๋†”์žˆ๊ฒ ์ฃ ?
ios provisioning profile๋„ ์žˆ์„๊ฑฐ์˜ˆ์š”? ๋งž์ฃ ?
๊ทธ๋Ÿฐ ์ƒํ™ฉ์„ ์ „์ œ๋กœ ์‹œ์ž‘ํ•ฉ์‹œ๋‹ค.

npm i @react-native-firebase/messaging

cd ios/ && pod install

๐Ÿฅ• 2. iOS ํ‘ธ์‹œ๋ฉ”์‹œ์ง€ ํ™œ์„ฑํ™”

์šฐ์„  ios๊ฐ€ android์— ๋น„ํ•ด ๋ณต์žกํ•œ ํŽธ์ด๋‹ˆ ios๋ถ€ํ„ฐ ๋งˆ์Šคํ„ฐ ํ•˜์ž.
๊ทธ๋Ÿฌ๋ฉด ์•ˆ๋“œ๋กœ์ด๋“œ๋„ ์ž˜ ์ž‘๋™ํ•˜๊ณ  ์žˆ์„ ํ…Œ๋‹ˆ ๋ง์ด๋‹ค.

์ฐธ๊ณ : https://rnfirebase.io/messaging/usage/ios-setup


ios ํ‘ธ์‹œ๋ฉ”์‹œ์ง€๋ฅผ ํ™œ์„ฑํ™” ํ•˜๋ ค๋ฉด ์•„๋ž˜ ๋‹จ๊ณ„๊ฐ€ ํ•„์š”ํ•˜๋‹ค.

  1. xcode ์ˆ˜์ •ํ•˜๊ธฐ
  2. APN key ์ƒ์„ฑ (apple push notification)
  3. APN๊ณผ FCM ์—ฐ๊ฒฐ
  4. Identifiers ์ˆ˜์ •
  5. Profile ์ˆ˜์ •

1. xcode ์ˆ˜์ •ํ•˜๊ธฐ

(1) Signing & Capabilities ํƒญ์—์„œ Capability๋ฅผ ๋ˆ„๋ฅธ๋‹ค.

(2) Background Modes์™€ Push Notifications๋ฅผ ํ™œ์„ฑํ™” ์‹œํ‚ค๊ณ , Background Modes๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ์ฒดํฌํ•œ๋‹ค.

2. APN key ์ƒ์„ฑ (apple push notification)

(1) Certificates, Identifiers & Profiles๋กœ ์ด๋™ํ•ด์„œ ์ง„ํ–‰ํ•œ๋‹ค.

(2) Identifiers์™€ Profiles, Keys๋ฅผ ์ˆ˜์ •ํ• ๊ฑฐ๋‹ค.

(3) key ๋“ฑ๋กํ•˜๊ธฐ
keys ํƒญ์œผ๋กœ ์ด๋™ํ•ด์„œ, ์ƒˆ๋กœ์šด ํ‚ค๋ฅผ ์ƒ์„ฑํ•œ๋‹ค. ๋‚˜๋Š” ์ด๋ฒˆ ํ‘ธ์‹œ ์•Œ๋ฆผ์„ ํ•˜๊ธฐ ์ „์— key๋ฅผ ์ƒ์„ฑํ•œ ์ ์€ ์—†๊ณ  ์ด๋ฒˆ์ด ์ฒ˜์Œ ์ƒ์„ฑํ•œ key ์˜€๋‹ค.
key name์€ ๋Œ€์ถฉ FCM APNs Key๋กœ ์ง€์—ˆ๊ณ ,
Apple Push Notifications service๋ฅผ ๋ˆŒ๋Ÿฌ์„œ continue๋ฅผ ๋ˆ„๋ฅธ๋‹ค. ๊ทธ ๋‹ค์Œ ํŽ˜์ด์ง€๋Š” ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์–ด ์žˆ๊ณ , key Id๋ฅผ ๋ณด์—ฌ์ค€๋‹ค. ๋‹ค์šด๋กœ๋“œ๋Š” ํ•œ๋ฒˆ ๋ฐ–์— ๋ชปํ•˜๋ฏ€๋กœ ์ž˜ ๊ด€๋ฆฌํ•ด๋‘”๋‹ค.
์†”์งํžˆ ์ž˜ ๋ชป๊ด€๋ฆฌํ•ด์„œ ์‚ญ์ œ ๋˜์–ด๋„ ๋‹ค์‹œ ์ƒ์„ฑํ•˜๋Š” ๊ฑด ์–ด๋ ต์ง€ ์•Š๋‹ค.

3. APN๊ณผ FCM ์—ฐ๊ฒฐ

firebase์™€ ์ƒ์„ฑํ•œ APN ํ‚ค๋ฅผ ์—ฐ๊ฒฐํ•ด๋ณด์ž
ํ”„๋กœ์ ํŠธ ์„ค์ • > ํด๋ผ์šฐ๋“œ ๋ฉ”์‹œ์ง•์œผ๋กœ ์ด๋™ํ•˜์ž.

๊ฑฐ๊ธฐ์„œ iOS ์•ฑ ๊ตฌ์„ฑ > APN ์ธ์ฆ ํ‚ค ์— ์•„๊นŒ ๋‹ค์šด๋กœ๋“œ ํ•œ ํŒŒ์ผ์„ ์˜ฌ๋ฆฌ๋ฉด ๋œ๋‹ค.
key ID๋„ ๊ฐ™์ด ์ ์–ด์ฃผ๊ณ , ํŒ€ ID๋Š” ํ”„๋กœ์ ํŠธ์— ์ด๋ฏธ ์„ค์ • ๋˜์–ด ์žˆ๋Š” ํŒ€ ID๊ฐ€ ๊ฐ€์ ธ์™€ ์ง„๋‹ค.

4. Identifiers ์ˆ˜์ •

Certificates, Identifiers & Profiles > Identifiers์— ๋“ค์–ด๊ฐ€์„œ Edit์„ ๋ˆŒ๋Ÿฌ ์ˆ˜์ •์„ ํ•ด๋ณด์ž.
Capabilities ์•„๋ž˜์— Push Notifications๋ฅผ ํ™œ์„ฑํ™” ํ•˜๊ณ , save๋ฅผ ๋ˆŒ๋Ÿฌ ๋งˆ๋ฌด๋ฆฌ ํ•˜์ž.
Push Notifications ์˜†์— Edit์ด๋ผ๊ณ  ์ธ์ฆ์„œ๋ฅผ ์ถ”๊ฐ€ ํ•  ์ˆ˜ ์žˆ๋Š” ๋ฒ„ํŠผ์ด ์žˆ๋Š”๋ฐ, ์—†์–ด๋„ ์•„๋ฌด ๋ฌธ์ œ ์—†๋‹ค. ๊ฑด๋“ค์ด์ง€ ์•Š์•„๋„ ์•„๋ฌด ์ƒ๊ด€์—†๋‹ค.

5. Profile ์ˆ˜์ •

Identifiers๋ฅผ ์ˆ˜์ •ํ–ˆ์œผ๋‹ˆ, Certificates, Identifiers & Profiles > Profiles ๋กœ ๋“ค์–ด๊ฐ€๋ฉด EXPIRATION์ด Invalid ๋˜์–ด์žˆ์„ ๊ฒƒ์ด๋‹ค. Profile๋“ค์„ Edit, save๋ฅผ ํ•ด์ค˜์„œ ์ƒˆ๋กญ๊ฒŒ ๊ฐฑ์‹  ํ•ด์ค€๋‹ค.
๋ฌผ๋ก  xcode์—์„œ์˜ provisioning profile๋„ ์ƒˆ๋กญ๊ฒŒ ๋‹ค์šด๋กœ๋“œ ํ•ด์ค˜์•ผ ๊ฒ ์ง€!

์ด๊ฒƒ์ด apple developer console์—์„œ ํ•ด์•ผํ•˜๋Š” ์ „๋ถ€!

๐Ÿฅ• 3. fcm ์ˆ˜์‹  ๋ฐ›๊ธฐ

ios, android์™€ ์ฝ”๋“œ๊ฐ€ ๊ฐ™๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ™์ด ์ˆ˜์‹ ์„ ๋ฐ›์•„๋ณด์ž.

index.js ์ˆ˜์ •

// index.js
import { AppRegistry } from 'react-native';
import messaging from '@react-native-firebase/messaging';
import App from './App';

// Register background handler
messaging().setBackgroundMessageHandler(async remoteMessage => {
  console.log('Message handled in the background!', remoteMessage);
});

AppRegistry.registerComponent('app', () => App);

์œ„์˜ setBackgroundMessageHandler ํ•จ์ˆ˜๋Š” ์•ฑ์ด active ๋˜์–ด์žˆ์ง€ ์•Š์„๋•Œ ์ž‘๋™ํ•œ๋‹ค.
๋‹จ, android์—์„œ๋งŒ ์ž‘๋™ํ•˜๊ณ , ios์—์„œ๋Š” console ๊ฐ’์ด ๋‚˜์˜ค์ง€ ์•Š๋Š”๋‹ค. ์ด ํ•จ์ˆ˜๊ฐ€ ์—†์œผ๋ฉด warning์ด ๋œจ๊ธฐ ๋•Œ๋ฌธ์— ๊ผญ ์ถ”๊ฐ€ํ•ด๋†“์ž.

๊ถŒํ•œ ์š”์ฒญ

import {useEffect} from 'react';
import messaging from '@react-native-firebase/messaging';

function CloudMessaging() {
  useEffect(() => {
    requestUserPermission();
  }, []);

  async function requestUserPermission() {
    const authorizationStatus = await messaging().requestPermission();
    // ๊ถŒํ•œ์ƒํƒœ (-1: ์š”์ฒญ ์•ˆํ•จ, 0: ๊ฑฐ๋ถ€, 1: ์ˆ˜๋ฝ, 2: ์ž„์‹œ๊ถŒํ•œ)

    switch (authorizationStatus) {
      case 0:
        checkToken();
        break;
      case 1:
        // ํ† ํฐ ์š”์ฒญ
        checkToken();

        // ์•ฑ ๊บผ์ ธ์žˆ์„ ๋•Œ
        messaging()
          .getInitialNotification()
          .then((remoteMessage) => handleCloudMsg(remoteMessage));

        // background์—์„œ๋งŒ ์ž‘๋™
        messaging().onNotificationOpenedApp((remoteMessage) => {
          handleCloudMsg(remoteMessage);
        });
        break;
      default:
        break;
    }
  }

  // ํ† ํฐ ์š”์ฒญ: ์ถ”ํ›„ ํ•„์š”ํ•  ์˜ˆ์ •
  function checkToken() {
    messaging()
      .getToken()
      .then((data) => {
        console.log('token:', data, messaging().apnsToken);
      });
  }

  async function handleCloudMsg(remoteMessage) {
    if (remoteMessage) {
      if (remoteMessage.data.articleId){
      	// ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ์•ก์…˜์ด ์ž‘๋™ํ•˜๊ฒŒ ํ•˜๊ธฐ
      }
    }
  }

  return null;
}

export default CloudMessaging;

์•ฑ์ด ์•„์˜ˆ ๊บผ์ ธ์žˆ์„ ๋•Œ๋Š” getInitialNotification ํ•จ์ˆ˜๋กœ
์•ฑ์ด background์— ์žˆ์„ ๋•Œ๋Š” onNotificationOpenedApp ํ•จ์ˆ˜๋กœ
cloud messaging ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์‹  ๋ฐ›๊ฒŒ ํ–ˆ๋‹ค.

์ด๋ ‡๊ฒŒ firebase console ํŽ˜์ด์ง€์˜ cloudmessaging์„ ์ด์šฉํ•ด์„œ ํ…Œ์ŠคํŠธ ํ•ด๋ณด๋ฉด
์„ฑ๊ณต์ ์œผ๋กœ ๋œ๋‹ค.
์•„๋†” ์ด๋ ‡๊ฒŒ ๊ธ€๋กœ ์“ฐ๋‹ˆ๊นŒ ์—„์ฒญ ๊ฐ„๋‹จํ•ด ๋ณด์ด๋Š”๋ฐ, ์—„์ฒญ๋‚œ ์‚ฝ์งˆ์˜ ๊ฒฐ๊ณผ๋ฌผ์ด์—ˆ๋‹ค.
๋‚ด์ผ ์˜ค์ „์— ์šด์˜ํŒ€์ด๋ž‘ ํ…Œ์ŠคํŠธ ์žˆ๋Š”๋ฐ, ์˜ค๋ฅ˜ ์—†๊ธธ..๐Ÿ˜ž


(์ถ”๊ฐ€)
+ios ํ…Œ์ŠคํŠธ ์ค‘, ํ‘ธ์‹œ์•Œ๋ฆผ์— ์ด๋ฏธ์ง€๊ฐ€ ๋“ค์–ด๊ฐ€์ง€ ์•Š๋Š” ์  ๋ฐœ๊ฒฌ.
ios ํ‘ธ์‹œ์•Œ๋ฆผ์—์„œ ์ด๋ฏธ์ง€ ๋ณด์ด๊ฒŒ ํ•˜๋Š” ์ž‘์—… ์ถ”๊ฐ€

๐Ÿฅ• 4. iOS ํ‘ธ์‹œ๋ฉ”์‹œ์ง€ ์ด๋ฏธ์ง€ ๋ณด์ด๊ฒŒ ํ•˜๊ธฐ

์ฐธ๊ณ : https://rnfirebase.io/messaging/ios-notification-images

์•ˆ๋“œ๋กœ์ด๋“œ์—์„œ๋Š” ๋”ฐ๋กœ ์„ค์ •ํ•  ํ•„์š” ์—†๊ณ , ios์—์„œ๋งŒ ์„ค์ •ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.
xcode์—์„œ ์ž‘์—…์„ ํ•œ๋‹ค.

  1. xcode๋ฅผ ์‹คํ–‰ํ•ด์„œ File > New > Target... ์„ ๋ˆ„๋ฅธ๋‹ค.

  2. ๊ฑฐ๊ธฐ์„œ Notification Service Extension์„ ์ฐพ์•„์„œ ์„ ํƒํ•œ๋‹ค.

  3. ๋ญ”๊ฐ€ ์ฑ„์›Œ์•ผ ํ•˜๋Š” ํ™”๋ฉด์ด ๋œฐ๊ฑฐ๋‹ค. ๊ฑฐ๊ธฐ์„œ Product Name๊ณผ Language๋ฅผ ์ˆ˜์ •ํ•ด์ฃผ๋ฉด ๋œ๋‹ค. firebase ๋ฌธ์„œ์—์„œ Product Name๋ฅผ ImageNotification์œผ๋กœ ์˜ˆ์‹œ๋ฅผ ๋“ค๊ธธ๋ž˜, ๊ณ ๋Œ€๋กœ ํ–ˆ๊ณ , Language๋Š” swift๊ฐ€ default์ธ๋ฐ Objective-c๋กœ ์ˆ˜์ •ํ–ˆ๋‹ค.

  4. xcode์˜ ์™ผ์ชฝ navigator์—์„œ podfile์„ ์—ฝ๋‹ˆ๋‹ค.

์ œ์ผ ํ•˜๋‹จ์— ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ๋ถ™์—ฌ ๋„ฃ์Šต๋‹ˆ๋‹ค.
VERSION_NUMBER ๋ถ€๋ถ„์€ Podfile.lock ํŒŒ์ผ์— - Firebase/Messaging (~>๋ฅผ ๊ฒ€์ƒ‰ํ•˜๋ฉด ๊ทธ ๋‹ค์Œ ์ˆซ์ž๋ฅผ ์ ์–ด ๋„ฃ์œผ๋ฉด ๋œ๋‹ค. ๋‚˜๋Š” 7.4.0์ด์—ˆ๋‹ค.
์ˆ˜์ •ํ•˜๊ณ  pod install์„ ์ƒˆ๋กœ ํ•ด์ฃผ์–ด pod ํŒŒ์ผ์ด ๋ฐ˜์˜๋˜๊ฒŒ ํ•œ๋‹ค.

target 'ImageNotification' do
  pod 'Firebase/Messaging', '~> VERSION_NUMBER' # eg 6.31.0 
end
  1. xcode์˜ ์™ผ์ชฝ navigator์—์„œ ImageNotification > NotificationService.m์„ ์—ฝ๋‹ˆ๋‹ค.

  2. ์ฝ”๋“œ ์ถ”๊ฐ€ ๋ฐ ์ˆ˜์ •ํ•˜๊ธฐ

#import "NotificationService.h" // ์›๋ž˜ ์žˆ๋˜ ์ฝ”๋“œ
#import "FirebaseMessaging.h" // ์ถ”๊ฐ€ํ•˜๊ธฐ

...

// ์•„๋ž˜์— ์›๋ž˜ ์žˆ๋˜ ์ฝ”๋“œ ์‚ญ์ œํ•˜๊ธฐ
- self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title];
    
- self.contentHandler(self.bestAttemptContent);

// ์œ„ ์ฝ”๋“œ ์‚ญ์ œํ•˜๊ณ , ์•„๋ž˜ ์ฝ”๋“œ๋กœ ์ถ”๊ฐ€ํ•˜๊ธฐ
[[FIRMessaging extensionHelper] populateNotificationContent:self.bestAttemptContent withContentHandler:contentHandler];

ํ‘ธ์‹œ ์•Œ๋ฆผ์„ ๋‚ ๋ฆฌ๋ฉด ์ด๋ฏธ์ง€๊ฐ€ ์ด์˜๊ฒŒ ๋“ค์–ด๊ฐ„๋‹ค.

  1. (App Store ๋ฐฐํฌ ์‹œ) General > Identity > Version, Build ๊ฐ™๊ฒŒํ•˜
    ์—ฌ๊ธฐ์„œ ํ•˜๋‚˜ ๋” ์ถ”๊ฐ€์ž‘์—…์ด ํ•„์š”ํ•œ๋ฐ์š”.

    xcode์˜ TARGETS์— ImageNotification์ด ์ƒ๊ฒผ์„ํ…๋ฐ,
    ๋ณธ์ธ ํ”„๋กœ์ ํŠธ TARGET๊ณผ
    General > Identity > Version๊ณผ General > Identity > Build๋ฅผ ๊ฐ™๊ฒŒ ํ•ด์•ผ ํ•œ๋‹ค. ์‚ฌ์‹ค ์ด๊ฑด App Store๋กœ ๋ฐฐํฌ์‹œ์— ํ•„์š”ํ•œ ์ž‘์—…์ด๋‹ค. TestFlight๋กœ ๋ณด๋‚ผ ๋•Œ ๋‘ ๋ฒ„์ „์ด ๋งž์ง€ ์•Š์œผ๋ฉด Warning์ด ๋œฌ๋‹ค.
    ์žŠ์ง€๋ง๊ธธ

(์ถ”๊ฐ€)

iOS ํ‘ธ์‹œ์•Œ๋ฆผ ์„ธํŒ…์„ ํ•˜๊ณ ๋‚ฌ๋”๋‹ˆ AdHoc์—์„œ ๋ง‰ํ˜€๋ฒ„๋ ธ๋‹ค. ๋ณธ๊ธ€์— ์ˆ˜์ •์„ ํ•ด์„œ ์ถ”๊ฐ€๋ฅผ ํ•˜๊ธฐ๋กœ ํ•˜์ง€๋งŒ, ๋”ฐ๋กœ ๊ธ€์„ ์ž‘์„ฑํ•ด ๋†“๊ธฐ๋„ ํ–ˆ๋‹ค.
https://velog.io/@dody_/RN-์—๋Ÿฌ๋…ธํŠธ-ios-notification-service-extension-์„ธํŒ…-ํ›„-provisioning-profile์ด-ํ•„์š”ํ•˜๋‹ค
์•„๋ž˜์— ๊ฐ€์„œ ํ™•์ธํ•ด๋ด๋„ ๋˜๊ณ , ์•„๋ž˜ ๊ธ€์„ ์ฐธ๊ณ ํ•ด๋„ ๋œ๋‹ค.

๐Ÿฅ• 5. iOS ํ‘ธ์‹œ๋ฉ”์‹œ์ง€ ์ด๋ฏธ์ง€ ์„ธํŒ… ํ›„ Provisioning Profile ์ƒ์„ฑํ•˜๊ธฐ

์œ„์—์„œ ์ญ‰ ๋”ฐ๋ผ ๋‚ด๋ ค์˜ค๋‹ค๊ฐ€, adhoc์œผ๋กœ export ํ•˜๋ ค ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๋‚˜์˜จ๋‹ค.

์›๋ž˜ oheadline.app์˜ provisioning profile๋กœ adhoc์ด ๋˜์—ˆ์—ˆ๋Š”๋ฐ,
ImageNotification.appex์˜ provisioning profile๋„ select ํ•ด์•ผ๋œ๋‹ค.
ํ•˜๋‚˜๊ฐ€ ๋” ์ถ”๊ฐ€ ๋๋‹ค.
๋ฌธ์„œ์—๋Š” ๊ด€๋ จ ์„ค๋ช…์ด ์—†์–ด์„œ ์กฐ๊ธˆ ํ—ค๋งธ๋Š”๋ฐ,

๊ตฌ๊ธ€์— ios notification service extension provisioning profile๋ฅผ ์ณ๋ณด๋‹ˆ
๋‹ค์–‘ํ•œ ์‚ฌ๋žŒ๋“ค์ด ์ธ์ฆ์„œ, ํ”„๋กœ๋น„์ €๋‹ ํ”„๋กœํŒŒ์ผ์„ ์ƒˆ๋กœ ๋งŒ๋“ค์–ด์•ผ ํ•˜๋Š”์ง€์— ๋Œ€ํ•ด ์งˆ๋ฌธ์„ ๋งŽ์ด ๋˜์กŒ๊ณ ,
๊ทธ์— ๋Œ€ํ•œ ๋‹ต์œผ๋กœ ์•„๋ž˜ ๊ธ€์„ ๋ฐœ๊ฒฌํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค.
https://stackoverflow.com/questions/47466759/do-i-require-distribution-provisioning-profile-for-notification-service-extensio

Identifier, provisioning profile์„ ์ƒˆ๋กœ ๋งŒ๋“ค์–ด์•ผ ํ•˜๋Š” ๋“ฏํ•˜๋‹ค.

  1. apple developer > Identifiers ์—์„œ ์ƒˆ๋กœ์šด Identifiters์„ ๋งŒ๋“ ๋‹ค. com.XXX.XXX.ImageNotification์œผ๋กœ ์ƒ์„ฑํ•˜๋ฉด ๋œ๋‹ค.
  2. apple developer > Profiles ์—์„œ ์œ„์—์„œ ๋งŒ๋“  Identifier์„ ๊ฐ€์ง€๊ณ  adhoc์˜ ๊ธฐ๋Šฅ์„ ๊ฐ€์ง„ provisioning profile์„ ๋งŒ๋“ค๋ฉด ๋œ๋‹ค.
  3. adhoc ๋•Œ ํ•„์š”ํ–ˆ๋˜ ImageNotification.appex์˜ select profile์— ์ง€๊ธˆ ๋งŒ๋“  ์ธ์ฆ์„œ๋ฅผ ๋‹ค์šด๋กœ๋“œํ•ด์„œ ๋„ฃ์–ด์ฃผ๋ฉด ๋œ๋‹ค.

์ž˜ export ํ•ด์„œ app distribution์œผ๋กœ ํ™•์ธํ•ด๋ณด๋‹ˆ ์•ฑ๋„ ์ž˜ ์„ค์น˜๊ณ ๋˜๊ณ  ์•Œ๋ฆผ์— ์ด๋ฏธ์ง€๋„ ์ž˜ ๋“ค์–ด๊ฐ€๋”๋ผ!

์ง„์งœ์ง„์งœ ์ œ๋ฐœ ๋๐Ÿฅ•๐Ÿฅ•๐Ÿฅ•

profile
์ถฉ์ „์ค‘..๐Ÿค”

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