Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] <FIRAnalytics/WARNING> setScreenName:screenClass: must be called after a view controller has appeared #48

Open
dieppe opened this issue Feb 14, 2017 · 7 comments

Comments

@dieppe
Copy link

dieppe commented Feb 14, 2017

Each time I try to call setScreenName I get the following warning:

<FIRAnalytics/WARNING> setScreenName:screenClass: must be called after a view controller has appeared

To get the warning you have to first set FirebaseAutomaticScreenReportingEnabled to NO in the Info.plist.

Afaict no screen event is sent when the warning appears.

@damir-sirola
Copy link
Contributor

Did you manage to get around this?

@dieppe
Copy link
Author

dieppe commented Mar 21, 2017

Nope, we don't really use this feature right now (it's kinda buried in the console...) so I did not have time to dedicate to this.

@annelorraineuy
Copy link

I am using this but i dont see the value of the screen name I send, it's always MainActivity on the console.

@Twinski
Copy link

Twinski commented Jun 23, 2017

Yeah, got the same error :(

Maybe a workaround could be:
firebase.analytics().logEvent('screen_profile');

@jordanmkoncz
Copy link

I'm having the same warning appearing as well every time I try to call setScreenName. I'm testing in the iOS simulator, and I'm not seeing any screen name events appearing in the Firebase Console.

My Environment

software version
react-native-firebase-analytics 3.0.1
react-native 0.41.2

@adgarcia
Copy link

so, I think this is happening because the RN view lifecycle doesn't really match up that well w/ the ViewController life cycle. I've had better luck calling setScreenName inside a timeout, but that's also not a great solution. It really needs to be tied to the -viewDidAppear: method

afaik this isn't an issue w/ the library; you can wrap the FIRAnalytics method yourself and, if you call it from componentDidMount or render, you'll see this error message every(?) time

@newuser44
Copy link

newuser44 commented Sep 7, 2018

Anybody get this working for Ionic apps? We can't seem to see any screenNames in firebase for ios. All I can find is old posts from over a year ago with no real solution.
arnesson/cordova-plugin-firebase#828

How have you got this working with a timeout?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants