Xamarin.Android = 7.2.0.7
Windows 10 Professional - Visual Studio 2015
Xamarin.Firebase.Messaging 10.2.1 V42.1021.0-beta-1
The code below will work when I build and install the release version for the very first time on a physical mobile phone Android Lollipop. Subsequent build/rebuild to the release version the token value returned will be exactly the same as the first instance but sending message from the Firebase website will return an error saying "unregistered registration token".
firebaseinstanceid = FirebaseInstanceId.Instance;
Log.Info(TAG, "Service Firebase Token: " + firebaseinstanceid.Token.ToString());
1) Build the app as release version and install from VS. Send message from Firebase website.
First time no problem the token is good. (make sure the app is not install in the mobile phone).
2) Rebuild App as release version and install from VS, Token value returned by the Firebase method still the same as first install but now the firebase website shows. "Unregistered Registration Token"
-- No error from adb logs or onMessage
My question is why is the Firebase Server knows that the token is invalid but the Firebase method in my app is not refreshing the token?
VS bug #732435
@alberk8 the same problem here... the Stackoverflow has many others with the same problem... anyone knows a workaround?
Same problem. Last few days sometimes i cannot even obtain firebase token...
same problem here. Gonna keep using GCM until solved.
Seriously Xamarin, this issue is from April, it is bad (blocks use of Firebase) and no-one from the team has responded in any way in all this time. Has all Xamarin development been stopped? Or just the really important parts such as addressing critical bugs?
Señores de Xamarin- Microsoft por favor solución.
the issue is still very much active , any solution for this or we have to use GCM ?
It's October, this is still an issue
November... I still have to uninstall and rebuild the app before each launch when testing firebase.
Almost December. Same situation.
While I'm trying to reproduce this, has anyone tried without fast-deploy enabled?
So far I've had zero success in reproducing this issue.
VS 2017 on Windows, latest Xamarin and Visual Studio updates as of 2017-12-05
I'm using Firebase Messaging 60.1142.0-rc1 and compiling against Android 8.0 (API 26).
I setup my test.keystore's sha1 signature in the Firebase Console for my app, downloaded the google-services.json file and added it to my project with a GoogleServicesJson build action type.
My app is set to use the same keystore for each release build via the .csproj:
<PropertyGroup>
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>test.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>test</AndroidSigningStorePass>
<AndroidSigningKeyAlias>test</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>test</AndroidSigningKeyPass>
</PropertyGroup>
I tried building and deploying to device, the app runs, I get a token, and I can use the Firebase Console to send a test message to it.
Next, I changed a bit of code, cleaned my project, and built it again. I deployed to the device and again got the same token as the previous build. I sent another message through the Firebase Console and received it successfully.
If anyone's got more insight into what I'm missing in trying to reproduce this, please let me know.
It may be because you're using the RC version of Firebase Messaging.
De: Jonathan Dicknotifications@github.com
Enviado: martes, 5 de diciembre de 2017 17:21
Para: xamarin/GooglePlayServicesComponentsGooglePlayServicesComponents@noreply.github.com
CC: Alexei Humeniyyo@ahumeniy.net; Commentcomment@noreply.github.com
Asunto: Re: [xamarin/GooglePlayServicesComponents] Firebase Token not Registered (#57)
So far I've had zero success in reproducing this issue.
VS 2017 on Windows, latest Xamarin and Visual Studio updates as of 2017-12-05
I'm using Firebase Messaging 60.1142.0-rc1 and compiling against Android 8.0 (API 26).
I setup my test.keystore's sha1 signature in the Firebase Console for my app, downloaded the google-services.json file and added it to my project with a GoogleServicesJson build action type.
My app is set to use the same keystore for each release build via the .csproj:
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>test.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>test</AndroidSigningStorePass>
<AndroidSigningKeyAlias>test</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>test</AndroidSigningKeyPass>
I tried building and deploying to device, the app runs, I get a token, and I can use the Firebase Console to send a test message to it.
Next, I changed a bit of code, cleaned my project, and built it again. I deployed to the device and again got the same token as the previous build. I sent another message through the Firebase Console and received it successfully.
If anyone's got more insight into what I'm missing in trying to reproduce this, please let me know.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/xamarin/GooglePlayServicesComponents/issues/57#issuecomment-349428970, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGSgRngdrnkUS30MO1TgkuD7PdHvdFpAks5s9aXbgaJpZM4NIZDR.
That's possible. However we just provide bindings to googles' libraries, so if it's working on this version as opposed to older versions i'm inclined to say Google has fixed a bug on their end.
60.1142.0-rc1 will be going stable today or tomorrow. I'd suggest you try with that version.
I had this problem, took me way to many hours to figure it out, but in my AndroidManifest.xml, the receiver tags where not inside the application tag.
before
<application android:label="MyApp" android:icon="@drawable/icon"></application>
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" 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>
after
<application android:label="MyApp" android:icon="@drawable/icon">
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" 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>
</application>
Here are some recreation samples. Initially I was seeing this issue when tied to Azure Push Notification
FirebaseIssueAzurePush.zip
I have all the components libraries updated to the latest version. I've tested this on VSfM and VSfW
basically
When I have the Azure Mobile packages installed, whenever I f5 it does a build of the Android project. Even if I haven't changed any files it still does a build of the Android project and causes the issue
So I created a second sample
This sample has Azure Mobile bits totally removed. With this sample if I f5 without making any changes then the token stays valid between f5's. But if you change anything on the android project (like add a space somewhere) then f5 the token becomes invalidated and doesn't refresh.
Ideally in either case if that token becomes invalidated it'd be nice for it to refresh.
In both cases the static Token field still holds the old invalid token
C#
if (!string.IsNullOrWhiteSpace(Firebase.Iid.FirebaseInstanceId.Instance.Token))
{
Console.WriteLine(Firebase.Iid.FirebaseInstanceId.Instance.Token);
}
@dellis1972 do you have any ideas around what might be changing in the app between app deploys? It seems like _something_ is changing causing Android to invalidate the previous token.
@PureWeen any chance you'd be willing to try this in Android Studio and see if it behaves differently?
@Redth I tested using this sample
https://github.com/firebase/quickstart-android/tree/master/messaging
And AFAICT the token never gets invalidated
At no point did it try to re-issue me a token. The same token just kept on working through the process
Seems like we _must_ do something different in our deploy to cause this.
Has this issue been further investigated since 18-Apr? Any progress?
@zlatko5 @alberk8 Can you try the latest preview for Xamarin.Firebase.Messaging please, its now at version 70.1710.0-preview2.
Thanks
check if AndroidManifest.xml is same both in not working (release?) and working (debug?) version. (analyze both APKs through Android studio Analyze APK feature)
I had an issue with other library - somehow release version got some autogenerated
Thanks for that suggestion.
Any update on this? It's still a problem.
Closing this one.
Try newer libraries.
For older versions add Xamarin.Android.ManifestMerger.
if the issue persists - open new one, please.
Most helpful comment
I had this problem, took me way to many hours to figure it out, but in my AndroidManifest.xml, the receiver tags where not inside the application tag.
before
after