I'm trying to log screen names in my app but I have like 95% not set in Firebase Analytics.
In onAppear for a view I do Analytics.setScreenName("screenName", screenClass: "screenName")
Should I do this differently? It seems that Analytics for iOS works in conjunction with UIViewControllers but since this a SwiftUI app and there is no documentation on how to work with that.
Update
This is now possible using the analyticsScreen view modifier. See the source code
We are working on a better solution for this. As you mentioned, the way the view controller hierarchy of a SwiftUI app is made up, this is not entirely trivial to solve, but we've got a couple of ideas.
In the meantime, you might want to try this workaround that some people have suggested on the Github issue:
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
Analytics.setScreenName("todo_tab", screenClass: String(describing: type(of: self)))
}
Related
I was trying to get Realtime Database on Firebase, but it doesn't show me a 'NEXT' button when I'm trying to get the database location.
I was following online tutorials which are supposed to look like this:
and I have no idea why it happens like this to mine only
Most likely the problem for not displaying the "Next" button is related to your browser. The simplest solution to solving this kind of issue is to try to use the Firebase Console on another browser.
I am trying to set Screen Tracking in my App.
As far as I understand, It requires each different window to track user's activity.
Here is my question.
Can I set different Screen Tracking code in Pop-up window(Example: Store Pop-up)? Or do I need to make a whole- different window to track user's activity properly?
Thank you.
You can manually track screens by calling Analytics.setScreenName(screenName, screenClass: screenClass).
For more on this see the Firebase documentation on tracking screenviews. You can also find examples in other languages there.
I've searched all the internet, but found no similar resolved issues.
So, I'm playing around with Cloud Firestore and my issue is simply that I can't add anything to Firestore from console, I click on "Add collection", enter name, then generate random id for new document, and add a single string to it. After clicking "Save", nothing is added and screen still says "No data at this location yet". I tried reloading, logging off and in again, adding only empty collection, etc. Anyone knows what could be wrong? Maybe that's some bug because Firestore is in beta?
I was facing the similar issue, after a lot of research, I found out that there is an issue with chrome browser. Just open the same console with firefox browser, you will be able to do all the operations :)
I had the same issue. Try to go to the collection that you have created directly via parent path.
EDIT:
Sorry, I was wrong. Problem still occurs. Found out antivirus blocks these operations. I'm using kaspersky
Similar problem here. It works after I enable data collection on Kaspersky.
If there is no document in the collection, the collection disappears. The process is fairly fail-proof. You can enter 1 as the document name and 1 as the string field leaving the value blank and it will still write.
Try adding a different data type. Also, try and use one of the SDKs, the web (browser) or admin (Node.js) SDK to write (.set) data in a document firebase.firestore().collection("test").doc().set({"name":"john"}); with the test/open security rules in place.
NOTE:
Firebase does not accept undefined values by default.
Check your values: Having undefined values could well be the reason.
Following Xavi's advice, I found out that it worked on Safari, I then went back to the Chrome Firebase console and logged out of all accounts and re-logged in with the account I have Firebase access to, and I am now able to read and write from the console and also from my React app.
I'm trying to make a google form look like my own site. I found examples of how to do this on How to style Google Forms and google-custom-form (GitHub project), but I tried both of the examples they give and they seem to fail now.
I had a look at Class Form - Google Apps Script which seems to be like an API, but I can't get my head around the documentation. Does anyone have an example of it working. Or has found another way of getting this to work? It would be really handy to do as embedded forms look really out of sync with the rest of the site.
The API you're linking to is an apps script API. This is needed if you want to create dynamic forms (dynamic amount of questions, dynamic answers,...) but not for custom styling. An intro to appscript can be found on this page: https://developers.google.com/apps-script/
You could just create a form manually on https://www.google.com/forms/about/
You can change the styling and colors in the top-right of the page. When you are ready to embed the form on your own page you have to press "SEND", an select the embed icon <> at the top.
I've worked with this a ton, and still have issues with it. Been learning the new api v4 for sheets but still having trouble, it is still in beta too. For now I can recommend this solution though by heaversm on github.
https://github.com/heaversm/google-custom-form
The example fully works as long as you find the entry.xxxxxxx for each field and replace in the appropriate js. To avoid the embed issues, give your form submit on a click function that has the event as the input and then preventDefault on the event like so:
$('#submit-button').on('click', function(event){
event.preventDefault();
// continue code from heaversm
});
Hope this works for you. Cheers
I read the documentation on https://www.firebase.com/docs/ios/guide/login/twitter.html. I downloaded and added the two files as it says in the documentation. I also imported Accounts at the beginning of the files, so Xcode builds successfully. Then I copied the exact code in the documentation to my twitterLogin IBAction, and set my Twitter API Key and Firebase base reference.
The problem is that when I click on my twitter login button, nothing happens. (It used to say no twitter accounts, then I set my account in the Settings.) I even put print statements in any if-else case but none of them prints. So is there any suggestions for making Twitter login work? I don't think Firebase is missing anything. But please give some suggestions on how to figure out the issue at least.
Check to make sure that you have Enabled Twitter Authentication in your Firebase Dashboard, and that the apiKey in your project matches the one that is in your Dashboard.
Hope that helps :)
I solved the issue. The 'funny' solution was to add an equal sign to the condition
if accounts.count > 1
For anyone who is not lucky enough to notice that the sample code in the Firebase documentation is weirdly working only for users that have 'more' than 1 twitter account signed in the device, I believe this answer would help to save some time.
I also think that this sample code is misleading.(may be something that shouldn't be the default case in the sample code)
I have recently found some pretty good stuff on exactly this topic may it can help someone:
https://medium.com/reversebits/twitter-authentication-in-firebase-for-android-51d1460dc6a9#.strjpm90r