Posts by DecSoft

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

DecSoft (In thread: Push notifications)

Hello Paolo,

Humm... it's quite rare... I try the sample app right now and works as expected, then maybe something is missing in your own implementation... I suggest you to try the sample app, because you must see that app working as expected, like I do. After you see the sample app working as expected, we can recognize that something is missing in your own implementation.

Maybe the push notification payload? Take a look also at the server's scripts of the sample app, Paolo, since I modify the push notification payload too.


DecSoft (In thread: Push notifications)

Hello to all,

PS: to make you understand that my level is not very low (with PHP) have already managed to manage notifications on the database, and create a form to send individual users. The next step is to study a little How it works the topic, expander notification, And above all interact with actions.

Sounds very good!

I want to clarify that each of your in-depth posts is really useful for me because I study it with a lot of attention, Before asking anything I try to do as many tests as possible.Really Thanks for everything

No problem, Paolo! Always thank you for your trust!


DecSoft (In thread: Push notifications)

Hello to all,

Yesterday, as I post above, I prepare a new release of AB enhacing the "CordovaPushNotifications" sample app in order to use a personalized icon for the push notifications. I did not try the sample, because, I use exactly the same Cordova Extra XML configuration that I am using here in some of my own apps. This morning I will to try the sample app, and, to my surprise, the icon in the push notifications is not the expected one... but the default one: the app's icon itself.

Apparently my mistake was that I am using the same push icon than the app icon in my own apps, so, I can't see the problem until I try to use a completely different icon for the push notifications. Today I review the push plugin documentation and found that maybe the problem is that we must indicate more than one location for the push icon to be used. I am not sure about this, however, the point is that I can't see the icon working, so, I prepare a new Cordova Extra XML configuration option like below:

Doing that, now yes, the "icon => pushicon" reference is working as expected. So I modify the "CordovaPushNotifications" sample app, in order to use the above configuration, and, prepare the payload (server side scripts samples) to use not only the "icon" key, but also the "image" key, just to see if that works as expected, and certainly it's working now as expected: both the prepared push icon and the image is what we can see in the push notification message.

I did not publish a new release of AB, but, I update the installers right now, so, please, download the current release (if you download it yesterday, you can't see a new release using the product's updater tool), in order to get ready with these modifications into the "CordovaPushNotifications" sample app. Now you can see how the "pushicon" works as expected, in addition to the "image" (also customized) that we use for the push notifications.


DecSoft (In thread: Push notifications)

Hello to all,

Yes; you are right, Amin: the most part is done in the server side. The app has something to say, of course, for example, when receive the push notification. The payload can tell us where to redirect the user, to one view or to another, or finally, what to do with a particular notification. In the particular case of the "icon" both client (the app) and server side is required: the app stores the icon and provide the right XML stuff in the Cordova Extra XML option to copy the icon in the expected place. Then the server refers to that icon in the push notification payload.

But you are right, the push notifications are mostly handled in the server side, and can be more or less complex, depending on our needs. In our app cases, for example, we store in the app's server database the push IDs, but also the users platform (that we take from the app using the Cordova Device plugin). Additinally we also saves the notifications itself in the database, becuase our apps offers a kind of "history of notifications", so we can show it to the users. Almost all of these stuff is optional, anyway, and, again, depend on the app that we are developing.

Thanks for sharing your code with us, Amin!


DecSoft (In thread: Push notifications)

Hello Paolo,

I was hoping and I was convinced that I have solved but not yet, now as per your procedure inside "\ android \ res \ drawable" I have the "pushicon" file and on the php code '' icon '=>' pushicon '"but still can't see each other! what's missing? thank you very much for your availability !! Answer when you have time, think about Christmas! :) smack!

I think we are crossing our messages. :-) Please, take a look at my very last post.


DecSoft (In thread: Push notifications)

Hello Paolo,

Please, upgrade your copy of DecSoft App Builder: I publish a new release enhancing the "CordovaPushNotifications" sample app in order to use a "icon" key in the Android payload. Basically take a look at the app's Files manager: you can see an icon included under the "Images" tab. Then take a look also at the app's Cordova Extra XML configuration option, and, finally, look at the server's PHP script "sendpush.php", in which we "define" the "icon" to be used.


DecSoft (In thread: New App Builder 2021.21)

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: Push notifications)

Hello Paolo,

Yes; it's my mistake! After publish my post I find the mistake and then publish this other post trying to explain the "icon" key. Please, read it and don't hesitate to post here if you have any further questions!


DecSoft (In thread: Push notifications)

Hello to all,

After publish my previous post I find something in the code that can confuse you, Paolo. I will try to explain it here. As you can see, in the Android payload of the push notification, we use a couple of keys "icon" and "image". Well, the "image" key is the path of an app's file, and, appear in the push notification (but I can't tell you exactly in what place).

But the "icon" key is different... we see in the code that we use the "pushicon" string. So where is this "pushicon"? Ok. This push icon is also an app's image file, but, must be established using the app's Cordova Extra XML option, exactly like you see below:

Above you can see two things: the first one is something that may you no need, but, that can be useful: it's an instructions to Apache Cordova to copy our app's "google-services.json" (used for push notifications) in the right app's path, so we no need to do manually.

The below instructions is what is related with the icon. What we do is to copy an image file which is added by the app into the right folder to be used when the app is compiled with Apache Cordova. This all is documented in the push notification plugin here.

So for the "icon" key of the payload for Android we are indicating the name of an image file: and this image file is an image file that we add in the app using the app's files manager. Then we use the Cordova Extra XML configuration option to copy this file into the right place, following the push plugin documentation. For that reason the "icon" file is not a path (like I suggest in my previous post), but the name (without extension) of a PNG file, which must be found in the "res/drawable" directory of the app.

I hope you can get it working, Paolo, however, remember that you can post here or in a new thread if you have any further questions.


DecSoft (In thread: Push notifications)

Hello to all,

I think the meta tag is not required at all, at least, I don't use it here in the apps that I develop, who receives push notifications. If you problem is only the icon, I think you must provide an absolute URL for that icon, or, maybe an app's local image path for that icon: that also works.

Below you can see the PHP code (a bit commented) that we use in various apps to send push notifications. The intention of the code is that you can get the whole idea and some useful notes, Paolo: the code is not to be used "as is", but I hope you can get the whole idea. Maybe can be good to copy the below code and paste it in your favorite PHP IDE, so you get the advantage of the syntax highlighting.

If you have any further questions, don't hesitate to post it here in this thread, or just open a new thread without problems. Merry Christmas and Happy New Year to you and for everybody! :-)


DecSoft (In thread: Evento OnDeviceReady)

Hola Juan,

Acabo de enviarle un correo con ambas cosas: si en un tiempo prudencial no lo recibe... hágamelo saber por aquí y/o contacte conmigo por correo y se lo haré llegar de nuevo: no olvide revisar su carpeta SPAM en el cliente de correo: es posible que haya acabado ahí... :-/


DecSoft (In thread: Evento OnDeviceReady)

Hola Juan,

La actual versión de la anterior generación de DecSoft App Builder es la 2019.63: voy a escribirle un correo enseguida con un enlace para su descarga, puesto que ya no está disponible públicamente. Respecto de cómo acceder al evento "DeviceReady", en el diseñador de su app, haga doble clic fuera de la vista, es decir, ya sabe que si hace doble clic en el diseñador, dentro de una vista de la app, accederá a los eventos de dicha vista, pues bien, haga doble clic fuera de la vista (por defecto, la vista aparece de color blanco), pero en el mismo diseñador, de modo que accederá a los eventos de la propia app. Si no puede hacerlo hágamelo saber aquí, Juan, y, trataré de ayudarle de otra forma: de hecho voy a mandarle un pequeño vídeo por correo para mostrárselo también mediante ese medio.

P.D. He dicho que voy a mandarle un correo con el enlace para descargar la última versión de la anterior generación de DecSoft App Builder, no obstante, puede también descargarla desde su área de cliente en este sitio web, desde la pestaña "Releases", dentro de la carpeta "App Builder", encontrará una subcarpeta de nombre "Current release", que, enlaza con dicha última versión.

P.D. Si estamos hablando de un nuevo proyecto, y, aunque el anterior DecSoft App Builder sigue soportándose, permítame recomendarle la actual generación de DecSoft App Builder, que, puede descargar desde aquí (puede instalarla sin problemas aunque tenga instalado la anterior generación).


DecSoft (In thread: Evento OnDeviceReady)

Hola Juan,

Como en este caso estamos hablando de la anterior generación de DecSoft App Builder, puede utilizar el evento "DeviceReady" de la app, y, dentro del mismo, usar las acciones "StartJS" y "EndJS": entre medias de estas acciones puede insertar el código Javascript que necesite.

Si hablásemos de la nueva generación (o sea, la actualmente disponible) de DecSoft App Builder, no tendríamos necesidad de usar las acciones mencionadas, pues, todo el código es Javascript, directamente. El evento "DeviceReady" existe en ambas generaciones del producto.


DecSoft (In thread: Login from iframe)

Hello Paolo,

No problem! I am sure that, with time and work, you can get something useful and working as expected.


DecSoft (In thread: Login from iframe)

Hello Paolo,

Talking about IFrames and Android and iOS apps, I want to say something that may can be useful to you, because you must take it into your consideration. Commonly we must take care when deal with possible links inside our apps. This means that we must control all the links that we can place inside HTML controls, for example, handle it and don't leave the link to be opened "in a normal way". What we must to do, basically, is to handle the link and open it in a new window: it's possible to open it in the system's browser or in the browser provide to us by the Cordova "InAppBrowser" plugin.

Maybe it's not your case, however, we must handle the links because, if we don't handle it, they are opened inside our app's Webview, and, this can cause some problems. Not in all apps this problem appears, but, can appears in some specific apps. For example, supose we maintain an user session inside the app: if we allow the links to be opened in the app's Webview, when the user come back to the Webview, we can loss the app's variables, and, therefore, the user session (saved in that app's variables) is also loss. The solution is always the same: use the Cordova "InAppBrowser" plugin to handle the possible links and never allow the link to be opened in the app's Webview.

I want to mention this "link issues", which is not only related with AB, but, with any Apache Cordova app, because the IFrame usage can put us in a trouble if we need to handle the links... basically we can't do it... because the links which are inside the IFrame cannot be controlled outside the IFrame. So this means we cannot use an IFrame control in our apps? Not at all. We can use IFrames and sometimes they are quite useful, but, the content of the Iframe must be more or less know, and, for example, the links inside the IFrame cannot use a "target=blank" in the links, ni other words, all the links inside an IFrame must be opened in the same IFrame.

Again, maybe this is not a problem in your specific app: maybe the app don't rely in variables, so, maybe we can loss the control with a link who are opened in the app's Webview, and then, we can get back to the app without problems. However, I think that I must refer this possible problem in case you plan to use links to with "target=blank" in your IFrame's content. Because a "target=blank" means "open the link in a new window", and, this new window (for the IFrame) is the app's Webview itself. If your website, then, don't open links in new windows, there is no problem, because your website's links will be opened inside the IFrame, so you don't loss the control at all.

Please, post here if you have any questions or doubt about what I am trying to explain here around the possible link issues inside IFrames. I am not sure about what you are trying to do, so, I don't know if you need to use an IFrame (for example, you no need it if you want to post some information in your website's database, you can use an HTTP control to post it, or just use an XMLHttpRequest to do it). But, if you really want to use an IFrame, then you must take note about the links inside the IFrame's content: the links can be only opened inside the same IFrame / window, and, never have links with "target=blank", since the links will be opened in the app's Webview and this can cause some unexpected (in fact expected, but, anyway a non desired) behaviour.

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.