1 / 31
Sep 2021

Using latest version 21.1
Apache server
PHP 7.4
mariadb
archive installation

Hi, I’m having an issue on mobile with custom application. The first time I logged in and selected the custom app it worked perfectly on mobile. When logged in the second time because now it is selected as the default application and loaded in the cache, the application wouldn’t load and it just freezes

Hi Vishakha.

Can you find anything in the web server (error) log?

I have moved this to the Developer category…

Stefan

There’s nothing we can do with the amount of information you gave :frowning:

Googling for Promise rejection NotAllowed Error gives some pointers, you could check with your applications code: https://www.google.com/search?q=promise+rejections+NotAllowedError&oq=promise+rejections+NotAllowedError&aqs=chrome..69i57.9583j0j7&sourceid=chrome&ie=UTF-82

Browsers reject a lot of things:

  • mixed content (http sources in a top-level https page)
  • our Content Security Policy allows only certain JS actions and resources on the page
  • cross-origin requests

I can only speculate without knowing what your application does and its code.

Ralf

Is there anything special that needs to be done for setting default application on mobile in the code ?

$GLOBALS['egw_info']['flags'] = array(
		'currentapp'              => 'myapp',
		'noheader'                => True,
		'nonavbar'                => True,
		'enable_nextmatchs_class' => True
	);
include('../header.inc.php');

Api\Egw::redirect_link('/index.php','menuaction=myapp.uimyapp.index');

This is my index.php of custom app, if it helps.

That will open in an iframe, as there is no ajax=true parameter, maybe that’s the difference, if you have an index in the applications table with ajax=true.

Ralf

	$setup_info['myapp']['name']      = 'myapp';
	$setup_info['myapp']['title']     = 'myapp';
	$setup_info['myapp']['version']   = '0';
	$setup_info['myapp']['app_order'] = 8;
	$setup_info['myapp']['enable']    = 1;
    $setup_info['myapp']['index']    = 'myapp.uimyapp.index';

	/* some info's for about.php and apps.phpgroupware.org */
	$setup_info['myapp']['author']    = '';
	$setup_info['myapp']['license']   = 'GPL';
	$setup_info['myapp']['description'] = 'myapp Module.';
	$setup_info['myapp']['maintainer'] = array('name' => '', 'email' => '');

	/* The hooks this app includes, needed for hooks registration */
	$setup_info['myapp']['hooks'] = array(
		
	);

This is the setup.inc file. Should I add ajax=true in the index parameter here and also in the index.php file ?

That depends on you using eTemplate2 and your app does not mess up the other apps running.

Does the problem only happen with a mobile device, or also with a regular browser (which my show better logging)?

Ralf

No we are not using Etemplate. This problem is only on mobile device, on the browser the applications loads by default properly without any error every time we login.

Is that a container installation, or how did you make it?

I’m asking because I fear the status app is missing, which is kinda impossible for a container installation.

Ralf

Nope that function is in fw_desktop.js:

But the fw_mobile.js does not have that method:

That’s probably the problem. Not sure why it only stalls your app, and not any of ours …

@hadi.nategh Should that method (execPushBroadcastAppStatus) be moved from fw_desktop to fw_base, so it’s also available in fw_mobile?

@vishakha: you can try to define it in your pixelegg/js/fw_mobile.js sources to see if you app then starts working.

Ralf