FirebasePushNotificationPlugin icon indicating copy to clipboard operation
FirebasePushNotificationPlugin copied to clipboard

Not getting the token in android release mode

Open stesvis opened this issue 4 years ago • 14 comments

🐛 Bug Report

In android i am never getting the token if I follow this guideline in release mode:

            //If debug you should reset the token each time.
            #if DEBUG
              FirebasePushNotificationManager.Initialize(this,true);
            #else
              FirebasePushNotificationManager.Initialize(this,false);
            #endif

Expected behavior

Token is generated

Reproduction steps

This never gives me a token:

            //If debug you should reset the token each time.
            #if DEBUG
              FirebasePushNotificationManager.Initialize(this,true);
            #else
              FirebasePushNotificationManager.Initialize(this,false);
            #endif

But this does (true in release too):

            //If debug you should reset the token each time.
            #if DEBUG
              FirebasePushNotificationManager.Initialize(this,true);
            #else
              FirebasePushNotificationManager.Initialize(this,true);
            #endif

Configuration

Version: 3.3.10

Platform:

  • [ ] :iphone: iOS
  • [x] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [ ] :monkey: Xamarin.Forms

stesvis avatar Feb 15 '21 23:02 stesvis

Same issue

AdilSaiyad avatar Feb 16 '21 08:02 AdilSaiyad

the same issue

angelru avatar Feb 16 '21 14:02 angelru

Have a look at #320 and #319, maybe that helps

Freddyvdh avatar Feb 26 '21 21:02 Freddyvdh

any solution??

angelru avatar Mar 31 '21 18:03 angelru

I have the same problem.

asoria88 avatar Apr 10 '21 22:04 asoria88

I have the same problem, getting an empty token in release mode but a token received in debug mode v2.3.6.

kalaiy avatar Aug 20 '21 05:08 kalaiy

I have the same problem, getting an empty token in release mode but a token received in debug mode v2.3.6.

I am afraid this plugin is no longer maintained...

stesvis avatar Aug 20 '21 15:08 stesvis

Any news? Someone? This is a huge problem...

Jose-Develaw avatar Sep 10 '21 14:09 Jose-Develaw

...same here ;-((( any help?

nilsE avatar Sep 21 '21 15:09 nilsE

I seem to be getting the token in MainAPplication.cs now, but not always in App.xaml.cs.

MainApplication:

CrossFirebasePushNotification.Current.OnTokenRefresh += async (source, args) =>
{
    // handle it here
}

But I agree that the plusing doesn't seem to be maintained anymore, in fact i have a plan to switch to OneSignal.

stesvis avatar Sep 21 '21 16:09 stesvis

Folks as promised I switched to OneSignal: https://documentation.onesignal.com/docs/xamarin-sdk-setup The notifications work like a charm, there's a lot less configuration on the Xamarin side and it's easier to use, especially if you send notifications with action buttons. Highly recommended. I think this plugin is dead.

stesvis avatar Oct 05 '21 17:10 stesvis

Folks as promised I switched to OneSignal: https://documentation.onesignal.com/docs/xamarin-sdk-setup The notifications work like a charm, there's a lot less configuration on the Xamarin side and it's easier to use, especially if you send notifications with action buttons. Highly recommended. I think this plugin is dead.

can be used with firebase right?

angelru avatar Oct 05 '21 18:10 angelru

can be used with firebase right?

The firebase set up is the same, you will reuse the same Server API Key.

stesvis avatar Oct 05 '21 19:10 stesvis

Any update on this issue?

Kingamattack avatar Nov 30 '21 15:11 Kingamattack