Bundle IAP example dependencies into exported .unitypackage Summary: scripts/package_sdk.sh produced a .unitypackage that was missing the IAP example’s runtime dependencies. Importing into a fresh Unity project failed to compile (error CS0103: The name 'IAPWrapper' does not exist in the current context in Assets/FacebookSDK/Examples/Mobile/Scripts/SubMenus/IAP.cs), and an iOS Xcode build then failed to link with undefined symbols _IAPInitializeSK1, _IAPInitializeSK2, _IAPPurchaseConsumable, _IAPPurchaseNonConsumable, _IAPPurchaseSubscription. The same gap broke Android builds because IAPAndroidImpl was missing. Root cause: Facebook.Unity.Editor/FacebookBuild.cs defines a fixed allow-list of source roots passed to AssetDatabase.ExportPackage. Examples/Mobile/Scripts/SubMenus/IAP.cs calls into IAPWrapper, but IAPWrapper.cs, IAPAndroidImpl.cs, and the native iOS plugin tree (IAPSK1.{mm,h}, IAPSK2.swift, IAPUnityInterface.{mm,h}, FBSDKUnityStoreKit.storekit) live under Assets/Scripts/ and Assets/IAPiOS/, neither of which was in the allow-list — so they never reached AssetDatabase.ExportPackage. Add ScriptsPath = "Assets/Scripts/" and IAPiOSPath = "Assets/IAPiOS/" to the allow-list and gather files from both roots with Directory.GetFiles(..., SearchOption.AllDirectories). Also collapsed the parallel array + manual CopyTo offset assembly into a List<string>.AddRange chain so adding future roots does not require recomputing offsets. Reviewed By: janeheffernan Differential Revision: D105221090 fbshipit-source-id: dae5aaffa5c777b309c90c813c92ab418093a633
Bundle IAP example dependencies into exported .unitypackage
Summary: scripts/package_sdk.sh produced a .unitypackage that was missing the IAP example’s runtime dependencies. Importing into a fresh Unity project failed to compile (error CS0103: The name 'IAPWrapper' does not exist in the current context in Assets/FacebookSDK/Examples/Mobile/Scripts/SubMenus/IAP.cs), and an iOS Xcode build then failed to link with undefined symbols _IAPInitializeSK1, _IAPInitializeSK2, _IAPPurchaseConsumable, _IAPPurchaseNonConsumable, _IAPPurchaseSubscription. The same gap broke Android builds because IAPAndroidImpl was missing.
scripts/package_sdk.sh
.unitypackage
error CS0103: The name 'IAPWrapper' does not exist in the current context
Assets/FacebookSDK/Examples/Mobile/Scripts/SubMenus/IAP.cs
_IAPInitializeSK1
_IAPInitializeSK2
_IAPPurchaseConsumable
_IAPPurchaseNonConsumable
_IAPPurchaseSubscription
IAPAndroidImpl
Root cause: Facebook.Unity.Editor/FacebookBuild.cs defines a fixed allow-list of source roots passed to AssetDatabase.ExportPackage. Examples/Mobile/Scripts/SubMenus/IAP.cs calls into IAPWrapper, but IAPWrapper.cs, IAPAndroidImpl.cs, and the native iOS plugin tree (IAPSK1.{mm,h}, IAPSK2.swift, IAPUnityInterface.{mm,h}, FBSDKUnityStoreKit.storekit) live under Assets/Scripts/ and Assets/IAPiOS/, neither of which was in the allow-list — so they never reached AssetDatabase.ExportPackage.
Facebook.Unity.Editor/FacebookBuild.cs
AssetDatabase.ExportPackage
Examples/Mobile/Scripts/SubMenus/IAP.cs
IAPWrapper
IAPWrapper.cs
IAPAndroidImpl.cs
IAPSK1.{mm,h}
IAPSK2.swift
IAPUnityInterface.{mm,h}
FBSDKUnityStoreKit.storekit
Assets/Scripts/
Assets/IAPiOS/
Add ScriptsPath = "Assets/Scripts/" and IAPiOSPath = "Assets/IAPiOS/" to the allow-list and gather files from both roots with Directory.GetFiles(..., SearchOption.AllDirectories). Also collapsed the parallel array + manual CopyTo offset assembly into a List<string>.AddRange chain so adding future roots does not require recomputing offsets.
ScriptsPath = "Assets/Scripts/"
IAPiOSPath = "Assets/IAPiOS/"
Directory.GetFiles(..., SearchOption.AllDirectories)
CopyTo
List<string>.AddRange
Reviewed By: janeheffernan
Differential Revision: D105221090
fbshipit-source-id: dae5aaffa5c777b309c90c813c92ab418093a633
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号