アプリなどを開発するブログ

React Native / Swift / Ruby on Railsなどの学習メモ。


Connection to http://localhost:8081/debugger-proxy?role=client timed out. Are you running node proxy? If you are running on the device, check if you have the right IP address in `RCTWebSocketExecutor.m

React Nativeで実機確認しようとしたら出たエラー。
Stop Remote Debugすれば治ります。
実機では、開発メニューは、実機をシェイク(物理的に振る)すると、出てきます。

iPhone で何度も「サインインが必要です [mail] のパスワードを入力してください」と表示される

現在調査中。

考えられる理由の1つは、finishTransactionでちゃんと終了できていないtransactionが存在すること。

参考記事

swift – itunes store にサインイン画面が何度も表示される – まとまりのないブログ

ただ、これは全部終了してるので問題なさそう。

英語の記事漁ってるとapple developerのフォーラムこんなページが。

forums.developer.apple.com

回答全文

Apple answered, but I already do what they say. I also do not want to reset my device. How am I supposed to solve this problem?

 

Answer :

<. I also created a sandbox account to test. But then I forgot the information of this account.>

Your issue may be due to one or more of the following reasons:

 

-You are running into a transient bug with the App Store. The workaround is restore the device to the latest iOS version. Note that doing so will reset your device to its factory default settings.
 

Create a new test user account in iTunes Connect. Make sure that you are signed out of the Store on your device before starting to test In-App Purchase on your device. Build and launch your app on your device, enter the new test user account when prompted by StoreKit to authenticate the purchase. Be sure to always use sandbox test user accounts created in iTunes Connect to test your In-App Purchase products. StoreKit connects to the sandbox environment when you launch your application from Xcode, from your test device (iOS), or from the Finder (OS X). It connects to a production environment for applications that were downloaded from the App Store. You must not use your test user account to sign into the production environment. This will result in your test user account becoming invalid. Invalid test accounts cannot be used to test In-App Purchase again.

-You may have an unfinished transaction.  As such, you need to call finishTransaction: on the associated transaction to end the loop to resolve your issue. See TN2387 In-App Purchase Best Practices > Add a transaction queue observer at application launch  and Finish the transaction for more information  on how to prevent this issue.

-You are calling SKReceiptRefreshRequest or restoreCompletedTransactions, which is prompting you to enter your username and password. If calling restoreCompletedTransactions, see When should I use SKPaymentQueue’ s restoreCompletedTransactions method? for more information. If calling SKReceiptRefreshRequest, that would be the expected behavior.

accounts and it works properly. Even though I am deleted from the sandbox , the account continues to ask. >

If your device still prompts you to log in with a deleted test user account, restore your device to the latest iOS version. Note that doing so will reset your device to its factory default settings.

Be sure to not restore your device’s back up. Make sure that you are signed out of the Store on your device before starting to test In-App Purchase on your device. Build and launch your app on your device, enter the new test user account when prompted by StoreKit to authenticate the purchase.

モダンなshell、fish を導入する

f:id:device_me:20180223100752p:plain

fishとは?

「shell はだいたいこういうカスタマイズするよね〜」というものがだいたい最初から整ってるshellって感じです。
zshなどに比べて導入やカスタマイズが容易。
zshbashとカスタマイズ方法やPATHの通し方が異なっていたりするので、少し導入を躊躇していましたが、
結構導入している人多そうだったので思い切って移行してみることにしました。
結論としてはめっちゃオススメです。

fishshell.com

fish 導入

$ brew install fish
$ sudo vi /etc/shells  #  /usr/local/bin/fish を追記する
$ chsh -s /usr/local/bin/fish # デフォルトのshellを変更

fisherman (プラグインマネージャ) 導入

$ curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs https://git.io/fisher

各種プラグイン導入

個人的に必須なのは z と peco

$ fisher z

$ z hoge # hoge にマッチするディレクトリが移動履歴の中にあれば移動 $ zo hoge # 上記と同様だが、該当ディレクトリをFinder で開

$ brew install peco # peco入ってなければインストール
$ fisher oh-my-fish/plugin-peco

~/.config/fish/config.fish

function fish_user_key_bindings
  bind \cr 'peco_select_history (commandline -b)'
end

anyenv のセットアップ

anyenvに関してはこちらのエントリを参考にしました。 patorash.hatenablog.com

超快適!オススメです。

参考記事

dev.classmethod.jp

qiita.com

qiita.com

futurismo.biz

Facebook messengerで送られてきた音声ファイルをダウンロードする

最近は仕事でFacebookメッセンジャーを使うこともしばしば。

ちょっとしたファイルの受け渡しにもよく利用させていただいてます。
zipなどはクリックしてダウンロードできるのですが、
音声ファイルはmessenger上で再生できるようになっており、
その代わりにダウンロードができません。

  1. Cmd + Shift + i を押してWeb Inspectorを開く

  2. Applicationタブを選択

  3. messenger上でダウンロードしたい音源の再生ボタンを押す

  4. 左サイドバーの「Frames > top > Media」ディレクトリ内にaudioclip-XXXXXXXXX.mp4 という項目をダブルクリック

f:id:device_me:20171031114223p:plain

  1. ファイルのダウンロードが開始されます。

  2. なぜか「mp4」なので拡張子をmp3に変更

  3. 完成!