リファレンスやgithubを見ているときに気になる英単語

garbled characters https://github.com/flutter/flutter/issues/55283 consecutive https://dart.dev/articles/libraries/creating-streams Splits a stream of consecutive strings into lines. decipher https://developer.android.com/codelabs/basic-an…

node-apple-receipt-verify PurchasedProductsにoriginalTransactionIdがない

Adding in-app purchases to your Flutter app | Google Codelabs import * as appleReceiptVerify from "node-apple-receipt-verify"; // Add typings for missing property in library interface. declare module "node-apple-receipt-verify" { interface…

tsconfigでよく問題になるオプション

随時追記 esModuleInterop https://www.typescriptlang.org/tsconfig#esModuleInterop Recommended: true Default: false falseの場合これで動く import * as parse from 'csv-parse/lib/sync'; parse(input, { columns: true, // 一行目をフィールドのkeyと…

flutter firestore_ref 3階層のコレクションをFactory constructorsで取得しやすくしてみる

/** * 親の親がorganizations,親がprojects */ class TeamsRef extends CollectionRef<Team, TeamDoc, TeamRef> { TeamsRef(this.cr) : super(cr); final CollectionReference<Map<String, dynamic>> cr; // 作ってみたもののあんまり意味がない factory TeamsRef.parentDoc(ProjectDoc doc) => TeamsRef(d</map<string,></team,>…

Firestore data bundles から余分な数字を取り除いて整形されたjsonでファイルに出力する

FlutterFireが新しくなったという下記の記事を見てdata bundlesのサンプルを書いてみることにしました。 invertase.io data bundles自体の詳細はこっち Cloud Firestore data bundles | Firebase サンプルを書いてるうちに中身を出力してみたくなりました。 …

Android エミュレータでGoogle アカウントに自動でログインする方法はないのか?

Play Billingなどを使う場合は、前もってgoogleアカウントにログインしておく必要があります。 エミュレータを初期化するなどすると消えてしまうのでその度ログインするのは面倒です。 今のところUI Automatorだけ成功 flutter_driverでなんとかする 現状で…

bash 現在ディレクトリ配下のディレクトリを全部git pushする

ls | xargs -r -I $ git -C ./$ push origin main push し忘れがないか心配になった時に使う

android-basics-kotlin/course 並行処理以降のチュートリアルで気になったこと

チュートリアルへの入り口 Android Basics in Kotlin course | Kotlin を用いた Android の基本 we don't recommend working with threads directly. Introduction to coroutines | Android Developers Performance issues, race conditions, and hard to re…

Flutter platformの判定

Platform.operatingSystemはエミュレータでは期待通りになるけど、 widget testなどでは、当たり前だけど、テストを実行しているパソコンのOS(windowsとかmac)になる。 Platform.isIOS,Platform.isAndroidなども同様。 さらにテスト時だけ変更したいなんてこ…

m1 mac flutter runでエラー

### Error LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 9): no suitable image found. Did find: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle: mach-o, but wrong architecture /Library/Ruby/Gems/2.6…

Flutter Android用のリソースIDが設定できない

play consoleのリリース前レポートの設定で認証情報にリソースIDを設定するところがあって、 flutterではどうやるんだろうと調べていたら下記のissueに辿り着きました。 github.com 結論としては、できないそうです。

Flutter in_app_purchase(android)の参考になるURLやハマりポイント

verifyPurchase pluginのreadmeを見ると下記のリンクが貼ってある Fight fraud and abuse | Google Play's billing system で上に書いてあることをそのまま実践しているようなfunctionsのソースが下記にあります。 play-billing-samples/PurchasesManager.ts…

hooks_riverpod useProvider is removed in favor of HookConsumerWidget

https://pub.dev/packages/hooks_riverpod/versions/1.0.0-dev.2/changelog ConsumerWidgetみたいに、build()の引数が一つ増えてref.watch()にproviderを入れるようです。 理由としては下記のようです。 [RFC] Unifying syntax for listening to providers (…

flutter chart

google Gallery | charts 簡素 flutter gallery gallery/lib/studies/rally/charts at master · flutter/gallery · GitHub mathでいろいろ計算しているし、chartの部分だけ取り出しづらい。 fl_chart github.com おしゃれだけど、個人リポジトリ 下記でも使…

Flutter プロジェクト直下にexampleディレクトリがあるとGeneratedPluginRegistrant.javaが生成されない

GeneratedPluginRegistrant.javaはflutter pub getで普通は作成されますが、 exampleディレクトリがプロジェクトの直下にあるときは作成されません。 この現象は普段開発している時には気付きにくいので凶悪です。 GeneratedPluginRegistrantはflutter clean…

Play アプリ署名

鍵、アーティファクト、ツールの説明 Play アプリ署名を使用する - Play Console ヘルプ 英語版 flutterのリファレンスが英語なので、比較するときに便利 Use Play App Signing - Play Console Help 英語版Sign your app Sign your app | Android Developers…

App内課金調査(ios)

App Store サーバー通知 functionsで実装 https://help.apple.com/app-store-connect/?lang=ja#/dev0067a330b App Store サーバー通知は、サブスクリプションのステータスの変更や App 内課金の払い戻しなど、App 内課金に関連する主要なイベントについての…

android チュートリアルで発見したこと

久しぶりにチュートリアルやると発見があったりしていいんだろうなぁ。 Flutterの理解が深まる 日本語で詳しく書いてある。プログラマ未経験の人にもわかりやすいくらい。 ビュー バインディングは findViewById の後継 ビュー バインディング | Android デ…

Access to 'viewBinding' exceeds its access rights

build.gradleをgroovyで書かなければいけないところKotlin方式で書いたから起きた。 具体的には下記のようにイコールを入れてしまった。 buildFeatures { viewBinding = true } なんでそんなことが起きたかと言うと、チュートリアルがそうなってたから。 チ…

firebaseの知識棚卸し

messaging getTokenを実行するたびにtokenが変わったりしない。 chromeでデバック実行するときは毎回tokenがリフレッシュされるので変わる 送信系のメソッド(admin) sendMulticast tokenはstring[] sendAll notificationも毎回セットしないといけないから、…

excelテーブル定義書は必要か?

RDBでもNoSQLでも最終的にオブジェクトに変換しないといけないから、 行列で物事を考えることに無駄がありそう。 ※大規模なバッチシステムとかは別として。 jsonをそのまま格納できる場合でも、json設計をする場合はツール選定が難しい。 また、jsonにはコメ…

Google Play Console周りの疑問

内部テストのアプリ内課金は本当に無料? オープンテスト版、クローズド テスト版、内部テスト版をセットアップする - Play Console ヘルプ 支払い: 有料アプリの場合でも、テスターは無料で内部テスト版をインストールできます。ライセンス テスターのリス…

typescript ブラケットでプロパティを参照するときの問題

node v12.22.0 typescriptでブラケット記法でプロパティを参照しようとすると下記のようになる。 function mergeDtoWithFirestoreRecord(dto: DTO, firestoreObject: any) { Object.keys(firestoreObject).map((key: string) => { // Element implicitly has…

typescript outDirにjsonも含める

tsconfig.jsonに"resolveJsonModule": trueを加える { "compilerOptions": { "module": "commonjs", "noImplicitReturns": true, "noUnusedLocals": false, "outDir": "lib", "sourceMap": true, "strict": true, "target": "es2019", "resolveJsonModule": …

Firebase Functions と AWSで作られた既存のシステムを安全に繋ぐ

結論はありません。 SSOが必要な場合 既存のサーバで使ってる言語に合うFirebaseのSDKを探してくる Firebase Authでsign inできたら既存のシステムのセッションを作り出す 新しくEC2を立ててRDSにつないで、apiを作ってFunctionsからたたく webフレームワー…

Firestore updatedAtとcreatedAt

admin sdkなら取得できる https://googleapis.dev/nodejs/firestore/latest/DocumentSnapshot.html client側にはなさそう https://firebase.google.com/docs/reference/js/firebase.firestore#documentdata なので、特にアプリで使用しないのなら、Firestore…

今日Android Studioで起きたエラー

Android Studio Arctic Fox | 2020.3.1 Canary 14 Build #AI-203.7717.56.2031.7260174, built on April 6, 2021 Runtime version: 11.0.9.1+0-b77-7246554 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 10.16 GC: G1 Young Generation, …

Unsupported operation: Platform._operatingSystem

Platform.isAndroidなどを使ってるコードをうっかりchromeで実行しようとしたときに発生

Flutter(android) 定期購入を実装するための準備

まず初めに in_app_purchaseで実装しようかなと思った時にまず下記を参照すると思います。 plugins/packages/in_app_purchase/in_app_purchase/example at master · flutter/plugins · GitHub そうするとAndroidはPlay Consoleで商品を登録しないといけない…

FunctionsでStorageからcsvをダウンロードしてFirestoreに投入

前提 CSVファイルはあらかじめStorageにアップしてある。 本番では管理画面からアップロードする想定。 公式のサンプルを見れば誰でも作れる functions-samples/index.js at master · firebase/functions-samples · GitHub 書いたソース firebase-practice/f…