FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
125 stars 25 forks source link

Cloud call error #3030

Closed stanislav-pastushenko closed 4 months ago

stanislav-pastushenko commented 5 months ago

Has your issue been reported?

Current Behavior

Hello. I want to integrate push notifications. I use Firebase Auth via custom token. When user logs in FlutterFlow calls addFcmToken cloud function. But it throws an error |/flutter ( 7062): Cloud call error! I/flutter ( 7062): Code: unauthenticated I/flutter ( 7062): Details: null I/flutter ( 7062): Message: UNAUTHENTICATED

And I don't have fcm_tokens in Firestore.

Expected Behavior

Not to have an error and have saved fcm_tokens in Firestore.

Steps to Reproduce

1.Sign In via firebase auth (custom token).

  1. Check logs in Devtools.

Reproducible from Blank

Bug Report Code (Required)

ITFfl8iA+otJobRe1a6IKfkwuyoQKWkcTIMziNZ+exUbfaL1Bux3ds7OVBRtQtO/aVNcHlmaink1/8rXiePtKfEDE02qfqph+JZMcDrOe2itWrKpPriOdHJ5N+1jfHK+5p2K2xEnVfppSGwE22Whfty/cz7DFOu/Zwh9f6PHaOI=

Context

I can't send push notifications.

Visual documentation

Launching lib/main.dart on sdk gphone64 arm64 in debug mode... Upgrading build.gradle Running Gradle task 'assembleDebug'... 13.0s ✓ Built build/app/outputs/flutter-apk/app-debug.apk. D/FlutterGeolocator( 7062): Attaching Geolocator to activity D/FlutterGeolocator( 7062): Creating service. D/FlutterGeolocator( 7062): Binding to location service. D/FlutterGeolocator( 7062): Geolocator foreground service connected D/FlutterGeolocator( 7062): Initializing Geolocator services D/FlutterGeolocator( 7062): Flutter engine connected. Connected engine count 1 Syncing files to device sdk gphone64 arm64... 189ms

Flutter run key commands. r Hot reload. 🔥🔥🔥 R Hot restart. h List all available interactive commands. d Detach (terminate "flutter run" but leave application running). c Clear the screen q Quit (terminate the application on the device).

A Dart VM Service on sdk gphone64 arm64 is available at: http://127.0.0.1:51310/9IsQ99tieAY=/ W/DynamiteModule( 7062): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found. I/DynamiteModule( 7062): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0 W/ProviderInstaller( 7062): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0. The Flutter DevTools debugger and profiler on sdk gphone64 arm64 is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:51310/9IsQ99tieAY=/ W/askyogi.askyogi( 7062): Verification of void com.google.firebase.perf.metrics.AppStartTrace$$ExternalSyntheticLambda4.(com.google.firebase.perf.metrics.AppStartTrace, com.google.firebase.perf.v1.TraceMetric$Builder) took 165.673ms (48.29 bytecodes/s) (1480B approximate peak alloc) D/nativeloader( 7062): Configuring clns-7 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=33, uses_libraries=ALL, library_path=/product/priv-app/PrebuiltGmsCore/lib/arm64:/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms D/nativeloader( 7062): Configuring clns-8 for other apk /system/framework/com.android.media.remotedisplay.jar. target_sdk_version=33, uses_libraries=ALL, library_path=/product/priv-app/PrebuiltGmsCore/lib/arm64:/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms D/nativeloader( 7062): Configuring clns-9 for other apk /system/framework/com.android.location.provider.jar. target_sdk_version=33, uses_libraries=ALL, library_path=/product/priv-app/PrebuiltGmsCore/lib/arm64:/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms D/ApplicationLoaders( 7062): Returning zygote-cached class loader: /system_ext/framework/androidx.window.extensions.jar D/ApplicationLoaders( 7062): Returning zygote-cached class loader: /system_ext/framework/androidx.window.sidecar.jar D/nativeloader( 7062): InitLlndkLibrariesProduct: libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libbinder_ndk.so:libc.so:libcgrouprc.so:libclang_rt.asan-aarch64-android.so:libclang_rt.hwasan-aarch64-android.so:libcom.android.tethering.connectivity_native.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libneuralnetworks.so:libselinux.so:libsync.so:libvndksupport.so:libvulkan.so D/nativeloader( 7062): Configuring product-clns-10 for unbundled product apk /product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk. target_sdk_version=33, uses_libraries=, library_path=/product/priv-app/PrebuiltGmsCore/lib/arm64:/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/arm64-v8a:/product/lib64:/system/product/lib64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms:/product/lib64:/system/product/lib64 D/nativeloader( 7062): InitVndkspLibrariesProduct: android.hardware.common-V2-ndk.so:android.hardware.common.fmq-V1-ndk.so:android.hardware.graphics.allocator-V2-ndk.so:android.hardware.graphics.common-V4-ndk.so:android.hardware.graphics.common@1.0.so:android.hardware.graphics.common@1.1.so:android.hardware.graphics.common@1.2.so:android.hardware.graphics.composer3-V1-ndk.so:android.hardware.graphics.mapper@2.0.so:android.hardware.graphics.mapper@2.1.so:android.hardware.graphics.mapper@3.0.so:android.hardware.graphics.mapper@4.0.so:android.hardware.renderscript@1.0.so:android.hidl.memory.token@1.0.so:android.hidl.memory@1.0-impl.so:android.hidl.memory@1.0.so:android.hidl.safe_union@1.0.so:libRSCpuRef.so:libRSDriver.so:libRS_internal.so:libbase.so:libbcinfo.so:libblas.so:libc++.so:libcompiler_rt.so:libcutils.so:libdmabufheap.so:libgralloctypes.so:libhardware.so:libhidlbase.so:libhidlmemory.so:libion.so:libjsoncpp.so:liblzma.so:libprocessgroup.so:libunwindstack.so:libutils.so:libutilscallstack.so:libz.so W/askyogi.askyogi( 7062): Verification of void androidx.profileinstaller.ProfileInstaller.() took 241.886ms (62.01 bytecodes/s) (1736B approximate peak alloc) D/ProfileInstaller( 7062): Installing profile for com.askyogi.askyogi V/NativeCrypto( 7062): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 295 native methods... W/askyogi.askyogi( 7062): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed) W/askyogi.askyogi( 7062): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (unsupported,core-platform-api, reflection, allowed) W/askyogi.askyogi( 7062): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (unsupported,core-platform-api, reflection, allowed) W/askyogi.askyogi( 7062): Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (unsupported,core-platform-api, reflection, allowed) I/ProviderInstaller( 7062): Installed default security provider GmsCore_OpenSSL D/EGL_emulation( 7062): app_time_stats: avg=1311.98ms min=411.32ms max=2800.34ms count=3 W/askyogi.askyogi( 7062): Long monitor contention with owner AsyncTask #1 (7113) at void com.google.android.gms.security.ProviderInstaller.installIfNeeded(android.content.Context)(com.google.android.gms:play-services-basement@@18.2.0:13) waiters=0 in void com.google.android.gms.security.ProviderInstaller.installIfNeeded(android.content.Context) for 522ms W/DynamiteModule( 7062): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found. I/DynamiteModule( 7062): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0 W/ProviderInstaller( 7062): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0. W/askyogi.askyogi( 7062): Verification of io.grpc.okhttp.OkHttpChannelBuilder io.grpc.okhttp.OkHttpChannelBuilder.connectionSpec(com.squareup.okhttp.ConnectionSpec) took 206.384ms (121.13 bytecodes/s) (1808B approximate peak alloc) W/FirebaseContextProvider( 7062): Error getting App Check token. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed. D/TrafficStats( 7062): tagSocket(161) with statsTag=0xffffffff, statsUid=-1 W/askyogi.askyogi( 7062): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (unsupported, reflection, allowed) D/TrafficStats( 7062): tagSocket(166) with statsTag=0xffffffff, statsUid=-1 W/askyogi.askyogi( 7062): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (unsupported, reflection, allowed) I/askyogi.askyogi( 7062): Background concurrent copying GC freed 130401(7713KB) AllocSpace objects, 51(1560KB) LOS objects, 49% free, 6131KB/11MB, paused 66us,41us total 217.012ms I/flutter ( 7062): Cloud call error! I/flutter ( 7062): Code: unauthenticated I/flutter ( 7062): Details: null I/flutter ( 7062): Message: UNAUTHENTICATED W/askyogi.askyogi( 7062): Verification of void io.grpc.internal.KeepAliveManager$ClientKeepAlivePinger$1.(io.grpc.internal.KeepAliveManager$ClientKeepAlivePinger) took 108.029ms (55.54 bytecodes/s) (1440B approximate peak alloc) I/TRuntime.CctTransportBackend( 7062): Making request to: https://firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog D/TrafficStats( 7062): tagSocket(160) with statsTag=0xffffffff, statsUid=-1 I/TRuntime.CctTransportBackend( 7062): Status Code: 200 D/EGL_emulation( 7062): app_time_stats: avg=2948.95ms min=5.73ms max=58057.20ms count=20 D/EGL_emulation( 7062): app_time_stats: avg=29958.58ms min=353.51ms max=59563.65ms count=2 D/EGL_emulation( 7062): app_time_stats: avg=30034.39ms min=389.33ms max=59679.45ms count=2 D/EGL_emulation( 7062): app_time_stats: avg=29995.40ms min=381.37ms max=59609.44ms count=2 D/EGL_emulation( 7062): app_time_stats: avg=30049.90ms min=317.89ms max=59781.90ms count=2 D/EGL_emulation( 7062): app_time_stats: avg=29950.16ms min=348.33ms max=59552.00ms count=2

Additional Info

No response

Environment

- FlutterFlow version: v4.1.54 released May 30, 2024
- Platform: Android
- Browser name and version: -
- Operating system and version affected: Android 14

General

Relative to the time the changes were made, data was lost within

When following my steps to reproduce, data loss happens

paulperez-dev commented 5 months ago

Hi @stanislav-pastushenko, from the log shared I can see the user is unauthenticated, leading to the error on the cloud function.

Please take a look tot he following links and verify if all the requirements were met:

  1. https://docs.flutterflow.io/data-and-backend/firebase/authentication/jwt-token
  2. https://firebase.google.com/docs/auth/admin/create-custom-tokens?hl=es-419#create_custom_tokens_using_a_third-party_jwt_library
image.png
stanislav-pastushenko commented 5 months ago

@paulperez-dev Thnx for response. But it logins a user to the system. And the token is valid for AuthGuard with Firebase checking on the custom backend. So token might be valid.

stanislav-pastushenko commented 5 months ago

@paulperez-dev I've tried to generate a token via https://docs.flutterflow.io/data-and-backend/firebase/authentication/jwt-token And the result the same, with the same error.

paulperez-dev commented 4 months ago

Hi @stanislav-pastushenko! Please share a new report code with the latest changes so I can help you!

paulperez-dev commented 4 months ago

Closing this issue since we haven't heard back from you. If you are still facing the problem please submit a new issue. Have a great day!