I am a new bee to unity and C#, I have written ios swift unity wrapper. I just want to know can below code written in a better way, without breaking wrapper functionality.
Native.cs
[DllImport("__Internal")]
extern static public void SDK_getOffers(Action<bool,string> completionHandler);
ButtonHandler.js
[MonoPInvokeCallback ( typeof ( Action<bool,string> ) )]
static void completionHandler ( bool status, string message ) {
// logs = "✅ status is: " + status + "\n" + "✅ message is: " + message;
}
public void ButtonGetOffersTapped() {
#if UNITY_IOS && !UNITY_EDITOR
UnityEngine.Debug.Log("✅ button get offers tapped");
SDK_getOffers(completionHandler);
#endif
}
is there a way to write completion handler with along with function itself, rather then writing as separate function?