So I have enabled firebase messaging on my futter app everything works fine but, when I receive the notification in my app it wont sound or vibrate, neither android or ios. I believe FCM does it by default, I also have "IosNotificationSettings(sound: true, badge: true, alert: true)", but the notification just come mute. Do you guys have any Idea what could be happening? I searched for this situation but couldnt find anything about it. Thanks in advance for your help.
class _HomeScreenState extends State<HomeScreen>
with SingleTickerProviderStateMixin {
String _homeScreenText = "Waiting for token...";
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
static const String contato = "contato";
TabController _tabController;
@override
void initState() {
_tabController = new TabController(length: 5, vsync: this);
super.initState();
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) {
print('on message $message');
},
onResume: (Map<String, dynamic> message) {
print('on resume $message');
},
onLaunch: (Map<String, dynamic> message) {
print('on launch $message');
},
);
_firebaseMessaging.requestNotificationPermissions(
const IosNotificationSettings(sound: true, badge: true, alert: true));
_firebaseMessaging.onIosSettingsRegistered
.listen((IosNotificationSettings settings) {
print("Settings registered: $settings");
});
_firebaseMessaging.getToken().then((String token) {
assert(token != null);
setState(() {
_homeScreenText = "Push Messaging token: $token";
});
print(_homeScreenText);
});
_firebaseMessaging.getToken().then((token) {
Firestore.instance.collection("pushtokens").document().setData({"devtoken": token});
});
}