Android Question Related to Firebase

hatzisn

Well-Known Member
Licensed User
Longtime User
I have an Android 4.1.2 Device. If I add the following code to my manifest as you suggest
in this post:
https://www.b4x.com/android/forum/threads/integrating-firebase-services.67692/

The application does not even start and execution breaks without any logs (with #BridgeLogger).
Is my android device responsible or am I doing something wrong? What is the following code
in manifest needed for? Is it generally needed when you add firebase to your application or the
"'************ Firebase Base ************" refers to a database in Firebase?



B4X:
'************ Firebase Base ************
CreateResourceFromFile("google-services", "google-services.json")
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(com.google.android.c2dm.permission.RECEIVE)
AddPermission(${applicationId}.permission.C2D_MESSAGE)
AddManifestText( <permission android:name="${applicationId}.permission.C2D_MESSAGE"
  android:protectionLevel="signature" />)
AddApplicationText(
<receiver
  android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
  android:enabled="true">
  <intent-filter>
  <action android:name="com.google.android.gms.measurement.UPLOAD"/>
  </intent-filter>
  </receiver>

  <service
  android:name="com.google.android.gms.measurement.AppMeasurementService"
  android:enabled="true"
  android:exported="false"/>
   <provider
  android:authorities="${applicationId}.firebaseinitprovider"
  android:name="com.google.firebase.provider.FirebaseInitProvider"
  android:exported="false"
  android:initOrder="100" />
    <receiver
  android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
  android:enabled="true">
  <intent-filter>
  <action android:name="com.google.android.gms.measurement.UPLOAD"/>
  </intent-filter>
  </receiver>

  <service
  android:name="com.google.android.gms.measurement.AppMeasurementService"
  android:enabled="true"
  android:exported="false"/>
   <receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
  android:exported="true"
  android:permission="com.google.android.c2dm.permission.SEND" >
  <intent-filter>
  <action android:name="com.google.android.c2dm.intent.RECEIVE" />
  <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
  <category android:name="${applicationId}" />
  </intent-filter>
  </receiver>
    <receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
  android:exported="false" />


  <service
  android:name="com.google.firebase.iid.FirebaseInstanceIdService"
  android:exported="true">
  <intent-filter android:priority="-500">
  <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
  </intent-filter>
  </service>
)
'************ Firebase Base (end) ************
 

DonManfred

Expert
Licensed User
Longtime User
refers to a database in Firebase?
refers to any firebase library. There are some snippets. Add all of them which are needed.
Start with giving us enough information. Upload a small project which shoes the problem. Tell us what exactly you want to implement.

It is difficult to help you if you do not give enough informations!
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
I am just experimenting. I do not want to add a Firebase library. I saw the "Always required when using Firebase:"
when I was trying to update to the new version of google maps library (2.00) an old app and in the relative tutorial I saw
that firebase is needed. I created a firebase account and I added my application. I also added the first two manifest
snippets and the application ceased to work. It did not even log anything as you saw in the first post. I then removed the
second snippet and it worked perfectly. So my question is if the manifest snippet in the first post and the "Always required when
using Firebase:
" title is generally needed or needed for specific reasons... Anyway the app I was trying to update worked
perfect with the Google Maps Library 2.00 and I wanted to make sure if it will work on Android 8.0+ (tested in Android 7.0)
if I do not add the snippet in the first post.
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
Thanks Erel
 
Upvote 0
Top