In Home Screen Notification can't received

In Home Screen Notification can’t received in flutter

Hi, could you elaborate a little bit more? and please provide us sdk information (firebase_messaging, sendbird) and platform

sendbird_sdk: ^3.0.14-nullsafety
firebase_messaging: ^10.0.2
flutter_apns: ^1.5.0

would you explain a little bit more detail about the situation? what is “Home screen notification”?

Home Screen means what

1st screen is dashboard screen.

In dashboard screen one chat button.

When I’m in dashboard screen then here not getting any notifications.

I am afraid I understand your statement correctly. As far as I know and from recent test with sample, push notification works fine. Please attach code snippet how you register push token, also make sure you upload server key (android) and apns p12 certificate on sendbird dashboard.

Hi, good morning.

This is my code please download → https://www.dropbox.com/s/06e3ywcfrxulsps/Sendbird-Flutter-master.zip?dl=0

as my code we need notification.

Hello, any update for my code?

Hi @Hitesh_Sapra,

Apologies for the delay, I just looked over your modified code and noticed your HomeScreen.dart file supercedes the channel_list_screen.dart file where the APNS token is registered with Sendbird. To get push notifications working in your code, move the following code from the channel_list_screen to your HomeScreen file:

// HomeScreen.dart

// Add these imports
import 'package:sendbird_flutter/main.dart';
import 'dart:io';

...

class _HomeScreenState extends State<HomeScreen> {

  // Add this function to register the APNS token with Sendbird
  _registerTokenIfNeeded() async {
    final token = appState.token;
    if (token != null)
      await sendbird.registerPushToken(
        type: Platform.isIOS ? PushTokenType.apns : PushTokenType.fcm,
        token: token,
      );
  }

  // Call the function from an initState override
  @override
  initState() {
    _registerTokenIfNeeded();
    super.initState();
  }


Hi Good Morning.

Thank you for your email.

As per your code I implement it in HomeScreen. but this code isn’t working on any device’s notification.

Hi @Hitesh_Sapra,

Apologies you’re still encountering this issue.

Just to double check, for iOS, did you already complete steps 1-3 in creating and registering your certs to both Apple and Sendbird?

And the same for Android, steps 1-3 in setting up the credentials and adding them to your Sendbird Dashboard?

As per your request, I check all step and as per the setup I added all for android. Right now we are check in android if android working fine then setup on iOS.

Thanks you.

1 Like

Hello,

As per your request, I check all steps and as per the steps I added all for android in already added all information. And one more thing now we are checking in android if working fine then set up on iOS.

Can you please support me because this issue was created on 1st July but you have not given any solution.

Thank you. Regards

Hi @Hitesh_Sapra,

So you’re still unable to send push notifications? If you’re okay with it, I’ll send a message to the email address you used to register for the community to set up a meeting for us to work through this.

Jason