Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
702 views
in Technique[技术] by (71.8m points)

swift - Why does not receive FCM notifications on IOS when the app is in background and receive in foreground? Flutter

I have a Flutter app that sends Firebase notifications to all the users at some moment. It is working fine at android but in iOS only works with the app open. If I close the app (or go to main screen for example), it did not receive anything.

I already setted 'priority' : 'high', "content_available" : true and still not working. What can I do to perform it?

If you need some code/info I update the question.

UPDATE: Yes, i'm using onResume

    _firebaseMessaging.configure(

      onMessage: (Map<String, dynamic> message) async {
        print("onMessage: ${message}");
        print(message['notification']['body']);

      },

      onLaunch: (Map<String, dynamic> message) async {
        print("onMessage: ${message}");
      },
      onResume: (Map<String, dynamic> message) async {
        print("onMessage: ${message}");
      },
    );

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Are you using onResume in configuration?
You need to add it. Check it out

onResume


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...