-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Needs Attentionplatform: allplugin: messagingFCM only - ( messaging() ) - do not use for NotificationsFCM only - ( messaging() ) - do not use for Notificationstype: documentation
Description
Documentation Feedback
Please describe your documentation issue or suggested improvement in detail here and provide links to any pre-existing/relevant documentation and screenshots if necessary:
In https://rnfirebase.io/messaging/usage#ios---requesting-permissions
The "deprecated" usage is documented.
I've tried to use the modular "recommended" one, but without success.
I've changed it to:
import { hasPermission, requestPermission } from "@react-native-firebase/messaging";
// changed from messaging.hasPermission();
let permission = await hasPermission(/* Messaging instance expected */);
// ...
//changed from messaging.requestPermission()
permission = await requestPermission(
/* messaging: Messaging, iosPermissions?: FirebaseMessagingTypes.IOSPermissions */)
);
Or is it ment to not be used at all?
const firebaseApp = getApp();
const messaging = getMessaging(firebaseApp);
// But... Error: No Firebase App '[DEFAULT]' has been created - call firebase.initializeApp()
It is not clear to me what should be used now, and where the messaging
object should come from. Please update the docs.
Metadata
Metadata
Assignees
Labels
Needs Attentionplatform: allplugin: messagingFCM only - ( messaging() ) - do not use for NotificationsFCM only - ( messaging() ) - do not use for Notificationstype: documentation