Open zulpeas opened 3 years ago
I have the same issue, but only on iOS (14.1). I get the same result as you when using the web api, or if I do
import { firebase, firebaseFunctions } from "@nativescript/firebase";
const fn = firebaseFunctions.httpsCallable("test"); fn();
However it sort of works, if I use this:
import { firebase } from "@nativescript/firebase";
const fn = firebase.functions.httpsCallable("test"); fn();
It works as long as I don't pass anything other than a string or null to fn(). If I pass an object, it crashes immediately.
This seems to have become an issue with the transition to v11 and NS7. Prior to that it worked perfectly for me.
Hi, my app always crashes whenever I tried to run the code for cloud functions
Console: [Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'FirebaseFunctions' of undefined" System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method onTouch failed System.err: TypeError: Cannot read property 'FirebaseFunctions' of undefined System.err: System.err: StackTrace: System.err: httpsCallable(file: node_modules/nativescript-plugin-firebase/functions/functions.android.js:6:49) System.err: at tapped(file: app/components/NotificationsView.vue:33:0) System.err: at invokeWithErrorHandling(file: node_modules/nativescript-vue/dist/index.js:1863:25) System.err: at invoker(file: node_modules/nativescript-vue/dist/index.js:2527:13) System.err: at _executeCallback(file: node_modules/@nativescript/core/ui/gestures/gestures.android.js:321:26) System.err: at TapAndDoubleTapGestureListenerImpl._handleSingleTap(file: node_modules/@nativescript/core/ui/gestures/gestures.android.js:56:20) System.err: at TapAndDoubleTapGestureListenerImpl.onSingleTapUp(file: node_modules/@nativescript/core/ui/gestures/gestures.android.js:25:17) System.err: at GesturesObserver.androidOnTouchEvent(file: node_modules/@nativescript/core/ui/gestures/gestures.android.js:253:40) System.err: at (file: node_modules/@nativescript/core/ui/core/view/view.android.js:275:24) System.err: at View.handleGestureTouch(file: node_modules/@nativescript/core/ui/core/view/view.android.js:274:17) System.err: at TouchListenerImpl.onTouch(file: node_modules/@nativescript/core/ui/core/view/view.android.js:41:18) System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1134) System.err: at com.tns.gen.java.lang.Object_vendor_23616_26_TouchListenerImpl.onTouch(Object_vendor_23616_26_TouchListenerImpl.java:19) System.err: at android.view.View.dispatchTouchEvent(View.java:11784) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661) System.err: at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:549) System.err: at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1953) System.err: at android.app.Activity.dispatchTouchEvent(Activity.java:3559) System.err: at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69) System.err: at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:502) System.err: at android.view.View.dispatchPointerEvent(View.java:12027) System.err: at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5304) System.err: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5093) System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4588) System.err: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4641) System.err: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4607) System.err: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4734) System.err: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4615) System.err: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4791) System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4588) System.err: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4641) System.err: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4607) System.err: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4615) System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4588) System.err: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7195) System.err: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7169) System.err: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7130) System.err: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7351) System.err: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:192) System.err: at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) System.err: at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:181) System.err: at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:7274) System.err: at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:7379) System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981) System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:790) System.err: at android.view.Choreographer.doFrame(Choreographer.java:715) System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967) System.err: at android.os.Handler.handleCallback(Handler.java:808) System.err: at android.os.Handler.dispatchMessage(Handler.java:101) System.err: at android.os.Looper.loop(Looper.java:166) System.err: at android.app.ActivityThread.main(ActivityThread.java:7529) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Here is my code: