stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

Error while adding device for push notification

Open coder-Aayush opened this issue 1 year ago • 3 comments

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

iOS, Android

What version are you using?

stream_chat_flutter: ^8.0.0-beta.3

What happened?

While adding device to stream chat, it throws the error:

StreamChatNetworkError(code: 4, message: CreateDevice failed with error: "push provider "" with type "firebase" not found, available push providers for this application: type: "firebase" name: "firebase"", statusCode: 400, data: ErrorResponse(code: 4, message: CreateDevice failed with error: "push provider "" with type "firebase" not found, available push providers for this application: type: "firebase" name: "firebase"", statusCode: 400, moreInfo: https://getstream.io/chat/docs/api_errors_response))
)

Here is a sample code to reproduce:-

 final currentUser = UserModel.currentUser();
    final client = ref.read(streamChatProvider);
    if (client.state.currentUser != null) {
      return client.state.currentUser;
    }
    final token = await FirebaseFunctions.instance.httpsCallable('streamToken').call({
      'userId': currentUser?.uid,
    });
    final user = User(
      id: currentUser?.uid ?? '',
      extraData: currentUser?.toExtraData ?? {},
    );
    final ownUser = await client.connectUser(user, token.data);
    FirebaseMessaging.instance.getToken().then(
      (value) {
        if (value != null) {
          client.addDevice(value, PushProvider.firebase, pushProviderName: 'firebase');
        }
      },
    );

    print('ownUser: $ownUser');

GetStream Configuration

Screenshot 2024-08-25 at 5 04 15 AM

Steps to reproduce

1. Go to getstream dashboard
2. Navigate to Push Notification.
3. Add New Firebase Configuration with JSON from Firebase Service Account
4. Save the configuration.

Supporting info to reproduce

No response

Relevant log output

No response

Flutter analyze output

No response

Flutter doctor output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

coder-Aayush avatar Aug 24 '24 23:08 coder-Aayush

This issue is stale because it has been open for 20 days with no activity.

github-actions[bot] avatar Sep 14 '24 00:09 github-actions[bot]

This issue is stale because it has been open for 20 days with no activity.

github-actions[bot] avatar Oct 06 '24 18:10 github-actions[bot]


coder-Aayush avatar Oct 07 '24 04:10 coder-Aayush

This issue is stale because it has been open for 20 days with no activity.

github-actions[bot] avatar Oct 27 '24 12:10 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Nov 03 '24 12:11 github-actions[bot]

re-open this

coder-Aayush avatar Nov 08 '24 19:11 coder-Aayush