-
Notifications
You must be signed in to change notification settings - Fork 444
Closed
Labels
Description
Environment
Xcode version: 10.3
Deployment Target: 9.0
Firebase Unity SDK version: 6.0.0
Firebase Component: Core, Messaging
Unity 2017.1.11
Problem
We have problem when using FCM in iOS. When our app is in background, we don’t receive any push notifications in notification center, but is fine in foreground. Same problem repeats on older builds, where everything was fine before. This problem happens on all out projects. We use apns key for messaging. Swizzling enabled
Relevant code
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
var dependencyStatus = task.Result;
if (dependencyStatus == DependencyStatus.Available) {
IsReady = true;
Debug.Log("firebase init complete");
SignInAnonimously();
analyticsManager.SetFirebaseInitialized();
InitMessaging();
}
else {
Debug.LogError(String.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
}
});
void InitMessaging() {
RegisterFirebaseMessagingCallbacks();
}
public void RegisterFirebaseMessagingCallbacks() {
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
}
private void OnTokenReceived(object sender, Messaging.TokenReceivedEventArgs token) {
_firebaseToken = token.Token;
IsTokenRecieved = true;
}