diff --git a/StreetDrop/Podfile.lock b/StreetDrop/Podfile.lock index 3f489f43..922103a7 100644 --- a/StreetDrop/Podfile.lock +++ b/StreetDrop/Podfile.lock @@ -23,6 +23,6 @@ SPEC CHECKSUMS: NMapsGeometry: 53c573ead66466681cf123f99f698dc8071a4b83 NMapsMap: aaa64717249b06ae82c3a3addb3a01f0e33100ab -PODFILE CHECKSUM: c1edcf3d49503875acf5f6e7bfd364191c925046 +PODFILE CHECKSUM: a8c0902adb23412ed3e2bbd632c3c7f7846b9405 -COCOAPODS: 1.15.2 +COCOAPODS: 1.12.1 diff --git a/StreetDrop/ShareExtension/Info.plist b/StreetDrop/ShareExtension/Info.plist index 4b1f7e70..2f118f8e 100644 --- a/StreetDrop/ShareExtension/Info.plist +++ b/StreetDrop/ShareExtension/Info.plist @@ -2,15 +2,17 @@ + GADApplicationIdentifier + ca-app-pub-7717835511859758~1784783942 NSExtension + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).ShareViewController NSExtensionAttributes NSExtensionActivationRule TRUEPREDICATE - NSExtensionMainStoryboard - MainInterface NSExtensionPointIdentifier com.apple.share-services diff --git a/StreetDrop/ShareExtension/View/Base.lproj/MainInterface.storyboard b/StreetDrop/ShareExtension/View/Base.lproj/MainInterface.storyboard deleted file mode 100644 index 286a5089..00000000 --- a/StreetDrop/ShareExtension/View/Base.lproj/MainInterface.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/StreetDrop/ShareExtension/View/ShareViewController.swift b/StreetDrop/ShareExtension/View/ShareViewController.swift index 281924cc..656f169a 100644 --- a/StreetDrop/ShareExtension/View/ShareViewController.swift +++ b/StreetDrop/ShareExtension/View/ShareViewController.swift @@ -10,25 +10,45 @@ import Social import RxSwift -final class ShareViewController: SLComposeServiceViewController { +final class ShareViewController: UIViewController { private let viewModel: ShareViewModel = .init() private let disposeBag: DisposeBag = .init() - override func isContentValid() -> Bool { - return true - } - - override func didSelectPost() { - extensionContext?.completeRequest(returningItems: [], completionHandler: nil) - } - - override func configurationItems() -> [Any]! { - return [] - } - override func viewDidLoad() { super.viewDidLoad() bindViewModel() + // 원하는 높이 지정 + preferredContentSize = CGSize(width: view.bounds.width, height: 602) + + view.backgroundColor = .white + + let label = UILabel() + label.text = "Custom Share Extension" + label.textAlignment = .center + label.translatesAutoresizingMaskIntoConstraints = false + + let button = UIButton(type: .system) + button.setTitle("Share", for: .normal) + button.addTarget(self, action: #selector(handleShare), for: .touchUpInside) + button.translatesAutoresizingMaskIntoConstraints = false + + view.addSubview(label) + view.addSubview(button) + + NSLayoutConstraint.activate([ + label.centerXAnchor.constraint(equalTo: view.centerXAnchor), + label.centerYAnchor.constraint(equalTo: view.centerYAnchor), + + button.topAnchor.constraint(equalTo: label.bottomAnchor, constant: 20), + button.centerXAnchor.constraint(equalTo: view.centerXAnchor) + ]) + } + + @objc func handleShare() { + // 공유 처리 로직 + + // 작업 완료 후 종료 + self.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil) } } diff --git a/StreetDrop/ShareExtension/ViewModel/ShareViewModel.swift b/StreetDrop/ShareExtension/ViewModel/ShareViewModel.swift index f574040d..0db256a0 100644 --- a/StreetDrop/ShareExtension/ViewModel/ShareViewModel.swift +++ b/StreetDrop/ShareExtension/ViewModel/ShareViewModel.swift @@ -21,6 +21,12 @@ protocol ShareViewModelType { final class ShareViewModel: NSObject, ShareViewModelType { private let output: Output = .init() private let locationManger: CLLocationManager = .init() + private let searchMusicUsecase: SearchMusicUsecase + private let disposeBag: DisposeBag = .init() + + init(searchMusicUsecase: SearchMusicUsecase = DefaultSearchingMusicUsecase()) { + self.searchMusicUsecase = searchMusicUsecase + } struct Input { let viewDidLoadEvent: Observable @@ -45,5 +51,25 @@ final class ShareViewModel: NSObject, ShareViewModelType { } extension ShareViewModel: CLLocationManagerDelegate { + func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { + guard let location = locations.last else { return } + + searchMusicUsecase.getVillageName( + latitude: location.coordinate.latitude, + longitude: location.coordinate.longitude + ) + .subscribe { villageName in + + } onFailure: { error in + + } + .disposed(by: disposeBag) + + manager.stopUpdatingLocation() + } + func locationManager(_ manager: CLLocationManager, didFailWithError error: any Error) { + // TODO: 요셉, 에러메세지 띄우기 + print("위치 정보를 가져오는데 실패했습니다: \(error.localizedDescription)") + } } diff --git a/StreetDrop/StreetDrop.xcodeproj/project.pbxproj b/StreetDrop/StreetDrop.xcodeproj/project.pbxproj index 17dc156d..9a5c4bf5 100644 --- a/StreetDrop/StreetDrop.xcodeproj/project.pbxproj +++ b/StreetDrop/StreetDrop.xcodeproj/project.pbxproj @@ -162,6 +162,7 @@ 6AAFD9AD2BCE55A4001A6772 /* LevelPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AAFD9AC2BCE55A4001A6772 /* LevelPolicy.swift */; }; 6AAFD9AF2BCE567A001A6772 /* FetchingLevelPolicyUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AAFD9AE2BCE567A001A6772 /* FetchingLevelPolicyUseCase.swift */; }; 6AAFD9B12BCE56A6001A6772 /* DefaultFetchingLevelPolicyUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AAFD9B02BCE56A6001A6772 /* DefaultFetchingLevelPolicyUseCase.swift */; }; + ADE9937EA437A957C3ABA1A1 /* libPods-ShareExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65CC40267A5C3004E2F36C6C /* libPods-ShareExtension.a */; }; B46578C32B00BC060024B066 /* LeftAlignedCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = B46578C22B00BC060024B066 /* LeftAlignedCollectionViewFlowLayout.swift */; }; B4B9EE842ADBDFFB000A6507 /* RecommendMusicSearchCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B9EE832ADBDFFB000A6507 /* RecommendMusicSearchCollectionView.swift */; }; B4B9EE862ADEB2AC000A6507 /* RecommendKeywordItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B9EE852ADEB2AC000A6507 /* RecommendKeywordItemCell.swift */; }; @@ -191,7 +192,6 @@ C41BD2E92A38467A0090EF2B /* UIImageView+ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = C41BD2E82A38467A0090EF2B /* UIImageView+ImageCache.swift */; }; C41BD2EC2A3848880090EF2B /* UIImage+loadURLImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C41BD2EB2A3848880090EF2B /* UIImage+loadURLImage.swift */; }; C41BD2ED2A3848880090EF2B /* UIImage+loadURLImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C41BD2EB2A3848880090EF2B /* UIImage+loadURLImage.swift */; }; - C42182C02C697F9700B73A99 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = C42182BF2C697F9700B73A99 /* Base */; }; C42182C42C697F9700B73A99 /* ShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = C42182BA2C697F9700B73A99 /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; C42361782B0CE8F800F61E3C /* RecommendMusic.swift in Sources */ = {isa = PBXBuildFile; fileRef = C42361772B0CE8F800F61E3C /* RecommendMusic.swift */; }; C432DE052C69D963003DBA18 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = C432DE042C69D963003DBA18 /* RxCocoa */; }; @@ -573,6 +573,7 @@ 08F574572C46985300635B54 /* DefaultFetchingMyLikeListUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFetchingMyLikeListUseCase.swift; sourceTree = ""; }; 08F5745A2C4698B300635B54 /* FetchingMyLevelUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchingMyLevelUseCase.swift; sourceTree = ""; }; 08F5745C2C46992500635B54 /* DefaultFetchingMyLevelUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFetchingMyLevelUseCase.swift; sourceTree = ""; }; + 13ACF3C8F07C1A2CFE303F4A /* Pods-ShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShareExtension.debug.xcconfig"; path = "Target Support Files/Pods-ShareExtension/Pods-ShareExtension.debug.xcconfig"; sourceTree = ""; }; 1816ED3B2A680608005009FC /* MusicListSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicListSectionHeaderView.swift; sourceTree = ""; }; 1816ED3E2A68064E005009FC /* MyPageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageViewModel.swift; sourceTree = ""; }; 1816ED402A685704005009FC /* NicknameEditViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NicknameEditViewModel.swift; sourceTree = ""; }; @@ -654,6 +655,7 @@ 41FF58F92A06B38800ABB871 /* NetworkManagerTest.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NetworkManagerTest.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 41FF58FB2A06B38800ABB871 /* NetworkManagerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManagerTest.swift; sourceTree = ""; }; 642A4AE13B198B9F5F5F76E4 /* libPods-StreetDrop.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-StreetDrop.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 65CC40267A5C3004E2F36C6C /* libPods-ShareExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ShareExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 6A1386AA2B4F8A5000E49BB5 /* String+Base64.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Base64.swift"; sourceTree = ""; }; 6A26BF312B33D1E40007B6B7 /* FetchingSingleMusicUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchingSingleMusicUseCase.swift; sourceTree = ""; }; 6A26BF332B33D2210007B6B7 /* DefaultFetchingSingleMusicUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFetchingSingleMusicUseCase.swift; sourceTree = ""; }; @@ -675,6 +677,7 @@ 6AAFD9AC2BCE55A4001A6772 /* LevelPolicy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LevelPolicy.swift; sourceTree = ""; }; 6AAFD9AE2BCE567A001A6772 /* FetchingLevelPolicyUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchingLevelPolicyUseCase.swift; sourceTree = ""; }; 6AAFD9B02BCE56A6001A6772 /* DefaultFetchingLevelPolicyUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFetchingLevelPolicyUseCase.swift; sourceTree = ""; }; + B20DBB514344BC89E684862A /* Pods-ShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShareExtension.release.xcconfig"; path = "Target Support Files/Pods-ShareExtension/Pods-ShareExtension.release.xcconfig"; sourceTree = ""; }; B46578C22B00BC060024B066 /* LeftAlignedCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftAlignedCollectionViewFlowLayout.swift; sourceTree = ""; }; B4B9EE832ADBDFFB000A6507 /* RecommendMusicSearchCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendMusicSearchCollectionView.swift; sourceTree = ""; }; B4B9EE852ADEB2AC000A6507 /* RecommendKeywordItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendKeywordItemCell.swift; sourceTree = ""; }; @@ -704,7 +707,6 @@ C41BD2EB2A3848880090EF2B /* UIImage+loadURLImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+loadURLImage.swift"; sourceTree = ""; }; C42182BA2C697F9700B73A99 /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; C42182BC2C697F9700B73A99 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; - C42182BF2C697F9700B73A99 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; C42182C12C697F9700B73A99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C42182CB2C69C41800B73A99 /* ShareViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewModel.swift; sourceTree = ""; }; C42361772B0CE8F800F61E3C /* RecommendMusic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecommendMusic.swift; sourceTree = ""; }; @@ -856,6 +858,7 @@ C4C9D5A82C69FBCB005D90C4 /* RxMoya in Frameworks */, C432DE052C69D963003DBA18 /* RxCocoa in Frameworks */, C4C9D5A62C69FBCB005D90C4 /* ReactiveMoya in Frameworks */, + ADE9937EA437A957C3ABA1A1 /* libPods-ShareExtension.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1723,6 +1726,7 @@ isa = PBXGroup; children = ( 642A4AE13B198B9F5F5F76E4 /* libPods-StreetDrop.a */, + 65CC40267A5C3004E2F36C6C /* libPods-ShareExtension.a */, ); name = Frameworks; sourceTree = ""; @@ -1749,7 +1753,6 @@ isa = PBXGroup; children = ( C42182BC2C697F9700B73A99 /* ShareViewController.swift */, - C42182BE2C697F9700B73A99 /* MainInterface.storyboard */, ); path = View; sourceTree = ""; @@ -2113,6 +2116,8 @@ children = ( 33C6E9256EDABFB58F83B1C8 /* Pods-StreetDrop.debug.xcconfig */, 2611E7411DB7C5436A272A27 /* Pods-StreetDrop.release.xcconfig */, + 13ACF3C8F07C1A2CFE303F4A /* Pods-ShareExtension.debug.xcconfig */, + B20DBB514344BC89E684862A /* Pods-ShareExtension.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -2243,6 +2248,7 @@ isa = PBXNativeTarget; buildConfigurationList = C42182C82C697F9700B73A99 /* Build configuration list for PBXNativeTarget "ShareExtension" */; buildPhases = ( + 7AC41A8E2B2F8DC531DD276C /* [CP] Check Pods Manifest.lock */, C42182B62C697F9700B73A99 /* Sources */, C42182B72C697F9700B73A99 /* Frameworks */, C42182B82C697F9700B73A99 /* Resources */, @@ -2355,7 +2361,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C42182C02C697F9700B73A99 /* Base in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2382,6 +2387,28 @@ shellPath = /bin/sh; shellScript = "\"${BUILD_DIR%Build/*}SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run\"\n"; }; + 7AC41A8E2B2F8DC531DD276C /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-ShareExtension-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; AAAD975E0D7F49C08E568D59 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2931,14 +2958,6 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; - C42182BE2C697F9700B73A99 /* MainInterface.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C42182BF2C697F9700B73A99 /* Base */, - ); - name = MainInterface.storyboard; - sourceTree = ""; - }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -3195,6 +3214,7 @@ }; C42182C62C697F9700B73A99 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 13ACF3C8F07C1A2CFE303F4A /* Pods-ShareExtension.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CODE_SIGN_IDENTITY = "Apple Development"; @@ -3227,6 +3247,7 @@ }; C42182C72C697F9700B73A99 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = B20DBB514344BC89E684862A /* Pods-ShareExtension.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CODE_SIGN_IDENTITY = "Apple Distribution"; diff --git a/StreetDrop/StreetDrop/Application/AppDelegate.swift b/StreetDrop/StreetDrop/Application/AppDelegate.swift index d55ba72d..527e8fe2 100644 --- a/StreetDrop/StreetDrop/Application/AppDelegate.swift +++ b/StreetDrop/StreetDrop/Application/AppDelegate.swift @@ -95,7 +95,9 @@ private extension AppDelegate { func setupAppDependencies() { FirebaseApp.configure() NMFAuthManager.shared().clientId = Bundle.main.naverMapsClientID - GADMobileAds.sharedInstance().start(completionHandler: nil) + if Bundle.main.bundlePath.hasSuffix(".appex") == false { + GADMobileAds.sharedInstance().start(completionHandler: nil) + } UNUserNotificationCenter.current().delegate = self Messaging.messaging().delegate = self }