name: platform-channel-debug description: Debug communication issues between C# code and native Android/iOS implementations in the AppsFlyer Unity plugin.
Platform Channel Debug
Use this skill when a C#-to-native or native-to-C# flow is not working correctly.
Goal
Find where the Unity native bridge is broken between C#, the platform-specific wrappers, and native SDK integration.
Workflow
- Identify the failing flow: C# → native method call | native → C# callback | initialization/registration issue.
- Trace the path end-to-end:
- C#
AppsFlyer.cs→AppsFlyerAndroid.cs(AndroidJavaClass) |AppsFlyeriOS.cs([DllImport]) - →
AppsFlyerAndroidWrapper.java|AppsFlyeriOSWrapper.mm - → Native AppsFlyer SDK callback
- C#
- Verify argument and payload mapping.
- Check for mismatches: method names, argument types, platform guards (
#if UNITY_IOS/#if UNITY_ANDROID), null handling, callback thread assumptions. - Identify the first broken point in the chain.
- Recommend the smallest safe fix.
What to Check
AppsFlyer.cs— public API call and platform delegationAppsFlyerAndroid.cs— AndroidJavaClass/AndroidJavaObject callAppsFlyeriOS.cs— DllImport extern function signatureAppsFlyerAndroidWrapper.java— Java bridge method signatureAppsFlyeriOSWrapper.mm— Objective-C++ bridge function signature- Callback propagation back to C# (Unity main thread safety)
- Assembly definition boundaries
Output Format
Return:
- Failing scenario
- Expected flow
- Actual break point
- Evidence
- Suspected root cause
- Recommended fix
- Validation steps
Rules
- Do not say the issue is in native SDK behavior unless the bridge has been verified first.
- Unity requires callbacks to be dispatched to the main thread — verify threading.
- Prefer tracing the real execution path over guessing.
- Separate confirmed breakage from hypotheses.
- If evidence is incomplete, say
needs verification.