If i understand correctly - the Firebase push messages should be received even the app is fully stopped, isn't it ?
I'm trying the simpest sample as Erel described here https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/
When the sample app is started on several devices - messages sent and received OK, but if to kill it fully on one device and send a message from second - no activity restarted here:
Manifest is so:
How should be ?
I'm trying the simpest sample as Erel described here https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/
When the sample app is started on several devices - messages sent and received OK, but if to kill it fully on one device and send a message from second - no activity restarted here:
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
Dim t As String = Message.GetData.Get("body")
n.Initialize
n.Icon = "icon"
n.AutoCancel = True
n.SetInfo(Application.LabelName, Message.GetData.Get("title") & ": " & t, Main)
n.Notify(1)
CallSubDelayed2(Main, "Show_Reply", t)
End Sub
Manifest is so:
B4X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="peacemaker.mmchaat"
android:versionCode="1"
android:versionName="0.2"
android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="22"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<permission android:name="peacemaker.mmchaat.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="peacemaker.mmchaat.permission.C2D_MESSAGE"/>
<application
android:icon="@drawable/icon"
android:label="mmChaat">
<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="peacemaker.mmchaat.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="peacemaker.mmchaat" />
</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>
<service
android:name="com.google.firebase.messaging.FirebaseMessagingService"
android:exported="true">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="anywheresoftware.b4a.objects.FirebaseNotificationsService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<activity android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:excludeFromRecents="true"
android:exported="false" />
<service
android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
android:exported="true"
android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
<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"/>
<service android:name="com.google.firebase.crash.internal.service.FirebaseCrashReceiverService"
android:process=":background_crash"/>
<service android:name="com.google.firebase.crash.internal.service.FirebaseCrashSenderService"
android:process=":background_crash"/>
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".main"
android:label="mmChaat"
android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".starter">
</service>
<receiver android:name=".starter$starter_BR">
</receiver>
<service android:name=".firebasemessaging">
</service>
<receiver android:name=".firebasemessaging$firebasemessaging_BR">
</receiver>
<service android:name="anywheresoftware.b4a.samples.httputils2.httputils2service">
</service>
<receiver android:name="anywheresoftware.b4a.samples.httputils2.httputils2service$httputils2service_BR">
</receiver>
</application>
</manifest>
How should be ?
Last edited: