今までSandboxで課金テスト出来ていたのが、突如レシートの検証が失敗するようになった。

今までSandboxで課金テスト出来ていたのが、iOSのみ突如レシートの検証が失敗するようになった。

購入処理はうまくいくのにレシート検証で失敗するようで以下のようなエラーが出た。

Validation failed:/Client/ValidateIOSReceipt:iTunes Sandbox validation result:21003
(AuthnticationFailed) from https://sandbox.itunes.apple.com/verifyReceipt

最近変えたところといえば、アプリ内課金にサブスクリプションを追加したこと。

しかし追加しようとしているSubscription以外の、ジェムの購入でもエラーが出るようになってしまった。

レシートの検証にはPlayFabを使っている。

はてっ???

いろいろ調べ、知人に相談し、ようやく解決。

結論としてはPlayFabでアプリ共有シークレット(App-Specific Shared Secret)を設定したら解決しました。

1.App Store Connect でApp-Specific Shared Secretを作る。


2.上記で出来たキーをPlayFabで設定する。

How to upload to Unityroom

Preparation

WebGL Build

Select WebGL in Build Settings.

f:id:wkpn:20220214224106p:plain

Select Gzip as a compression format in Player Settings.

f:id:wkpn:20220214224122p:plain

Twitter account

You need a Twitter account to log in to Unityroom.


Procedure

1. Log in to Unityroom

Access the Unityroom and press "New user registration / login" button on the upper right.

f:id:wkpn:20220214224329p:plain


Please read the terms of use and if you agree to them, please authenticate through the Twitter button.

f:id:wkpn:20220214225219p:plain

If you log in successfully, the header menu will change and you will see the Twitter icon.

f:id:wkpn:20220214225312p:plain


2. Create a new game

Header-> Register Game

f:id:wkpn:20220214225700p:plain

Enter the title, game ID and brief description, then press Register.

title

The title of the game.

Game ID
  • This is a string that will be used as part of the URL.
  • You are free to determine this.
  • Only alphanumeric characters, hyphens, and underscores can be used.

If the registration is successful, you will be taken to the basic information edit screen.

f:id:wkpn:20220214225935p:plain

Game setting items are lined up in the side menu.

It is not necessary to set everything in detail.
I will explain the only items which is essential here.

f:id:wkpn:20220214230022p:plain


3. Icon registration

Sidebar "Basic information" menu

f:id:wkpn:20220214230201p:plain

Select the icon to update. You can change the title and description as needed.


4. WebGL upload

Sidebar "WebGL settings" menu

f:id:wkpn:20220214230509p:plain

Select the Unity version here. Please fill in the screen size, how to play, and memory usage as you like.

Sidebar "WebGL upload" menu

f:id:wkpn:20220214230713p:plain

Upload the file output from Unity. Look carefully at the extension and make sure you select it correctly.

f:id:wkpn:20220214230756p:plain

If the upload is successful, the screen will be refreshed and the file size etc. will be displayed at the bottom of the page.

5. Live Policy

f:id:wkpn:20220215143916p:plain

6. Publishing settings

Sidebar "Publishing settings" menu

f:id:wkpn:20220214230915p:plain

If you have completed at least the icon and WebGL upload, you can publish it. Please select your preferred publishing setting.

気がつくとM-1 Max Macが異様に重くなる現象に悩まされた

M-1 MaxのMacを買ったのだけれど、1日使っていると1日の終わり頃にめちゃくちゃ重くなって困っていた。IMEの変換でしびれを切らすほど重かった。

なんでだろうと調べてみると、sshのプロセスが多数存在していた。どうもgitがsshを使ってそれが残り続けているっぽかった。調べても理由はよくわからなかったのだが、とりあえずsshタイムアウト時間を設定することで対応できた。

./ssh/configでホストごとの設定をしているところに

    ClientAliveInterval 3600

の行を追加して対処できました。

App Store Small Business Programがちゃんと適用されているか確認する

何月から適用されてるんだ?っと思ったもののいつの間にかAppleから売上のInvoiceが届かなくなってたので、Invoiceから確認することができず色々模索した。

なんとかApp Store Connectから適用されていることが確認できた。

  1. App Store Connect」から「Payments and Financial Report」に行って適用されているかどうか知りたい月を選択
  2. 右上のCreate Reportsでレポートをダウンロード
  3. できたレポート(zip)を解凍して、中のtxtを開きCustomer Priceに対してPartner Shareの割合が85%だったら適用されている

※OSの言語設定を英語にしているので項目名が日本語設定だと違うかもです。

Library not loaded: @rpath/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics というエラーで苦しんだ

Macを乗り換えたせいか、広告プラグインを更新したせいかよくわかっていないのだけどプロジェクトをXCodeでビルドして実行すると以下のようなエラーが出るようになってしまった。

2021-11-24 21:33:35.760999+0900 Numpurr[13175:2902555] AppLovinQualityService top: AppLovinQualityService Client Version: 6.1.3
2021-11-24 21:33:35.761050+0900 Numpurr[13175:2902555] AppLovinQualityService top: AppLovinQualityService Device ID: 083AC1BC-097E-4A9C-9D0F-02B5D654321E
2021-11-24 21:33:35.863394+0900 Numpurr[13175:2902555] Error loading /var/containers/Bundle/Application/5E2D6B23-2032-49C7-A063-9023E1262887/Numpurr.app/Frameworks/UnityFramework.framework/UnityFramework:  dlopen(/var/containers/Bundle/Application/5E2D6B23-2032-49C7-A063-9023E1262887/Numpurr.app/Frameworks/UnityFramework.framework/UnityFramework, 265): Library not loaded: @rpath/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics
  Referenced from: /private/var/containers/Bundle/Application/5E2D6B23-2032-49C7-A063-9023E1262887/Numpurr.app/Frameworks/UnityFramework.framework/UnityFramework
  Reason: image not found
2021-11-24 21:33:35.876414+0900 Numpurr[13175:2902555] Error loading /var/containers/Bundle/Application/5E2D6B23-2032-49C7-A063-9023E1262887/Numpurr.app/Frameworks/UnityFramework.framework/UnityFramework:  dlopen(/var/containers/Bundle/Application/5E2D6B23-2032-49C7-A063-9023E1262887/Numpurr.app/Frameworks/UnityFramework.framework/UnityFramework, 265): Library not loaded: @rpath/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics
  Referenced from: /private/var/containers/Bundle/Application/5E2D6B23-2032-49C7-A063-9023E1262887/Numpurr.app/Frameworks/UnityFramework.framework/UnityFramework
  Reason: image not found

とりあえず、以下のようにプロジェクトファイルのFrameworks, Libraries, and Embedded ContentのところにFBSDKCoreKit_Basicsを追加することで解決できた。
f:id:wkpn:20211125004338p:plain

ほぼフルカスタムのMacbook Pro 2019 16-inch VS ほぼフルカスタム Macbook Pro 2021 16-inch

MBP16inch 2021/M1 Max/Memory 64GB が届いたので、現在使っている MBP16inch 2019/Intel Core I9 2.4GHz/Memory 32GB とビルド時間を比較してみた。

ビルドしたのは、「にゃんばーカードWars」のプロジェクトファイル。

Unityは2020.3.8f1(Rosetta)。
Apple Silicon対応のUnityはまだ安定してなさそうなので導入してません。

MBP 2019 16inch MBP 2021 M1 Max 16inch
Unity Libraryフォルダ削除して起動 5:00 5:33
Switch Platform Android -> iOS 6:06 8:03
Build Apk 4:54 4:08
Build iOS 4:00 / 11:00 1:59
XCode Build 4:33 1:51
ゲーム起動 0:10 0:11

import系の処理は何故か未だにMBP2019の方が早かった。UnityがまだApple Silicon対応してないからかも。
対してXCodeでのビルドは爆速だった。

あと、MBP2019のUnityのiOSビルドは2回やったけど、そのうち1回はなんかむちゃくちゃ時間掛かった。ファンがめちゃくちゃ回っていたので熱が上がりすぎてなにかおかしなことになっていたのかもしれない。

M1 MAX版MBPはこんだけやって一度もファンの音が聞こえることはなかった。すごい。

ImageのtexOffsetがうまく動かない

maskしていると駄目らしい。

answers.unity.com

materialの代わりにmaterialForRenderingのmainTextureOffsetを利用することでうまくいった。

Awake時にDOTWeenのDOOffsetを使おうとしたが、それ機能しなかった。
materialForRenderingはどこかのタイミングで変更されてるんじゃないかと思う。
とりあえず、毎フレームmaterialForRenderingのmainTextureOffsetをセットすることで対応できた。