
Unity攤
晚好,Unity打包iOS的應(yīng)用AirPlay投屏閃退問題解決(該問題會導(dǎo)致審核無法通過,請務(wù)必解決)
經(jīng)測試,投屏閃退與iOS系統(tǒng)有關(guān),可游戲必須要適配大多數(shù)系統(tǒng)的機(jī)型,查詢 相關(guān)資料,發(fā)現(xiàn):
如果打開游戲之前已經(jīng)連接上AirPlay既會崩潰,相反則不會;
另外 在Unity打包的Xcode工程目錄下有一與投屏相關(guān)DisplayManager.mm代碼文件
以下是投屏連接相關(guān)的代碼:
- (void)screenDidConnect:(NSNotification*)notification
{
[self registerScreen: (UIScreen*)[notification object]];
[self updateDisplayListInUnity];
}
只需要注釋掉方法中的代碼即可解決崩潰(方法作用感興趣的可以去看一下源代碼)。
即:
- (void)screenDidConnect:(NSNotification*)notification
{
//[self registerScreen: (UIScreen*)[notification object]];
//[self updateDisplayListInUnity];
}
另外該 參考文章是另外一種解決方法,請參考。
如有疑問,可以留言~
愿開發(fā)順利~~~~~~~