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

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

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

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

React Native

React Nativeは、ネイティブモバイルアプリ(iOS/Android)を作成できるJavaScriptフレームワークです。Reactと同じ設計のため、宣言的なコンポーネントでリッチなUIを開発することが可能です。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Q&A

解決済

1回答

2196閲覧

facebook authでRNFirebaseエラーが出てしまっている(react native)

yamady

総合スコア176

Firebase

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

React Native

React Nativeは、ネイティブモバイルアプリ(iOS/Android)を作成できるJavaScriptフレームワークです。Reactと同じ設計のため、宣言的なコンポーネントでリッチなUIを開発することが可能です。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

0グッド

0クリップ

投稿2018/02/02 03:56

いつもお世話になっています。
React Nativeでアプリ開発を始めた初心者です。

最近はReact Nativeのエラー赤画面が夢にまで出てくるようになりました(汗)
今、Facebook認証を実現したいと思って、昨日react-native-firebaseドキュメントをみながら、こちらやってみたのですが、どうもやり方を混乱してしまい、せっかく親切な方にすぐにご回答いただいたのですが(本当にありがとうございます!)

下記のURLをみながらやり直してみました。
https://codeburst.io/react-native-app-with-facebook-sdk-login-and-firebase-storage-606744701207

こちらは公式のドキュメントと異なり、react-native-facebook-loginを使っているみたいです。

ですが、やはり途中でエラーから抜けられなくなってしまいました。

エラー

シュミレーター上

ExceptionsManager.js:65 RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects `Podfile` and have run `pod install`.

Xcode上

ld: warning: object file (/Users/shyamada/Library/Developer/Xcode/DerivedData/fbutton-hhjdppbukqrtchehuzbsjrzuqglf/Build/Products/Debug-iphonesimulator/libPods-fbutton.a(Pods-fbutton-dummy.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: framework not found FBSDKLoginKit for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

ターミナル上

** BUILD FAILED ** The following build commands failed: Ld build/Build/Products/Debug-iphonesimulator/fbutton.app/fbutton normal x86_64 (1 failure) Installing build/Build/Products/Debug-iphonesimulator/fbutton.app An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22): Failed to install the requested application The bundle identifier of the application could not be determined. Ensure that the application's Info.plist contains a value for CFBundleIdentifier. Print: Entry, ":CFBundleIdentifier", Does Not Exist Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/fbutton.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist

ソースコード

公式にしたがって、Firebaseの設定をしたのちに下記のコードを書きました。

Podfile

# Uncomment the next line to define a global platform for your project platform :ios, '9.0' target 'fbutton' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # Pods for fbutton # Required by RNFirebase pod 'Firebase/Core' pod 'Firebase/Auth' end

App.js

import React, { Component } from 'react'; import { StyleSheet, Text, View, Button } from 'react-native'; import { handleFbLogin } from './src/lib/auth'; export default class App extends Component<{}> { render() { return ( <View style={styles.container}> <Button onPress={handleFbLogin} title="Sign in with facebook" color="#3c50e8" /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', } });

config/auth.js

import { FBLoginManager } from 'react-native-facebook-login'; const Facebook = { login: (permissions) => { return new Promise((resolve, reject) => { FBLoginManager.loginWithPermissions(permissions || ['email'], (error, data) => { if (!error) { resolve(data.credentials.token); } else { reject(error); } }); }); }, logout: () => { return new Promise((resolve, reject) => { FBLoginManager.logout((error, data) => { if (!error) { resolve(true); } else { reject(error); } }); }); } } const Auth = { Facebook }; export default Auth;

config/firebase.js

import RNFirebase from 'react-native-firebase' const configurationOptions = { debug: true } const firebase = RNFirebase.initializeApp() export default firebase;

constants/index.js

export const fbLoginPermissions = ['email'];

lib/auth/index.js

import { fbLoginPermissions } from '../../constants/index'; import firebase from '../../config/firebase'; import Auth from '../../config/auth'; export const handleFbLogin = () => ( Auth.Facebook.login(fbLoginPermissions) .then((token) => { firebase.auth() .signInWithCredential(firebase.auth.FacebookAuthProvider.credential(token)) }) .catch((err) => this.onError && this.onError(err)) );

試してみたこと

StackOverflowなどみながら
pod install、pod update、pod outdateはそれぞれ何度も繰り返しました
Podfileのuser_frameworks!コメントアウトもしてみましたが効果なしです(涙)

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

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

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

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

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

guest

回答1

0

自己解決

公式のドキュメントを見ながら進めてみたら解決しました!

https://rnfirebase.io/docs/v3.2.x/auth/social-auth

投稿2018/02/04 05:56

yamady

総合スコア176

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

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

kurisu_0404

2019/03/02 05:45 編集

私も、現在同じエラー出ています。。。 どのようにして解決したのか教えていただけますでしょうか?
yamady

2019/03/09 05:16

返事遅れてしまい、すみません。 どのあたりでスタックしておりますでしょうか?
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問