Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CleverTap App Inbox Blank Screen Issue on iOS #273

Open
pranav-12 opened this issue Dec 6, 2024 · 1 comment
Open

CleverTap App Inbox Blank Screen Issue on iOS #273

pranav-12 opened this issue Dec 6, 2024 · 1 comment

Comments

@pranav-12
Copy link

Description

When using the CleverTap plugin (version 2.5.0), the app inbox feature works as expected on Android, displaying messages correctly. However, on iOS, the inbox screen remains blank without showing any messages or errors.

Environment

  • CleverTap Plugin Version: 2.5.0
  • Flutter Version: 3.24.5
  • Dart Version: 3.5.4

Steps to Reproduce

  1. Open the app on an iOS device.
  2. Navigate to the Notifications screen within the app.
  3. The inbox should load here but shows a blank screen instead.

Expected Behavior

The app inbox should display the messages as it does on Android, showing both read and unread messages accordingly.

Actual Behavior

The inbox screen is blank on iOS, with no messages displayed.

Code Snippet

"import 'dart:developer';

import 'package:clevertap_plugin/clevertap_plugin.dart';
import 'package:edge/features/main_screen/presentation/controllers/main_controller.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

class NotificationScreen extends StatefulWidget {
const NotificationScreen({super.key});

@OverRide
State createState() => _NotificationScreenState();
}

class _NotificationScreenState extends State
with WidgetsBindingObserver {
final _cleverTapPlugin = CleverTapPlugin();
final MainController mainCtrl = Get.find();

@OverRide
void initState() {
WidgetsBinding.instance.addObserver(this);
setupInboxCallbacks();

super.initState();

}

@OverRide
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}

@OverRide
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
// The app is back in the foreground
Get.back(result: {'index': '0'});
log("The app has returned to the foreground");
// Handle any updates or actions you need to take
}
}

Future openInbox() async {
var styleConfig = {
'tabs': ['Read', 'Unread'],
'noMessageTextColor': '#ff6600',
'noMessageText': 'No message(s) to show.',
'navBarTitle': 'Notification',
'backgroundColor': '#ffffff',
'navBarColor': '#ffffff',
'navBarTitleColor': '#000000',
'messageTagsColor': '#0000ff',
'messageTagsBackgroundColor': '#e0e0e0',
'unselectedTabColor': '#cccccc',
'selectedTabColor': '#ff6600',
};
CleverTapPlugin.showInbox(styleConfig);
}

Future setupInboxCallbacks() async {
try {
log(" initialization...... ");
await CleverTapPlugin.initializeInbox();

  _cleverTapPlugin.setCleverTapInboxDidInitializeHandler(
    () async {
      log("Inbox initialized  ");
      openInbox();
    },
  );
  _cleverTapPlugin.setCleverTapInboxMessagesDidUpdateHandler(
      mainCtrl.getUnreadNotificationCount);
  // Retrieve the inbox message count or show count to ensure it's being populated
  CleverTapPlugin.getInboxMessageCount().then((count) {
    log("Total Inbox messages: $count");
  });

  CleverTapPlugin.getUnreadInboxMessages().then((unreadCount) {
    log("Unread Inbox messages: $unreadCount");
  });
} on Exception catch (e) {
  log("error found in clevertap :---${e.toString()}");
}

}

@OverRide
Widget build(BuildContext context) {
return SizedBox();
}
}
"

Vidoes attached

Android_notification.webm
Ios_Notification.MP4
@Sonal-Kachare
Copy link
Contributor

Hey @pranav-12,
Please enable debug logs using CleverTapAPI.setDebugLevel and check if you are receiving data in "inbox_notifs".
I've checked this in our sample app and inbox notifications are being shown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants