Ironsource sdk在Unity 2019.3.x下代碼過時bug

在這裏插入圖片描述

報錯:Assets\IronSource\Editor\FacebookSettings.cs(18,48): error CS0619: ‘PBXProject.GetUnityTargetName()’ is obsolete: ‘This function is deprecated. There are two targets now, call GetUnityMainTargetGuid() - for app or GetUnityFrameworkTargetGuid() - for source/plugins to get Guid instead of calling to TargetGuidByName(GetUnityTargetName()).’

原來代碼:
在這裏插入圖片描述
可以把代碼修改爲:
在這裏插入圖片描述

#if UNITY_2019_3_OR_NEWER
string targetId = project.GetUnityFrameworkTargetGuid();
#else
string targetId = project.TargetGuidByName(PBXProject.GetUnityTargetName());
#endif

參考:https://stackoverflow.com/questions/60459020/how-to-fix-bug-in-ironsource-unity-sdk-on-ios

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章