website logo
⌘K
🚀시작하기
📈마케터용 가이드
🛠️개발자용 가이드
플레어레인 홈페이지
플레어레인 콘솔
플레어레인 콘솔(데모)
Docs powered by archbee 

iOS: Swizzling 비활성화

iOS Delegate 및 Remote Notifications 관련 지식이 필요하므로 충분한 숙지 후 수행하세요.

플레어레인 iOS SDK는 기본적으로 Method Swizzling 을 사용하여 런타임 환경에서 푸시 알림 동작에 필요한 메소드 구현체를 플레어레인의 것으로 바꿔치기 합니다. 이를 통해 복잡한 구현 과정을 생략할 수 있어 보다 깔끔한 연동이 가능해집니다.

그러나 타 푸시 서비스와 함께 사용하려면, Swizzling 을 비활성화하여 플레어레인을 포함한 모든 SDK가 본래의 메소드를 공유할 수 있도록 해야 합니다. Swizzling 비활성화 시 몇 가지 코드 추가가 필요합니다. 하지만 걱정 마세요! 매우 쉽게 연동할 수 있도록 1:1 대응 메소드를 모두 만들어놨습니다.

본 가이드를 차근히 따라하며 쉽게 Method Swizzling을 비활성화한 채 플레어레인을 연동해보세요.

1. 작업 순서 정리

Method Swizzling 비활성화에 필요한 작업들을 먼저 숙지하세요. 1줄 메소드 5개만 추가하면 됩니다!

  1. SDK 버전 1.1.0 이상 업데이트
  2. Info.plist 에 FlareLaneSwizzlingEnabled -> false 키-값 추가
  3. AppDelegate 메소드 1개 추가
  4. UNUserNotificationCenterDelegate 메소드 2개 추가
  5. UNNotificationServiceExtension 메소드 2개 추가

2. SDK 버전 업데이트

iOS, React Native, Flutter SDK 모두 1.1.0 버전부터 Method Swizzling 비활성화가 가능합니다.

3. Info.plist 키-값 추가

Xcode에서 타겟 프로젝트를 선택 후, Info -> Custom iOS Target Properties -> Add Row



Key: FlareLaneSwizzlingEnabled Value: Boolean 타입 'NO' 추가



4. AppDelegate 메소드 추가

  1. application(:didRegisterForRemoteNotificationsWithDeviceToken:) 대응 메소드 추가
Swift
ObjectiveC
|


5. UNUserNotificationCenterDelegate 메소드 추가

  1. AppDelegate에 UNUserNotificationCenterDelegate 지정
  2. userNotificationCenter(:willPresent:withCompletionHandler:) 대응 메소드 추가
  3. userNotificationCenter(:didReceive:withCompletionHandler:) 대응 메소드 추가
Swift
ObjectiveC
|


6. UNNotificationServiceExtension 메소드 추가

  1. didReceive(:withContentHandler:) 대응 메소드 추가
  2. serviceExtensionTimeWillExpire() 대응 메소드 추가
Swift
ObjectiveC
|




Did this page help you?
Yes
No
UP NEXT
웹 푸시 설정: 직접 푸시 vs 간접 푸시
Docs powered by archbee 
TABLE OF CONTENTS
1. 작업 순서 정리
2. SDK 버전 업데이트
3. Info.plist 키-값 추가
4. AppDelegate 메소드 추가
5. UNUserNotificationCenterDelegate 메소드 추가
6. UNNotificationServiceExtension 메소드 추가