Skip to content

Commit

Permalink
fix: cocoapods APN customers app not compiling (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
levibostian committed Nov 22, 2023
1 parent a2ccebf commit e7aaa23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Apps/CocoaPods-FCM/Podfile
Expand Up @@ -11,6 +11,10 @@ target 'test cocoapods' do
pod 'CustomerIOMessagingInApp', :path => sdk_local_path
pod 'CustomerIOMessagingPushFCM', :path => sdk_local_path

# Adding APN for internal testing, only. Code from this pod is not used at runtime.
# We need to confirm that cocoapods customers can compile their apps with this pod installed.
pod 'CustomerIOMessagingPushAPN', :path => sdk_local_path

# The "CustomerIOMessagingPushFCM" SDK installs the FCM SDK for you, defaulting to the latest version.
# If your app needs to use a specific version of the FCM SDK, you can add the line below to your app's Podfile
# and the version you specify will override the version in the "CustomerIOMessagingPushFCM" SDK.
Expand All @@ -28,4 +32,8 @@ target 'Rich Push Notification Service Extension' do
pod 'CustomerIOTracking', :path => sdk_local_path
pod 'CustomerIOMessagingPush', :path => sdk_local_path
pod 'CustomerIOMessagingPushFCM', :path => sdk_local_path

# Adding APN for internal testing, only. Code from this pod is not used at runtime.
# We need to confirm that cocoapods customers can compile their apps with this pod installed.
pod 'CustomerIOMessagingPushAPN', :path => sdk_local_path
end
2 changes: 2 additions & 0 deletions Sources/MessagingPushAPN/MessagingPushAPN+PushConfigs.swift
Expand Up @@ -2,13 +2,15 @@ import Foundation
import UIKit

extension MessagingPushAPN {
@available(iOSApplicationExtension, unavailable)
func setupAutoFetchDeviceToken() {
// Swizzle method `didRegisterForRemoteNotificationsWithDeviceToken`
swizzleDidRegisterForRemoteNotifications()
// Register for push notifications to invoke`didRegisterForRemoteNotificationsWithDeviceToken` method
UIApplication.shared.registerForRemoteNotifications()
}

@available(iOSApplicationExtension, unavailable)
private func swizzleDidRegisterForRemoteNotifications() {
let appDelegate = UIApplication.shared.delegate
let appDelegateClass: AnyClass? = object_getClass(appDelegate)
Expand Down

0 comments on commit e7aaa23

Please sign in to comment.