Posts by DecSoft

Show threads by DecSoft
3341 posts found, page 22 of 223

DecSoft (In thread: New HTML Compiler 2021.49)

Hello to all,

Here is a new DecSoft HTML Compiler with the below changes, fixes and enhancements:

Read the entire product's history


DecSoft (In thread: New App Builder 2021.65)

Hello to all,

Here is a new DecSoft App Builder with the below changes, fixes and enhancements:

Read the entire product's history


DecSoft (In thread: Add stuff to HTML head)

Hello Tinn,

At designtime, we can use the Metatags app's option, since the metatags are placed in the HTML head. At runtime it's also possible, using a code similar than the below, for example, at the app's Mounted event, or maybe the app's DomReady event.


DecSoft (In thread: Apache Cordova version)

Hello Tinn,

This can be useful to you: in the Cordova version option of the Android platform and the Cordova version option of the iOS platform, as you already know, we can specify the number of the version of Cordova Android and Cordova iOS that we want to use, but, it's also possible to set that options with the word "latest" (without quotes), and, this apparently works as expected, I mean, with this we are "forcing" to use the latest available versions of Cordova Android and Cordova iOS. This can be useful if we always want to use the latest versions, without update these options with the latest available version numbers. In fact this the "latest" option is well documented in Apache Cordova, but I simply forget to comment it here in this post.


DecSoft (In thread: New App Builder 2021.64)

Hello to all,

Here is a new DecSoft App Builder with the below changes, fixes and enhancements:

Read the entire product's history


DecSoft (In thread: New HTML Compiler 2021.48)

Hello to all,

Here is a new DecSoft HTML Compiler with the below changes, fixes and enhancements:

Read the entire product's history


DecSoft (In thread: Around the view.name variable)

Hello Mario,

If you finally can handle it, I am happy for that. :-)


DecSoft (In thread: Around the view.name variable)

Hello Mario,

I continue thinking about your problem, and, I want to suggest you something to do, in order to see if everything is working as expected. First of all, if I am not wrong, you use the "DeviceReady" event, because you need to wait until the Cordova stuff (including the plugin you are using) are ready.

Again, if I am not wrong, the plugin that you use will open the app specifiying an app's view in particular, for that reason you want to know what app's view has been "loaded" on the "DeviceReady" event. My theory is that, for some reason, the plugin is always open the app from the main view.

I assume that the "view.name" variable is correct, so, if you are in the main view, the variable will show to you the main view name. In order to try all of these, I suggest to you to use the below code in the "DeviceReady" event:

With the above code you must see (in the alert) the below if you are in the main view of the app:

If you are in another view, the above alert will show you something like the below:

The idea is to check if certainly the plugin is loading the appropriate view, or, if as I think, the plugin is always loading the main view of the app. If I am not wrong, if the plugin is loading the "view2" correctly, then inside the "DeviceReady" you will see the expected value in "view.name", but also in "document.location.href".

So please, go ahead with this test and post here what you can see.

P.S. Maybe the plugin can launch / open your app while the app has been paused before: in this case the event that you must use is the "Resume" event, not the "DeviceReady", since this last one is only fired one time, when your app starts from scratch.


DecSoft (In thread: Around the view.name variable)

Hello Mario,

I want to comment here something more about the "DeviceReady", because it's something that get me a bit confused. You say that you use the "DeviceReady" event, but, as I comment in my previous post in this thread, that event is only firef one time, when the app starts. But, if the app starts... certainly we are in the main view... and this is what you describes: I get always the main view name in "view.name"... but this did not mean the "view.name" variable is not set! What this means is exactly that the "view.name" variable stores... well.. the main view name... because you are certainly in the main view!

So here is something that I can't understand perfectly well... there is something that I am missing... because I can't understand it... Again, and tro try to explain it as well as possible: you mention that you always get the "main view name" in the "view.name" variable... but you refer also that you are dealing with that variable in the "DeviceReady" event... but since that event is fired when the app is started... what you get is the expected view name... because it's the main view...

Can you understand what I am trying to explain? I hope so! Because there is something that we are missunderstanding... maybe we need to use another event... or something like that... because what you are getting: "Always the main view name" is what we can expect to get if we are using the "DeviceReady" event...

On the other hand, the Cordova plugin that you are using is a bit hard to implement... I mean... it's the first time I know about it... and apparently requires some configuration in the server side... so I want to ask you if you can prepare for me a sample app who uses that plugin... with the right configuration in certain server (or leave the configuration ready to place from my own here at decsoftutils.com)... so I can try to take a look at that sample app... It's possible to made that sample app for me, Mario?

But please, consider all what I am trying to explain here in this post... about the "DeviceReady" event... the expected result if we use in that event the "view.name" variable, etc. Maybe what you need is to use another event or something like that... I can't be sure at this moment. On the other hand... may you can also consider to use something like "document.location.href"... since with that maybe you can know also (in your case) what view is show in the app at that moment.


DecSoft (In thread: Around the view.name variable)

Hello Mario,

On the other hand... and this may can help or give us some clue... if I am not wrong, the "DeviceReady" is only executed one time, when the app starts, and the Apache Cordova stuff is ready to be used (this include the Cordova plugins too). But... if the app get paused... and then resumed... probably the "DeviceReady" is not executed again... we have the "Pause" and "Resume" events to be ready in that scenario.

So I am not completely sure about... what I can say is that the "DeviceReady" is only executed one time... when the app is launched for the first time... or if we close the app and then start it again from the scratch... but not if we put the app in pause... then, when the app become resumed, the event which is fired is the "Resume" event, not the "DeviceReady". Maybe this can help you in some way.


DecSoft (In thread: Around the view.name variable)

Hello Mario,

It's quite rare... and maybe specifically related with the plugin that you are using... I mean... I try with a sample app which show (in an alert) the "view.name" variable at the "DeviceReady" event... and certainly works as expected...

Of course, when I launch this app... the view which is loaded is the main one, so for that reason I can get "view1" inside "view.name"... but this is the expected... because certainly the main view is "view1"... and that's the view which is loaded when the app starts.

So maybe all of these is related with the plugin that you are using... so please... let me to figure out how that plugin works... in order to make some tests from my own...


DecSoft (In thread: Around the view.name variable)

Hello Mario,

A couple of things to comment here. First of all, I can see some weird (unexpected) behaviour with the "DomReady" event, but only in Firefox... if we try to access the "view.name" variable from the "DomReady", we can't... but again, only in Firefox... which give me in a bad position, because I am not quite sure how to achieve a possible fix.

But you tell me that you are using the "DeviceReady" event... so we are not talking about the "DomReady" event... however... maybe what I want to suggest you can work. What I suggest to you is to use a "setTimeout", that is, use a code similar than the below one:

Note that I place an "alert"... but only means that we use the view.name variable... so in one word... try the "setTimeout" when you access to "view.name", Mario, and please, tell me if that works or not.


DecSoft (In thread: Around the view.name variable)

Hello Mario,

I never use such plugin, but I will try to help you. Can I ask where you are trying to use "view.name"? In what event?


DecSoft (In thread: Apache Cordova version)

Hello Tinn,

Yes; that's the version which I use in my apps too, and, probably the recommended one if we are talking about new apps.


DecSoft (In thread: Apache Cordova version)

Hello Tinn,

Certainly, a couple of releases ago I remove the whitelist plugin, which is no more required with the latest versions of Apache Cordova. If I am not wrong... I mention in the program's history file that that plugin is required if we are using a previous version of Apache Cordova. Since I am always use the latest version of Apache Cordova I take that way... but it's good to know that certainly we may need to add the whitelist plugin if we still in a previous version of Apache Cordova.

Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.