Beispiel #1
0
    public static void UpstreamCallReturn(string callId, string result)
    {
        GateType gate;

        if (callId.StartsWith("d"))
        {
            gate = GateType.DotNet;
        }
        else
        {
            gate = PlatformGate;
        }
        switch (gate)
        {
        case GateType.Android:
            javaGateProxy.CallStatic("onUpstreamCallReturn", new object[] { callId, result });
            break;

        case GateType.iOS:
            OCGateProxy.gateOnUpstreamCallReturn(callId, result);
            break;

        case GateType.DotNet:
            Gate.OnUpstreamCallReturn(callId, result);
            break;
        }
    }
Beispiel #2
0
    public static string SyncCall(string clazz, string method, string arg = null)
    {
        switch (PlatformGate)
        {
        case GateType.Android:
            return(javaGateProxy.CallStatic <string>("onSynCall", clazz, method, arg));

        case GateType.iOS:
            //OCGateProxy.gateCOnCall(callId, call.clazz, call.method, call.arg);
            return(OCGateProxy.gateOnSynCall(clazz, method, arg));

        case GateType.DotNet:
            return(Gate.OnSyncCall(clazz, method, arg));
        }
        return("");
    }
Beispiel #3
0
    public static void SendNotify(Notify notify, params GateType[] gateTypeList)
    {
        if (gateTypeList.Length == 0)
        {
            gateTypeList = new GateType[] { PlatformGate };
        }
        foreach (var gate in gateTypeList)
        {
            switch (gate)
            {
            case GateType.Android:
                javaGateProxy.CallStatic("onNotify", new object[] { notify.clazz, notify.method, notify.arg });
                break;

            case GateType.iOS:
                OCGateProxy.gateOnNotify(notify.clazz, notify.method, notify.arg);
                break;

            case GateType.DotNet:
                Gate.OnNotify(notify.clazz, notify.method, notify.arg);
                break;
            }
        }
    }
Beispiel #4
0
    public static void InvokeCall(Call call, Action <string> onReturn = null)
    {
        callCount++;
        string callId = callCount.ToString();

        if (onReturn != null)
        {
            callReturnListenerDic[callId] = onReturn;
        }
        switch (PlatformGate)
        {
        case GateType.Android:
            javaGateProxy.CallStatic("onCall", new object[] { callId, call.clazz, call.method, call.arg });
            break;

        case GateType.iOS:
            OCGateProxy.gateOnCall(callId, call.clazz, call.method, call.arg);
            break;

        case GateType.DotNet:
            Gate.OnCall(callId, call.clazz, call.method, call.arg);
            break;
        }
    }