Firebase cloud messaging open rate shows 0 for iOS all the time

Viewed 20

The application I'm working on is based on flutter and published for both Android and iOS.

We have been sending push notifications from firebase panel for the last 6 months but we have never seen open rates for the iOS devices.

Here is an example campaign with 1510 successful messages;

Screenshot

From the same campaign, Android has 260 sends and 31 opens:

Screenshot

But, when we check iOS, we have 1250 sends and 0 opens:

Screenshot

It is like this for all the campaigns we sent. No data for iOS. And, in analytics, iOS has the most user interactions already.

I'm handling the messages like below for both of the OSes:

 Future main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  await FirebaseMessaging.instance.requestPermission(
    provisional: true,
  );
  FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler);
  FirebaseMessaging.instance
      .getInitialMessage()
      .then((RemoteMessage message) async{
    if (message != null) {
      final prefs = await SharedPreferences.getInstance();
      for (var dataObject in message.data.entries) {
        if(dataObject.key == "customURL"){
          await prefs.setString('customURL', dataObject.value);
        }else{
          await prefs.setString('customURL', "");
        }
      }
    }
  });
  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
      .then((_) {
    runApp(MyApp());
  });

}

Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message) async {

  for (var dataObject in message.data.entries) {
    if(dataObject.key == "customURL"){
      final prefs = await SharedPreferences.getInstance();
      await prefs.setString('customURL', dataObject.value);
    }
  }
  print("_receiveNotification onBackgroundMessage" + message.notification.title);
  log("Handling a background message");

}

Do I need to add a custom event handler for iOS? I searched most of the docs but couldn't see any indicator for it.

0 Answers
Related