Conversation
…ptional dependency)
|
Update: It's apperant that yarn is not pulling the right branch. Hence the old header file with the missing class. I installed react-native-firepase via Original Problem Description DetailsI run into the following issue with cloud messaging `/AppDelegate.m:52:24: No known class method for selector 'didReceiveRemoteNotification:'`Implementing Cloud Messaging according to
Changing When cmd+click on #ifndef RNFirebaseMessaging_h
#define RNFirebaseMessaging_h
#endif
#import <UIKit/UIKit.h>
#import "Firebase.h"
#if __has_include(<React/RCTEventEmitter.h>)
#import <React/RCTEventEmitter.h>
#else // Compatibility for RN version < 0.40
#import "RCTEventEmitter.h"
#endif
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#else // Compatibility for RN version < 0.40
#import "RCTBridgeModule.h"
#endif
#if __has_include(<React/RCTUtils.h>)
#import <React/RCTUtils.h>
#else // Compatibility for RN version < 0.40
#import "RCTUtils.h"
#endif
@import UserNotifications;
@interface RNFirebaseMessaging : NSObject <RCTBridgeModule>
typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result);
typedef void (^RCTWillPresentNotificationCallback)(UNNotificationPresentationOptions result);
typedef void (^RCTNotificationResponseCallback)();
@property (nonatomic, assign) bool connectedToFCM;
#if !TARGET_OS_TV
+ (void)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull RCTRemoteNotificationCallback)completionHandler;
+ (void)didReceiveLocalNotification:(nonnull UILocalNotification *)notification;
+ (void)didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response withCompletionHandler:(nonnull RCTNotificationResponseCallback)completionHandler;
+ (void)willPresentNotification:(nonnull UNNotification *)notification withCompletionHandler:(nonnull RCTWillPresentNotificationCallback)completionHandler;
#endif
@end
|
|
@D1no have you tried deleting your You may always want to try to pin to the latest commit on |
|
Am currently in the process of releasing this so you shouldn't have these probs in a moment. |
|
Yes, a clean install. That is the reason I was surprised. Edit: Awesome @Salakar 😁 than I discard now the yarn via git@ install. I go and get a coffee 🙏 Edit2: Yeah, pinning to commit is what I did to fix it. |
|
@Salakar Cool! 🎉 Btw, "confirmPasswordReset" and "applyActionCode" are still missing in Auth. If they aren't added earlier, I will open a PR once I migrate to v2 next week (currently running a fork of the predecessor of this repo). Also, any plans on supporting Dynamic Links in the future? 😄 |
|
@sraka1 we'll add those two auth functions to a minor/patch version in the next few days unless you beat us to it 😸 - we wanted to get v2 out the door rather than constantly adding to the todo list and v2 being delayed further. We've yet to look into links, the next priority feature wise for us is js side firebase app configuration (no more plist/json fiddling) and with that mutli firebase app support. |
|
Super Awesome 🚀 ! Firebase Invites than App Indexing are certainly super interesting. Dynamic Links is really a question of how that enters the void of react native navigators (we use flux navigator).
Well, not sure if that is so relevant. All the firebase sdk related material are always surrounded by the plist / json part. Not sure if the abstraction is something worth adding as a new fault line if people start to rely on it.
|
|
@D1no it's another step in the direction of making it compatible with the web sdk, plus would be a lot less effort required for beginners (something we get a lot of). Additionally it would allow initialising multiple firebase instances at the same time - just like the web, which has its use cases and has been requested before. Plist/json support will still remain if people want to use it though. And finally also simplifies switching firebase instances per environment e.g. one for dev one for prod. Doesn't mean however that we're not gonna look into Dynamic Links / App Indexing - there's 3 of us working on the project ;p I'm just tackling the above next myself |
|
This was not an intended pull on priorities. Being able to change environments at runtime could be interesting though 🤔 codepush...cough... |
|
@D1no no worries was just stating the reasoning behind it that's all. Flipping projects over via codepush would be cool 😸 |
|
@D1no to piggyback on what @Salakar said - I'm one of the people requesting configurability on JS side, although I asked for it after @Salakar wrote that comment :) I explained my reasoning in this comment. This isn't just for different environments (although that's a valid use case), it's for runtime production configuration. I don't think code push would even work. So it's definitely a really useful thing to have :) |
Implemented as of v2.0.2 - as well as |
|
About code-push, I created an issue there: microsoft/react-native-code-push#1185 (comment) I believe there can be an "AsyncStorage" usage for applying some settings (like dynamic links) again after code-push is triggered. What do you think? |
|
@D1no just thought you might like to know as of v4 Firebase Dynamic Links and Firebase Invites are supported: https://github.com/invertase/react-native-firebase/releases/tag/v4.0.0-rc.2 . We've yet to look at App Indexing. |


Migration guide
A guide to upgrading from v1 to v2 can be found on the docs here.
Change Log
Version 2.0.0 of RNFirebase introduces a new features, breaking changes, deprecations (matching v4 of the web SDK) and general build / dependency improvements.
New Features
Ads
Performance Monitoring
RNFirebase now supports the recently released Performance Monitoring module. Much like Crash Reporting, automatic events (traces) are delivered to your console whilst providing support to register custom traces. See the documentation on how to use this in your app.
Implemented methods:
boolean)string):TraceTrace.start():voidTrace.incrementCounter(event:string):voidTrace.stop():voidRemote Config
Auth
Promise<Array<String>>implementedCrash
Bug Fixes
onAuthStateChangereturned a different result on state changes.Breaking Changes & Deprecations
providerIdshould now be used instead ofproviderwhilst obtaining auth credentials. The latter will be removed in future releases.User.getTokenin favour ofUser.getIdToken.User.reauthenticatehas been removed in favour ofUser.reauthenticateWithCredential.User.linkhas been removed in favour ofUser.linkWithCredential.didReceiveNotificationResponseandwillPresentNotificationmethods for iOS messaging. Added additionaldidReceiveRemoteNotificationmethod.Android
All firebase modules are now optional so you only need to import the Firebase functionality that you require in your application.
You need to make a couple of changes to your
app/build.gradlefile. Update the react-native-firebase compile statement to read:Add each of the firebase modules you need from the following list:
Update
MainApplication.javaand import the modules as required:Add the packages to the
getPackages()method as required:iOS
All firebase modules are now optional so you only need to import the Firebase functionality that you require in your application. Simply update your Podfile to only include the Firebase modules for functionality that you require in your app.