question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setScreenName:screenClass: must be called from the main thread to ensure that events are associated with the intended screen.

See original GitHub issue

Describe the bug I have tried to set screen name using setScreenName in Angular 8, but it returns “setScreenName:screenClass: must be called from the main thread to ensure that events are associated with the intended screen.”

Expected behavior I expected setScreenName method change screen name, so Firebase Analytics tracks the name I set.

Screenshots Xcode console 스크린샷 2020-07-02 20 42 00

Angular 8 source code 스크린샷 2020-07-02 20 42 58 스크린샷 2020-07-02 20 43 42

and package.json

{
  "name": "shaashop-1.1-ionic",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~8.1.2",
    "@angular/common": "~8.1.2",
    "@angular/core": "~8.1.2",
    "@angular/forms": "~8.1.2",
    "@angular/platform-browser": "~8.1.2",
    "@angular/platform-browser-dynamic": "~8.1.2",
    "@angular/router": "~8.1.2",
    "@capacitor-community/firebase-analytics": "^0.1.3",
    "@capacitor/android": "^2.1.0",
    "@capacitor/core": "^2.1.0",
    "@capacitor/ios": "^2.1.0",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^4.7.1",
    "@ngx-translate/core": "^12.1.2",
    "@ngx-translate/http-loader": "^5.0.0",
    "cordova-support-android-plugin": "^1.0.2",
    "cordova-support-google-services": "^1.4.1",
    "core-js": "^2.5.4",
    "google-libphonenumber": "^3.2.10",
    "i18n-iso-countries": "^6.0.0",
    "rxjs": "~6.5.1",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.801.2",
    "@angular-devkit/build-angular": "~0.801.2",
    "@angular-devkit/core": "~8.1.2",
    "@angular-devkit/schematics": "~8.1.2",
    "@angular/cli": "~8.1.2",
    "@angular/compiler": "~8.1.2",
    "@angular/compiler-cli": "~8.1.2",
    "@angular/language-service": "~8.1.2",
    "@capacitor/cli": "2.1.0",
    "@ionic/angular-toolkit": "^2.1.1",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^8.9.5",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {}
  }
}

Additional context I found “setScreenName:screenClass: must be called after [super viewDidAppear:].” in FIRAnalytics documents

and also found this issue in cordova-firebase-plugin

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gkrajuskacommented, Jul 28, 2020

I have the same problem within a Vue with capacitor project. Upgrading to 0.2.0 (and fixing the “get remoteConfig()” syntax problem manually https://github.com/capacitor-community/firebase-analytics/pull/26) didn’t fix the problem. setScreenName still doesn’t work properly.

If there’s anything you would suggest testing or tweaking, please inform, I will gladly help with the issue.

1reaction
priyankpatcommented, Jul 12, 2020

v.0.2.0 is now published. Please give it a try and let me know of the end result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase IOS : Warning "setScreenName:screenClass
I am not seeing my screen event as expected but I am not sure whether this has anything to do with my code...
Read more >
Question: analytics.setScreenName · Issue #762 - GitHub
I'm doing an app using Nativescript Angular, so, to provide the screen name, on the components, i'm considering to call setScreenName in the ......
Read more >
WAFirebaseImpl.git - Gitblit
setScreenName:screenClass:viewController: must be called from the main thread to ensure that events are associated with the intended screen.
Read more >
PRJ311 Flashcards - Quizlet
C. The thread that call wait() goes into the monitor's pool of wiating threads ... There is one daemon thread whose job is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found