Error while adding device for push notification
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
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
This issue is stale because it has been open for 20 days with no activity.
This issue is stale because it has been open for 20 days with no activity.
This issue is stale because it has been open for 20 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.
re-open this