How to get Hybrid phone online and offline Profile
0
Hi all, I'm struggling with how to get Hybrid phone online and offline Profile. I have seen the following page. However, it didn't work for me. https://community.mendix.com/link/questions/88147 My javaScript Snippet Code is as below. 'getProfile' works well. However, 'isOffline' doesn't work. Also, I looked into my project 'resource.zip' file and then I found 'isOffline' exists in mxui.js. $(document).ready(function () { var profile = mx.ui.getProfile(); var hoge = mx.isOffline(); alert(String(hoge)); mx.data.create({ entity: "Commons.ControlDefaultLoginPage", callback: function (obj) { //console.log("Object created on server"); var varUrl = location.href; obj.set('Url', varUrl); obj.set('Profile', profile); obj.set('isOffline', hoge); mx.data.action({ params: { applyto: "selection", actionname: "Commons.JS_ShowDefaultLoginPage", guids: [obj.getGuid()] }, error: function (error) { alert(error.message); } }); }, error: function (e) { console.error("Could not commit object:", e); } }); }); Could you let me know if I am missing anything.I'm glad if you could give me any advice.
asked
Toshiya Anada
2 answers
0
My code on Index.html is as below. I also tried on JavaScript Snipet. The result was same..
// If URL includes local, /SSO/ will be added. this code is for debug.
var profile = mx.ui.getProfile();
var a = mx.isOffline();
var str = "localhost";
var n = location.href.includes(str);
alert("profile:" + profile);
if(a == false) { alert("a:" + a); }
if(n == true) {
var doc = document;
var head = doc.getElementsByTagName("head")[0];
var meta = doc.createElement("meta");
meta.setAttribute("http-equiv","refresh");
meta.setAttribute("content","0; URL=/SSO/");
head.appendChild(meta);
}
if (!document.cookie || !document.cookie.match(/(^|;)originURI=/gi))
document.cookie = "originURI=/SSO/";
Does anyone have a solution?
answered
Toshiya Anada
-1
Hello,
Toshiya, have You solved this problem ?
If yes, could You share the solution ? :)
I have the same issue about profiles information and switching between 2 profiles.