79501694

Date: 2025-03-11 17:58:14
Score: 6.5 🚩
Natty:
Report link

Thanks Leon Unfortunately it still doesn't work, I inserted in the Manifest:

<uses-permission android:name="android.Manifest.permission.WAKE_LOCK"/>

<receiver android:name=".MyReceiver" android:exported="true" android:enabled="true">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
</receiver>

I made the receiver like this:

[BroadcastReceiver(Name= "MyReceiver", Enabled = true,Exported =true)]
[IntentFilter(["com.google.firebase.MESSAGING_EVENT"])]
public class MyReceiver : BroadcastReceiver
{
    public override void OnReceive(Context? context, Intent? intent)
    {
        if (intent != null && context!=null) 
        { 
                Intent serviceIntent = new(context, typeof(NotificationMessagingService));
              
                if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
                {
                    Android.App.Application.Context.StartForegroundService(serviceIntent);
                }
                else
                {
                    Android.App.Application.Context.StartService(serviceIntent);
                }
                Intent main = new(context, typeof(MainActivity));
                context.StartActivity(main);
        }
    }
}
I also tried to insert the full name in the Receiver name, with no success.

The Messages I send are of this type:

Message message = new()
{
Data = new Dictionary<string, string>()
{
{"xxx","xxx"},
{"yyy","yyy"}
},
Topic = "gggg'
};
Do you have any other suggestions?
Tanks.
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • RegEx Blacklisted phrase (2): any other suggestions?
  • RegEx Blacklisted phrase (2): it still doesn't work
  • RegEx Blacklisted phrase (2.5): Do you have any
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Antonio Moscati