0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

個人開発的備忘録

Posted at

Android

フィンガープリント取得

フィンガープリント取得 from gradle

  1. Click on Gradle (From Right Side Panel, you will see Gradle Bar)
  2. Click on Tasks
  3. Click on Android
  4. Double Click on signingReport (You will get SHA-1 and MD5)

App bundle の作り方

key store は xxx.jks で作られるのできちんと保存管理する。

プロダクション用のFirebase Auth には、

Google developer console のアップロード鍵の証明書に紐ついた
SHA1, SHA256
のものを使う
アプリ署名鍵の証明書
ではないことに注意

dev の時は、

google-services.json
      "oauth_client": [
        {
          "client_id": "xxxx",
          "client_type": 1,
          "android_info": {
            "package_name": "xxxxx",
            "certificate_hash": "xxxx"
          }
        },
        {
          "client_id": "yyyy",
          "client_type": 3
        }

のyyyyをアプリに書くとうまくいく

prodの時は、

google-services.json
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "xxxx",
        "android_client_info": {
          "package_name": "xxxx"
        }
      },
      "oauth_client": [
        {
          "client_id": "yyyy",
          "client_type": 1,
          "android_info": {
            "package_name": "yyyy",
            "certificate_hash": "yyyy"
          }
        },
        {
          "client_id": "zzzzz",
          "client_type": 3
        }

このzzzzでやるとやらかしてた。
結局署名鍵のSHA1でよかった。間違ってなかった。
鍵を更新して(作り直して)登録し直すと動いた。
あまりにもハマったので別記事
https://qiita.com/kenmaro/items/a0faf8795f628d80702c
で供養した。

内部テスト公開したAndroidアプリ上ででFirebase Google Auth が動作しない

Google developer console のアップロード鍵の証明書に紐ついた
SHA1, SHA256
をFirebase のマネジメントコンソールに登録
その後にダウンロードしたgoogle-services.json
に基づいたclient_idを指定しているにもかかわらず、動作しない

iOS Xcode

環境分け

dynamic links 設定

dynamic links 設定 xcode

dynamic links で、Firebase に設定し、アプリがデバイスにあるにも関わらずApp store に飛んで見つからない時の対処法

設定しているAssociated Domainを

applinks:xxx.page.link

から

applinks:xxx.page.link?mode=developer

に変更する

Web

firebase deploy

export .env to env

export $(cat .env| grep -v "#" | xargs)

firebase change project

firebase logout
firebase login
firebase init
firebase use xxx

React Env

.env.development
.env.staging
.env.production
package.json
    "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "build:staging": "REACT_APP_ENV=staging yarn build",
        "build:production": "REACT_APP_ENV=production yarn build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
    },

上のpackage.jsonではうまくいかなかったので、

npm install -g env-cmd

とした後、

package.json
    "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "build:staging": "env-cmd -f .env.staging npm run build",
        "build:production": "env-cmd -f .env.production npm run build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
    },

npm run build:staging
npm run build:production

などでうまくいった。

npm run build
npm run build:staging
npm run build:production

npm install -g serve
serve -s build
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?