public static void PresentChannelInterface(IntPtr instancePtr, string inviteChannelJson, string invitePackageJson, IntPtr onCompletePtr, IntPtr onCancelPtr, IntPtr onFailurePtr) { var channel = new InviteChannel().ParseFromJson(inviteChannelJson.ToDict()); var package = new InvitePackage().ParseFromJson(invitePackageJson.ToDict()); var onFailure = new Action <GetSocialError>(exception => { GetSocialNativeBridgeIOS._gs_executeInviteFailedCallback(onFailurePtr, exception.ErrorCode, exception.Message); }); var plugin = instancePtr.Cast <InviteChannelPlugin>(); try { plugin.PresentChannelInterface(channel, package, () => { GetSocialNativeBridgeIOS._gs_executeInviteSuccessCallback(onCompletePtr); }, () => { GetSocialNativeBridgeIOS._gs_executeInviteCancelledCallback(onCancelPtr); }, onFailure); } catch (Exception e) { onFailure(new GetSocialError(e.Message)); } }
void presentChannelInterface( AndroidJavaObject inviteChannelAJO, AndroidJavaObject invitePackageAJO, AndroidJavaObject callbackAJO) { ExecuteOnMainThread(() => { var inviteChannel = new InviteChannel().ParseFromAJO(inviteChannelAJO); var invitePackage = new InvitePackage().ParseFromAJO(invitePackageAJO); Action onComplete = () => { callbackAJO.Call("onComplete"); }; Action onCancel = () => { callbackAJO.Call("onCancel"); }; Action <GetSocialError> onFailure = err => { callbackAJO.Call("onError", JniUtils.NewJavaThrowable(err.Message)); }; try { _invitePlugin.PresentChannelInterface(inviteChannel, invitePackage, onComplete, onCancel, onFailure); } catch (Exception e) { onFailure(new GetSocialError(e.Message)); } }); }