Nilom's Forum Posts

  • 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!

  • 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

  • I think this will not happen if you use sub events for the following code blocks. At least I vaguely remember that I had this similar problem. But I'm not sure.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello past me.

    I don't know how but I got an enlightenment and figured it out by myself.

    You just need the Facebook access token which you get using Construct 3's built in FB plugin + you need Web Facebook or something similar to get the access token (Why don't we have this important feature built in?)

    Just set the global variable access_token to WebFacebook.GetAccessToken inside the facebook on logged in condition.

    Then add script and paste the following code (You must have the Realm Web SDK loaded):

    const id = "your-realm-app-id";
    const config = {
     id,
    };
    const app = new Realm.App(config);
    
    
    const credentials = Realm.Credentials.facebook(runtime.globalVars.access_token);
    
    app.logIn(credentials).then(user => {
     
     console.log(`[Realm] Logged in with id: ${user.id}`);
     
    })

    It must look like this:

    And this:

  • Hey there!

    With the help of DiegoM I was able to install Mongodb's Web SDK into my project.

    But now a new problem has arisen. My plan is to build a mobile app, exporting to Cordova. But then obviously redirection from the Realms Web SDK built in OAuth2 Facebook Login will not work anymore. Also I'm not sure if the built in functions of the Web SDK will work inside Cordova. They might though, as Cordova is just a browser app, if I'm not wrong.

    My problem now is to let the user sign in to Mongodb Realm using the SDKs built in Facebook OAuth2 without redirection.

    (The next problem will be using API calls or the built in SDK to retreive and post Database information as the Realm documentation, although pretty detailed, lacks very much of detailed code examples. There are just confusing variations of incomplete code snippets for the same thing scattered across multiple sites. But that will be the next step and maybe part of a future question when I get the sign in with Cordova working. :D)

    Any ideas?

  • DiegoM

    Wow this is super awesome! You even made an example for me. <3

    I'm really looking forward to returning home later so that I can test it.

    Edit:

    Thank you again so much for your help and efforts. It works perfectly that way! Now I just have to figure out how I can handle the redirection-url-thing.

    My first guess would be to check the apps url on start of the layout. If it contains the redirect information, then handle Realm.handleAuthRedirect(); and if not do the login stuff to get logged in and redirected.

    About the installing SDK part: Even though it is relatively advanced and pretty nieche I think it might be worth to include this to the example projects as it is very powerful to be able to install SDKs. :)

  • Any ideas?

  • Hello.

    I want to install the Mongodb Realm Web SDK into my client so that I can use its authentication and other features.

    How can I do this? I was following this documentation but I just don't know how to do this in Construct 3 (or in general, lol).

    Thanks in advance!