unityでiPhone向けのピアノアプリを作っています。
サイレントモード時でも音が鳴るようにしたいのですができず、困っています。
解決策わかる方、ご教示よろしくお願いします。
【試したこと】
(1)Unityからビルドして生成された.xcodeprojを開きUnityViewControllerBase.mmのviewWillAppearに下記コードを追加
AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setCategory:AVAudioSessionCategoryPlayback error:nil]; [audioSession setActive:YES error:nil];
(参考サイト)
https://qiita.com/kabosu3d/items/2a569668e62c265ef2b3
https://www.facebook.com/groups/unityuserj/posts/1439251626134773/
https://stackoverflow.com/questions/3740528/play-sound-on-iphone-even-in-silent-mode
(2)xcodeprojを開きSigning & CapabilitiesからBackground Methodsを追加
追加したBackground MethodsからAudio, AirPlay, and Picture in Pictureにチェックを付ける
(参考サイト)
https://gist.github.com/mao-test-h/a3bf5019107375ed4bce9df8853ef62b

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。