public static void CallGenericBridge(this JavaObjectWrapper javaObjectWrapper, string methodName, Action onSuccess, Action <HMSException> onFailure)
 {
     javaObjectWrapper.CallAsWrapper <TaskAndroidJavaObject>(methodName)
     .AddOnSuccessListener((intent) =>
     {
         var callback = new GenericBridgeCallbackWrapper()
                        .AddOnFailureListener(onFailure)
                        .AddOnSuccessListener((nothing) => { onSuccess.Invoke(); });
         GenericBridgeClass.CallStatic("receiveShow", intent, callback);
     }).AddOnFailureListener(onFailure.Invoke);
 }
Esempio n. 2
0
        public static void CallArchiveBridge(this JavaObjectWrapper javaObjectWrapper, Action onSuccess, Action <HMSException> onFailure)
        {
            String methodName = "getShowArchiveListIntent";

            javaObjectWrapper.CallAsWrapper <TaskAndroidJavaObject>(methodName)
            .AddOnSuccessListener((intent) =>
            {
                var callback = new GenericBridgeCallbackWrapper()
                               .AddOnFailureListener(onFailure)
                               .AddOnSuccessListener((nothing) =>
                {
                    javaObjectWrapper.CallOnMainThread(() => { onSuccess.Invoke(); });
                });
                sJavaClass.CallStatic("receiveShow", intent, callback);
            }).AddOnFailureListener((exception) => javaObjectWrapper.CallOnMainThread(() => { onFailure.Invoke(exception); }));
        }