Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Firebase Notification Message doesn't work after closing app

$
0
0

I'm trying to test pushing notification from Firebase Cloud Messaging this working fine in debug mode but in Release mode or closing app doesn't work
I Enabled Proguard and multidex but unforunatly it doesn't work for me I used CrossGeeks Plugin for this
and this is my code in android

 //Handle notification when app is closed here
            CrossPushNotification.Current.OnNotificationReceived += async (s, p) =>
            {
                await Helpers.Notify.SendNotification("Firebase", p.Data.ToString());
            };

Notify.cs

public class Notify
    {
        public static async Task SendNotification(string title, string body)
        {
            CrossLocalNotifications.Current.Show(title, body);
        }
    }

Also I know about Difference between data message and Notification message I want to test if the data Message is working fine from
Firebase.consol but no way

finally i test from postman
this Request

http://fcm.googleapis.com/fcm/send
{
"to" : "key=AAAAitv2sYo:APA91bENlw37p5pa7pMIKoVv8CroevA7tK3tVFNGUchhGf....",
"collapse_key" : "type_a",
"data" : {
"body" : "First Notification",
"title": "Collapsing A",
"key_1" : "Data for key one",
"key_2" : "Hellowww"
}
}

Result is

{
    "multicast_id": 7348731546305834574,
    "success": 1,
    "failure": 0,
    "canonical_ids": 0,
    "results": [
        {
            "message_id": "0:1533046545107769%00000000cccfb49c"
        }
    ]
}

I really don't know the problem .. anyhelp ?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>