Nilom's Recent Forum Activity

  • Hey. I got the debug mode working on my phone now.

    This is the error that I get:

  • Awesome! With your help I was able to think again, read through the documentation again and find a mistake that I did before my holidays. After the holidays I forgot about my changes.

    I chose another database for custom data back then. Because I wanted to have account data and custom data on separate databases for security reasons. Now that I changed it to the default path I was able to read a users custom data with:

    const customData = app.currentUser.customData
    console.log(customData);
    

    And generally read documents:

    const mongodb = app.currentUser.mongoClient("mongodb-atlas");
    const PrivateUserData = mongodb.db("ClientDB").collection("PrivateUserData");
    const myID = app.currentUser.id
    const myData = await PrivateUserData.findOne({ id: myID });
    console.log("My Data: ", myData);

    And to update a document:

    const result = await PrivateUserData.updateOne(
     { id: myID },
     { $set: { dong: "Very schlong" } }
    );
    console.log(result);

    And to update custom user data should be:

    const mongodba = app.services.mongodb("mongodb-atlas");
    const collection = mongodba.db("ServerDB").collection("UserAccounts");
    await collection.updateOne(
     { userID: app.currentUser.id },
     { $set: { dong: "12cm" } }
    );
    

    But I didn't test the last one yet.

  • Hey there!

    Currently I don't know yet if it will have any negative side effects.

    But from my understanding it should have no downsides. But I'm not sure.

    In a couple of days I should be able to test this. I will post an update then.

  • Hey. Thanks for the reply.

    My project only has one layout and starting it in preview will work just fine. I even put a speech synthesis on start of layout saying "Start of layout" just for testing, so that I can hear if something happens. And it will not say a thing.

  • Hey there!

    I wanted to test my project as a Cordova apk. It works fine in remote preview on mobile.

    When I install it on my phone and open the app the screen will be just blank white.

    Debug apk's should just work like normal apk's with the addition of usb debug output, right? So I still should see everything like normally?

    I haven't setup the usb debugging part on my phone yet because I can't get it aktivated for some reason.

    I chose Lollipop 5.1+.

  • Thank you for pointing that out.

    I tried it again and it still doesn't show the data, although the data is only stale for about 30 minutes and now many hours passed since I updated it manually.

    Thats how it currently looks like:

    And this is what I get in the console:

    Note that the most errors come from the official facebook plugin. I still don't know why because facebook login works just fine.

    Signing in to Realm works too. One line above the blue marked area it says signed in and it also shows the Realm user id. And when a new user signes into facebook a new user account will be created in the Mongodb database through Realm.

  • Hi thanks again for your replies!

    I enabled custom user data before. And for how I set it I manually set the data into the database using Mongodb Atlas.

    I wanted to try the easier way first. But you are right. I can try setting custom user data and see what will happen.

  • Hello and thanks for the reply!

    For now I just manually inserted data into the custom_data object inside the UserAccounts database.

    And now I'm trying to read it. When I have this done the next step would be setting a new value or modify existing data.

  • Yes I did that. What is strange is following behavior:

    When I start the remote preview it opens in the android chrome browser and is without bars but not fullscreen.

    When I enable fullscreen I have two bars (red) left and right and no browser bar on the top.

    When I then press back to "close" the fullscreen mode the borders on the sites will disappear but it will still be kinda fullscreen. But the status bar will be visible on the top.

    Edit:

    Holy moly. Sorry for that gigantic pictures. Took them from my phone.

  • eleanorjmorel Thanks I will look into this!

    Ashley Yes, but this persists even in fullscreen mode where is no bar.

    fredriksthlm Thanks for the explanation. Now I changed the layout size to 10000 x 19200 and the viewport size to 4320 x 9360. On start of layout I scroll to LayoutWidth/2, LayoutHeight/2.

    But the bars on the side have still the exact same size as before. Am I stupid or something?

  • Good evening!

    I'm testing my app on my phone.

    It is a Huawai P30 Pro which has a screen resolution of 1080 x 2340 , which is a 19.5:9 aspect ratio.

    If I put this exact resolution into the Construct 3 editor as a viewport size it tells me that it is an aspect ratio of 6:13.

    When I then enter fullscreen mode in the remote preview in chrome I get two lines about 25 pixels width on the left and right of the screen. Why is that?

    I tried scale inner, scale outer. I tried a wider viewport, a thinner viewport. A different aspect ratio. A greater layout width, a smaller layout width. I tried having the viewport width wider than the layout widht, thinner than the layout width. And I tried many many things more.

    No matter what I do it will have bars somewhere! And no I do not want letterbox scale as that will always get me ugly bars which are unacceptable in mobile apps.

    This is making me mad as it should generally be so simple.

    It would be soooo useful to have an example on this in the Beginner or Intermediate Examples section inside the editor. And yes I already read this many times and, although it is useful for having a general understanding, it lacks of examples.

    Just a small project containing some text which supports multiple screen sizes without being cut and without bars, that would be so valuable and I'm sure I'm not the only one out there.

    What am I doing wrong? Any advices?

    Thank you dear reader!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello there!

    I am having trouble setting the base to access the Mongodb database with the Construct 3 Client App via the Mongodb Realm Web SDK.

    What I have so far:

    But when I then try to execute

    const customData = app.currentUser.customData
    console.log(JSON.stringify(customData, null, 4));
    

    I will just see {} in the console and not the users customData.

    When I have the basis I'm able to edit and adabt it to my needs. But completely figuring this out on my own troubles me since weeks now. The documentation on Mongodb, although being detailed, is very confusing and the examples they list are very lackluster and scattered across 4 different documentation sites.

    Please, may someone with better coding capabilities be so generous and provide me with an example on how to read, write and edit/update database data from within a Construct 3 clients app?

    I'm looking forward to your replies. <3

Nilom's avatar

Nilom

Member since 26 Dec, 2019

Twitter
Nilom has 1 followers

Trophy Case

  • 4-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

9/44
How to earn trophies