質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Q&A

解決済

1回答

913閲覧

FBSDKPaymentObserverでのエラー

takahiro00

総合スコア84

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

0グッド

0クリップ

投稿2019/08/03 02:33

編集2019/08/03 02:40

前提・実現したいこと

swiftでFirebaseを使ってtwitterのログイン機能を作ろうとしてるのですが、
FBSDKPaymentObserver.mファイルでエラーが出てしまいます。
ネットで調べても解決策が見つからず、
ご教授頂ければと思います。

以下のサイトを参考に作成しています。
リンク内容

発生している問題・エラーメッセージ

イメージ説明

Property 'paymentDiscount' not found on object of type 'SKPayment *' Property 'discounts' not found on object of type 'SKProduct *' Property 'identifier' not found on object of type 'SKProductDiscount *'

該当のソースコード

ViewController.swift

swift

1import UIKit 2import Firebase 3import FirebaseUI 4 5class ViewController: UIViewController,FUIAuthDelegate { 6 7 @IBOutlet weak var AuthButton: UIButton! 8 9 var authUI: FUIAuth { get { return FUIAuth.defaultAuthUI()!}} 10 // 認証に使用するプロバイダの選択 11 let providers: [FUIAuthProvider] = [ 12 FUITwitterAuth(), 13 ] 14 15 override func viewDidLoad() { 16 super.viewDidLoad() 17 // authUIのデリゲート 18 self.authUI.delegate = self 19 self.authUI.providers = providers 20 AuthButton.addTarget(self,action: #selector(self.AuthButtonTapped(sender:)),for: .touchUpInside) 21 } 22 23 @objc func AuthButtonTapped(sender : AnyObject) { 24 // FirebaseUIのViewの取得 25 let authViewController = self.authUI.authViewController() 26 // FirebaseUIのViewの表示 27 self.present(authViewController, animated: true, completion: nil) 28 } 29 30 // 認証画面から離れたときに呼ばれる(キャンセルボタン押下含む) 31 public func authUI(_ authUI: FUIAuth, didSignInWith user: User?, error: Error?){ 32 // 認証に成功した場合 33 if error == nil { 34 self.performSegue(withIdentifier: "toTopView", sender: self) 35 } 36 // エラー時の処理をここに書く 37 } 38} 39

↓AppDelegate.swift

swift

1import UIKit 2import Firebase 3import FirebaseUI 4import TwitterKit 5 6@UIApplicationMain 7class AppDelegate: UIResponder, UIApplicationDelegate { 8 9 var window: UIWindow? 10 11 override init() { 12 super.init() 13 // Firebase関連の機能を使う前に必要 14 FirebaseApp.configure() 15 } 16 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 //Twitter認証用のイニシャライズ 18 TWTRTwitter.sharedInstance().start(withConsumerKey:"XXXXX",consumerSecret:"XXXXX") 19 return true 20 } 21 22// func application(_ application: UIApplication, 23// didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) 24// -> Bool { 25// FirebaseApp.configure() 26// return true 27// } 28 29 func applicationWillResignActive(_ application: UIApplication) { 30 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 31 // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 32 } 33 34 func applicationDidEnterBackground(_ application: UIApplication) { 35 // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 36 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 } 38 39 func applicationWillEnterForeground(_ application: UIApplication) { 40 // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 41 } 42 43 func applicationDidBecomeActive(_ application: UIApplication) { 44 // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 45 } 46 47 func applicationWillTerminate(_ application: UIApplication) { 48 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 } 50 51 52} 53

Podfileは以下のように書いています。

# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'SwiftTest01' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for SwiftTest01 pod 'Firebase/Database' #pod 'MessageKit', '>= 1.0.0' #pod 'MessageKit' pod 'JSQMessagesViewController' #pod 'MessageInputBar' pod 'FirebaseUI' pod 'Firebase/Core' end

試したこと

クリーンビルド等しましたが、解決せず

補足情報(FW/ツールのバージョンなど)

swift 4.0
xcode 9.0
--追記---
色々調べてみると、FBSDKPaymentObserverはFacebookでのログイン認証のためのファイルのようなのですが、
Facebookでのログインはさせないので、バグがなくなるならば外してしまいたのですが、、、、
そもそもどこから入ってきたファイルなのか分からず、、、、

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

pod 'FirebaseUI/Auth'
pod 'FirebaseUI/Twitter
↑で必要なプロバイダのみインストールしたら直りました

投稿2019/08/03 09:06

takahiro00

総合スコア84

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問