hph
uniGUI Subscriber-
Posts
60 -
Joined
-
Last visited
-
Days Won
3
hph last won the day on March 6 2019
hph had the most liked content!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
hph's Achievements
Member (2/4)
6
Reputation
-
Hi Dominique I don't think you can develop a PWA app with UniGUI. But maybe this will help you a bit, subject: fullscreen and icon on homescreen for ios: https://www.netguru.com/codestories/few-tips-that-will-make-your-pwa-on-ios-feel-like-native https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html You can add the meta tags to UniServerModule.CustomMeta(), like this (works with ios): <!-- icons --> <link rel="apple-touch-icon" href="touch-icon-iphone.png"> <link rel="apple-touch-icon" sizes="20x20" href="files/images/ios/AppIcon.1.0/Icon-20x20@1x.png"> <link rel="apple-touch-icon" sizes="40x40" href="files/images/ios/AppIcon.1.0/Icon-20x20@2x.png"> <link rel="apple-touch-icon" sizes="60x60" href="files/images/ios/AppIcon.1.0/Icon-20x20@3x.png"> <link rel="apple-touch-icon" sizes="29x29" href="files/images/ios/AppIcon.1.0/Icon-29x29@1x.png"> <link rel="apple-touch-icon" sizes="58x58" href="files/images/ios/AppIcon.1.0/Icon-29x29@2x.png"> <link rel="apple-touch-icon" sizes="87x87" href="files/images/ios/AppIcon.1.0/Icon-29x29@3x.png"> <link rel="apple-touch-icon" sizes="80x80" href="files/images/ios/AppIcon.1.0/Icon-40x40@2x.png"> <link rel="apple-touch-icon" sizes="120x120" href="files/images/ios/AppIcon.1.0/Icon-40x40@3x.png"> <link rel="apple-touch-icon" sizes="120x120" href="files/images/ios/AppIcon.1.0/Icon-60x60@2x.png"> <link rel="apple-touch-icon" sizes="180x180" href="files/images/ios/AppIcon.1.0/Icon-60x60@3x.png"> <link rel="apple-touch-icon" sizes="76x76" href="files/images/ios/AppIcon.1.0/Icon-76x76@1x.png"> <link rel="apple-touch-icon" sizes="152x152" href="files/images/ios/AppIcon.1.0/Icon-76x76@2x.png"> <link rel="apple-touch-icon" sizes="334x334" href="files/images/ios/AppIcon.1.0/Icon-83.5@2x.png"> <!-- fullscreen webapp --> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-title" content="myApp"> After call your webapp in safari via url and link it to your homescreen. You can then open your app via this icon and you will have a fullscreen webapp ;-) Hanspeter
-
Hi Meaby this will help you: if Unisession.Language = 'de' then ...
-
very nice work! thank you so much Gerhard!
-
procedure TUniServerModule.UniGUIServerModuleHTTPCommand( ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean); var sid: TUniGUISession; ActiveSessions : TUniGUISessions; I : Integer; begin if ARequestInfo.URI='/test/send' then begin SessionManager.Sessions.Lock; ActiveSessions := UniServerModule.SessionManager.Sessions; try for I := 0 to ActiveSessions.SessionList.Count -1 do begin sid := ActiveSessions.SessionList[I]; sid.AddJS('doShowText("Hello")'); // --- dont execute!?! end; finally SessionManager.Sessions.Unlock; end; AResponseInfo.ResponseNo := 200; AResponseInfo.ContentText := 'success'; AResponseInfo.WriteContent; Handled := True; end; end; Hi Why is this javascript function doShowText() in this active session not executing? It works if I call directly from UnimForm.UniSession.AddJS(), but not over the SessionManager...? best regards
-
How to send a text message from ServerModule to all MainForm sessions
hph replied to Max_name123's topic in General
Hi I tested it on iPad mini / iPad pro (under ios 9.3.5 / 12.1.4) also android (samsung): no problem! Are you shure, you have the right setup? -
How to send a text message from ServerModule to all MainForm sessions
hph replied to Max_name123's topic in General
@A.soltani Meaby this helps: socket.on('message', function(evt){ document.getElementById('log').innerHTML = evt.message; ajaxRequest(MainForm.window, "_message",["msgStr=" + evt.message]); }); and this?: function start_sse(param) { socket = new sgcWebSocket(param); ... I have updated the example, hope it helps you ;-) webSocket.zip -
How to send a text message from ServerModule to all MainForm sessions
hph replied to Max_name123's topic in General
Hi It is a part of the offical esegece websocket package. You will find it in: \sgcWebSockets\resources\ -
How to send a text message from ServerModule to all MainForm sessions
hph replied to Max_name123's topic in General
Hi In attach a small example. As websocket server, use: <sgcWebSockets\Demos\ServerSentEvents> and disable this: procedure TfrmServer.pageMainHTMLTag(Sender: TObject; Tag: TTag; const TagString: string; TagParams: TStrings; var ReplaceText: string); begin // if TagString = 'port' then // ReplaceText := IntToStr(WSServer.Port) // else if TagString = 'host' then // ReplaceText := '127.0.0.1'; end; Add in UniServerModul.CustomFiles (file is not available in the example): files/sgcWebSockets.min.js Hope it helps webSocket.zip -
How to send a text message from ServerModule to all MainForm sessions
hph replied to Max_name123's topic in General
This can help you: -
Hi Sherzod Thank you very much, it works perfectly!! best regards
-
Hi Sherzod Very thank you, it works fine! But, how can I change the color (or other badge properties) in runtime? best regards
-
Hi How can i change the badgetext background color in a unimButton?
-
Hi Meaby this can help you: https://www.netguru.com/codestories/few-tips-that-will-make-your-pwa-on-ios-feel-like-native https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html You can add the meta tags to UniServerModule.CustomMeta(), like this (works with ios): <!-- icons --> <link rel="apple-touch-icon" href="touch-icon-iphone.png"> <link rel="apple-touch-icon" sizes="20x20" href="files/images/ios/AppIcon.1.0/Icon-20x20@1x.png"> <link rel="apple-touch-icon" sizes="40x40" href="files/images/ios/AppIcon.1.0/Icon-20x20@2x.png"> <link rel="apple-touch-icon" sizes="60x60" href="files/images/ios/AppIcon.1.0/Icon-20x20@3x.png"> <link rel="apple-touch-icon" sizes="29x29" href="files/images/ios/AppIcon.1.0/Icon-29x29@1x.png"> <link rel="apple-touch-icon" sizes="58x58" href="files/images/ios/AppIcon.1.0/Icon-29x29@2x.png"> <link rel="apple-touch-icon" sizes="87x87" href="files/images/ios/AppIcon.1.0/Icon-29x29@3x.png"> <link rel="apple-touch-icon" sizes="80x80" href="files/images/ios/AppIcon.1.0/Icon-40x40@2x.png"> <link rel="apple-touch-icon" sizes="120x120" href="files/images/ios/AppIcon.1.0/Icon-40x40@3x.png"> <link rel="apple-touch-icon" sizes="120x120" href="files/images/ios/AppIcon.1.0/Icon-60x60@2x.png"> <link rel="apple-touch-icon" sizes="180x180" href="files/images/ios/AppIcon.1.0/Icon-60x60@3x.png"> <link rel="apple-touch-icon" sizes="76x76" href="files/images/ios/AppIcon.1.0/Icon-76x76@1x.png"> <link rel="apple-touch-icon" sizes="152x152" href="files/images/ios/AppIcon.1.0/Icon-76x76@2x.png"> <link rel="apple-touch-icon" sizes="334x334" href="files/images/ios/AppIcon.1.0/Icon-83.5@2x.png"> <!-- fullscreen webapp --> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-title" content="myApp"> After call your webapp in safari via url and link it to your homescreen. You can then open your app via this icon and you will have a fullscreen webapp ;-)
-
I'm interresting, do you have a example for this popup menu?