flutter - Alert + Data FCM message does not always trigger FirebaseMessaging.onMessage on iOS - Stack Overflow
I have a very simple flutter app which listens to firebase notifications.
The part listening is this:
FirebaseMessaging.onMessage.listen((RemoteMessage message) => print("hello"))
and the message being sent (from go) is this:
var apsMessage = messaging.Aps{
ContentAvailable: true,
MutableContent: true, // I think I don't need this
Alert: &messaging.ApsAlert{
Title: "Incoming message",
Body: "mybody",
},
CustomData: map[string]interface{}{
"interruption-level": "active",
},
Sound: "default"
}
messagingClient.Send(ctx, &messaging.Message{
Token: token,
Android: ...,
APNS: &messaging.APNSConfig{
Headers: map[string]string{
"apns-priority": "10"},
Payload: &messaging.APNSPayload{
Aps: &apsMessage,
CustomData: map[string]interface{}{
"data_key": "data_value",
},
},
},
})
During the tests the app is always in the foreground, and I'm using a physical iPhone with the latest iOS 18.
The first message is being received correctly - I can see the notification popping and I can see the print in the MacOS console.
From the second message onwards I can only see the notification popping, but the print is never called.
It means that the code is technically correct, and does run correctly the first time, but subsequent notifications simply don't trigger the onMessage listener until some seemingly random time later when it does work. I don't seem to figure out what sequence of steps or how long it takes before it works again.
I saw that iOS throttles in case of exceptions but I don't see any exceptions on the onMessage callback.
Any reason iOS would simply choose not to call my callback?
- 已故打车软件的反思 :我们为何被滴滴打败
- 全球PC销量创五年新低 硬件式微应用崛起
- 谷歌正在复制苹果模式?(图)
- 打击终端恶意软件:刷机市场是漏网之鱼?
- 研究机构:平板四年内将成主流计算设备
- powershell - Windows AutoPilot - Set Auto Login - Stack Overflow
- filename has 'netboxlabs-diode-netbox-plugin', but metadata has 'unknown' - Stack Overflow
- sql - Ranking query records in specific order - Stack Overflow
- reflection - java.lang.reflect.field.set(obj,value) fails for applicationscoped - Stack Overflow
- c - Segmentation fault when access mapped memory - Stack Overflow
- caching - How is the userUX affected by cache purge by a WordPress plugin? Cookie consent settings is not affected? - Stack Over
- python - Change one pair of vertices to create a cycle in an oriented graph - Stack Overflow
- c# - Trouble when setting up Serilog in ASP.NET Core Web API - Stack Overflow
- c# - Instantiated gameObject in Unity will not update the transform.position - Stack Overflow
- reactjs - React and Electron application suggesting I'm using invalid hook calls - Stack Overflow
- java - YubiKey PIV AuthenticationDecryption returns 0x6A80 error - Stack Overflow
- Conflicting dependencies while installing torch==1.10.0, torchaudio==0.10.0, and torchvision==0.11.0 in my Python environment -