How to remove the Firebase Cloud Messaging SDK from Unity? - android

I want to display an Android notification with a large image whenever I send a notification from FCM (I have included the data payload with a URL for the image). The Android app can be in background or foreground.
I did not know earlier that this is not directly possible with the Unity SDK for FCM. So now I have a Unity project which I'll need to export the project to Android Studio and do something, according to this thread: https://github.com/firebase/quickstart-unity/issues/146#issuecomment-389579086
What I've figured is (maybe I'm wrong) I'll need to remove the FCM SDK from Unity and add the Android SDK in Android Studio and follow the steps for Android. So I deleted all the FCM specific files from my project, reimported other SDKs (Firebase Database, Firebase Auth, Firebase Analytics, Firebase Remote Config, Facebook SDK and GoogleMobileAds SDK) to ensure I didnt break any of these SDKs in the process.
Before exporting to Android Studio, I tried building directly from Unity to make sure I'm making stable builds, but the app crashes as soon as I open it. This is probably happening because the Messaging SDK has irreversibly changed the entry point to a MessagingUnityPlayerActivity, and I have already deleted it.
How do I safely remove the Messaging SDK? Or is there any other solution to my problem?

Related

Firebase console sdk setup showing as unfinished

I created an android application on Android studio 3.4.2 and integrated Firebase using the firebase assistant tool provided on Android studio.There is no problem with using the features of Firebase on the app but when going to the developer's console of Firebase and going to the project overview, it appears as if the the sdk setup is not finished ,I tried following the sdk setup steps provided and the setup won't finish at the last stage i.e, "checking if the app has communicated with our servers,you may need to uninstall and reinstall the app". I've uninstalled my app and reinstalled it but doesn't seem to be registering the app on the Firebase server.
I've tried restarting the internet, Uninstalled my app and reinstalled,made sure net connectivity are okay on both emulator and pc
Check your Firebase console projects, Is there any project with the same package name?. If there is any please remove and try again.

Firebase / Cloud Messaging

I've got some issues regarding the integration of Firebase in my Android Unity app.
I created a project on firebase with my Unity Bundle Identifier.
In authentification I enabled email and anonymous (I just exactly follow all the steps provided by Firebase in their tuto).
On Unity side I got the last firebase plugin.
First of all I started to have some manifest issues:
CommandInvokationFailure: Unable to merge android manifests. Error:
[Temp\StagingArea\AndroidManifest-main.xml,
C:\Users\Public\Documents\Unity
Projects\WheelRotation\Temp\StagingArea\android-libraries\com.google.firebase.firebase-measurement-connector-impl-16.0.0\AndroidManifest.xml:10]
Trying to merge incompatible
/manifest/application/service[#name=com.google.firebase.components.ComponentDiscoveryService]
element
To solve this issues I just updated my manifest on Unity side to be able to compile the app and launch it on my android phone.
I succeeded to do that but when looking at the Firebase/Authentification/ Users, my Android app didn't appear.
Furthermore, when Using firebase cloud messaging interface, I can't succeed to send message (I can select the app, then click on Send but when I check my message no message was sent (the Sent column stays on 0) and obviously I don't receive the message on my android phone.
Thx in advance for your precious help.
Regards.
I'm using Unity Version: 5.4.1p2 (really need this version for specific plugins) all all other plugin are uptodate (JDK and Android sdk)
I recently discovered a bug in the newer Firebase version with Unity which relates to the ComponentDiscovery Service. Since I don't know how to mark as possible duplicate, I repost my solution here, which may help you:
The solution behind this seems to be the package name variable, which
unity won't replace by the actual package name in the latest builds.
https://forum.unity.com/threads/android-gradle-cannot-read-packagename-from-gradleout-src-main-androidmanifest-xml.524587/
proposes a temporary fix, by renaming the package="${applicationId}"
variable inside the "\Assets\Plugins\Android\AndroidManifest.xml" on
line 4 with the actual package name e.g :
package="com.MyCompany.MyGame"

One Android app receives push notifications from two different Firebase project

I created two Firebase projects for the same Android app.
One for development
Other for production.
For development, I was compiling my application with my google-service.json from the dev Firebase project and now I'm compiling with the file from the production Firebase project.
The problem is I'm still receiving push notifications from the dev
project on the app I compiled with the production
google-service.json file. I checked Firebase Settings and every id I
have found are different in dev and production. So how is it
possible that I'm still receiving notifications from the dev project?
Note: I'm not using a back-end to send notifications, I'm doing everything from the Firebase console.
Thanks a lot,

No clients were able to be added to your Firebase project

I recently released an Android App on the playstore this app is currently linked with both Google's Admob and Google's firebase for analytics, after a while I started working on an update that includes FIREBASE NOTIFICATIONS when I tried to connect firebase to the project I got this error:
Firebase
No clients were able to be added to your Firebase project for the following reasons:
An app with this package name and SHA1 is already connected to a Google project. If you have used a Google API previously, please select that project in the Connect to an existing project list.
Client Package Name: xxxxxxxxxxxxxxxxxxxxxxxxx
Client SHA1: [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
How to fix this without loosing my previous analytics stats ?
You Should Use The existing App And Include Feature For Push Notifications at Firebase console or firebase assistant in studio
As you are creating a new project in firebase assistant for push notifications but you have aldready added this app for another services it Wont use two firebase projects for Single application so Make Sure You Are Going With The Past Project which you have done for admob and then go to cloud messaging amd enable it then you will successfully connect
If any errors again i can Help
Thank you
And If You Created Aldready you can import that project into previous project but make sure that you use same firebase account
https://firebase.google.com/support/faq/
Use this link to know about importing projects

mobile backend starter import to android studio

This is my first post in StackOverflow.
I am building an android app using Android Studio. This app requires some cloud backend to sync user data across devices. After some research, I came across the Mobile Backend Starter from google which provides a fully deployed app engine backend and a client android application.
The problem is that every video/tutorial out there is using Eclipse to open this client application. When you try to import it to Android Studio, you get an Assertion:Null error.
Another step I tried is that, I opened it in Eclipse, followed google documentation to set
And then tried to import to Android Studio. This time I got an error that the "The filename, directory name, or volume label syntax is incorrect"
Can someone help me out with this? Is it also possible to use the "Generate Mobile Backend" option in android studio? But wouldnt this mean that we cannot leverage the client libraries provided in Mobile Backend Starter?
Edit (to add more details to the question):
If I use the "Tools > Google Cloud Tools > Generate App Engine Backend" method, will I be able to get all the boiler plate code in the Mobile Backend android client?
Also, I tried today to Generate App Engine Backend and point to my existing Mobile Backend Starter app engine project. But this did not bring in end point connections for mobilebackend api. Am I missing something here?
Yes there is an option in Android Studio also for Generating App Engine Backend.
Tools > Google Cloud Tools > Generate App Engine Backend
Here is a nice tutorial on Android Blog for the same
http://android-developers.blogspot.in/2013/06/adding-backend-to-your-app-in-android.html
But look in to this post before doing this as Google App Engine Back-end still uses maven so you need to install that before using it.
Maven needed when generating Google App Engine backend in Android Studio
This is an old question but for those that come to this now the easiest way to get started is with this unofficial build for android studio. Why couldn't google do this themselves?
https://github.com/thagikura/mobile-backend-starter-android-client-with-AndroidStudio

Categories

Resources