Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring android app for parse push notifications #941

Open
3 tasks done
cool2apps opened this issue Jun 21, 2023 · 2 comments
Open
3 tasks done

Configuring android app for parse push notifications #941

cool2apps opened this issue Jun 21, 2023 · 2 comments
Labels
type:docs Only change in the docs or README

Comments

@cool2apps
Copy link

cool2apps commented Jun 21, 2023

New Issue Checklist

Issue Description

When configuring android app for parse push notification as described in this document:
https://docs.parseplatform.org/parse-server/guide/#android-apps
If I add this code to AndroidManifest.xml, app will crash if app receives an FCM message.

       <service
           android:name="com.parse.fcm.ParseFirebaseMessagingService"
           android:exported="false">
           <intent-filter>
               <action android:name="com.google.firebase.MESSAGING_EVENT"/>
           </intent-filter>
       </service>

Steps to reproduce

Actual Outcome

If I add that code to AndroidManifest.xml, app will crash if app receives an FCM message.

Expected Outcome

So I removed that code from AndroidManifest.xml, and tried again. This time app does not crash, if app receives an FCM message and looks like app is working fine without this code. No problem I faced by removing that code.

So what my app is missing by removing that code?
Or documentation needs to be updated?

Environment

Parse Flutter SDK

  • SDK version: 5.0.1
  • Flutter version: 3.10.5
  • Dart version: 3.0.5
  • Operating system version: ubuntu server 22.04.2 LTS

Server

  • Parse Server version: 5.4.0

Logs

E/AndroidRuntime(32221): FATAL EXCEPTION: Firebase-Messaging-Intent-Handle
E/AndroidRuntime(32221): Process: com.company.appid, PID: 32221
E/AndroidRuntime(32221): java.lang.NullPointerException
E/AndroidRuntime(32221): 	at com.parse.PushRouter.getInstance(Unknown Source:15)
E/AndroidRuntime(32221): 	at com.parse.fcm.ParseFirebaseMessagingService.onMessageReceived(Unknown Source:89)
E/AndroidRuntime(32221): 	at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(Unknown Source:66)
E/AndroidRuntime(32221): 	at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(Unknown Source:119)
E/AndroidRuntime(32221): 	at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(Unknown Source:12)
E/AndroidRuntime(32221): 	at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(Unknown Source:66)
E/AndroidRuntime(32221): 	at m6.g.lambda$processIntent$0(Unknown Source:1)
E/AndroidRuntime(32221): 	at m6.g.b(Unknown Source:0)
E/AndroidRuntime(32221): 	at m6.f.run(Unknown Source:6)
E/AndroidRuntime(32221): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
E/AndroidRuntime(32221): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
E/AndroidRuntime(32221): 	at l4.c.run(Unknown Source:6)
E/AndroidRuntime(32221): 	at java.lang.Thread.run(Thread.java:1012)
W/FlutterJNI(  897): FlutterJNI.loadLibrary called more than once
W/FlutterJNI(  897): FlutterJNI.init called more than once
@parse-github-assistant
Copy link

parse-github-assistant bot commented Jun 21, 2023

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@cool2apps
Copy link
Author

cool2apps commented Jun 21, 2023

PS: I needed to add android:exported="false" to be able to compile for projects targeting android SDK 32 or newer. Maybe crash occurs because of that. But I can't compile, if I don't add "exported" part. I need to change targetSdkVersion to 30 in order to compile without android:exported="false". But target SDK 30 is too low to publish an app to Play Store.

@mtrezza mtrezza added the type:docs Only change in the docs or README label Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs Only change in the docs or README
Projects
None yet
Development

No branches or pull requests

2 participants