IBM Worklight 6.0 - Unable to enable the Cordova geolocation control in the Mobile Browser Simulator - ibm-mobilefirst

running WL Studio 6.0, on RHEL 6, with Firefox.
I am unable to enable the Cordova geolocation control in the Mobile Browser Simulator. When I expand the Geolocation section in Cordova controls, all I get is the following message within the control:
"Using the geolocation service provided with Firefox."
I have turned off Firefox's "geo.enabled" config setting in about:config, reloaded the page, restarted the browser.
I have set Firefox's Share Location permission to blocked in my page settings for the MBS page and reloaded the browser.
Is there a way to enable this MBS feature on firefox (on linux)?

There is no setting in the Mobile Browser Simulator to change that, but sounds like there should be. Or at least needs to better detect if the FireFox geo.enabled setting is turned on.

Related

IBM MobileFirst 8.0 WLAuthorizationManager.obtainAccessToken() No Response

I'm previewing the MobileFirst app (Cordova) on both browser and iOS Emulator but there doesn't seem to be any response when I call WLAuthorizationManager.obtainAccessToken().
I've tried to allow cross origin request but still face the same issue. Does anyone have any suggestions for what I should look at?
I had a similar issue on the iOS emulator. I even used Wireshark to see what was happening and the app never fired the authorisation request.
In the end I found that if you're running XCode 8.x, you have to enable keychain sharing by selecting the project -> Capabilities -> Keychain Sharing, and setting it to On.
After that I had to register the app again and all worked fine.
Make sure when you register or push the app and you're prompted for the version number, that you enter x.x.x instead of x.x - otherwise the server will not recognise the app.
Another thing to double check is the mfp:server runtime and url values in the config.xml file, if your pc's ip address has changed then the url value could be incorrect.

Unable to change the Server URL in android in IBM mobile first platform

I am migrating worklight hybrid projects from 6.0.2 to 6.3. When i do this and install the application on to android device, I am unable to edit worklight settings and change the URL.However the same feature is working on IOS devices.
But when I create new project on 6.3 , the above feature works fine in android as well.
In application-descriptor.xml worklight settings is enabled though.
.
However when I try to change the URL in android device by editing the settings, below exception is thrown.
02-16 18:48:27.173: E/EnterpriseContainerManager(552): ContainerPolicy Service is not yet ready!!!
02-16 18:48:27.173: E/ViewRootImpl(27590): sendUserActionEvent() mView == null
02-16 18:48:50.155: E/Watchdog(552): !#Sync 706
Settings pop up is not showing up , to change the URL. Please suggest.
Worklight Settings is unreliable on Android devices using API Level 10 and above. The settings screen may appear but not work, or the Options Menu that invokes it may not appear at all, etc.
However, starting MobileFirst Platform 6.3 there is dedicated API for setting & getting the Server URL, enabling you to change it during runtime: WL.App.getServerUrl and WL.App.setServerUrl.
There is a blog post on this new ability that explains how to use the API methods as well as provides a sample application. You can follow it and integrate it in your application instead of using the Worklight Settings screen in Android.
Blog post: https://developer.ibm.com/mobilefirstplatform/2015/02/02/changing-server-url-runtime/

Worklight user-agent

I've been showing a page on the console (Android environment), and testing if this external page (an html page of mine) has been opened using a mobile device or a desktop by checking the user-agent using this piece of code:
navigator.userAgent.match(/Android/i)
If I run this piece of code on the real device it shows it's an Android device, if I launch the Worklight Console it shows it's a desktop device. How can I change the user-agent in order to let Console think it's an Android device? I've installed the Chrome extension but I didn't understand how to use it.
It sounds to me like you want to debug your Android environment (which is meant for mobile devices) while using the Chrome desktop browser?
Try the following and see if this is what you want:
Preview the web resources
If all your web resources are in the common\css or common\js folder, open Worklight Console and click on "preview web resources"
If the web resources are coming from both the common\ and android\ folders, you can use this URL structure: http://replace-with-host-or-ip-address:10080/replace-with-project-name/apps/services/preview/replace-with-app-name/android/1.0,
Open the Chrome DevTools and click on the device icon:
Then, from the UI that will open up you can select from the Devices dropdown to adjust the viewport to that of the chosen Android device.

Configuring Worklight Application Center download/install

I have the Worklight 6.1 Application Center installed on a server.
Users install from the the Application Center by visiting a url on their mobile browser. Clicking the Install button downloads the mobile app. But when the mobile user taps the Install button, the mobile browser window does not close, so the user gets no feedback that the download is occurring.
How can the behavior of the Install button be configured to make sure the browser window closes when the install begins?
The answer depends on the mobile operating system you are using when visiting the installers.html URL and clicking on the Install button.
In:
Android: a "Downloading..." toast message is displayed
iOS 7: the mobile Safari app goes to the background and you can see the application being installed
iOS 8: the mobile Safari app will not go to the background
In iOS, Apple does not expose any APIs to the developer in order to provide visual cues as an application is being downloaded.

Cannot view video from publisher using Chrome to iPad with OpenTok

I'm currently trying to set up a connection between my web client and my iOS app, but for some reason my iOS client only sees a black box when using Chrome (version 33). I can see the video just fine if I use Firefox (both in my app and when I put the browsers side-by-side, they can see each other).
This doesn't appear to be a documented known issue with the JavaScript SDK, and I can't see any recent discussion about this on the forums (last post was mine).
The iOS sample can be located here (samples/OpenTokHelloWorld) with the browser page in samples/OpenTokHelloWorld/browser_demo.html
I suggest cd'ing into samples/OpenTokHelloWorld and running python -m SimpleHTTPServer, as it can't be run from a file:/// path.
Here is what my iPad sees:
Chrome:
Firefox:
And Chrome/Firefox (respectively), both publishing video from the same camera
Edit: after testing on other machines, it may be something specific to my environment even though none of my extensions run in Incognito and I don't have any custom plugins installed.
It looks like the OpenTok mobile SDKs with the specific webcam I was using has issues. On Android the video stream will display for a brief moment then segfault, and on iOS there will be no video at all.
I have tested this many times and could not reproduce what you are seeing in your chrome.
Without seeing any console errors or iOS logs the best suggestion is to try clearing your cache, or maybe restarting your computer (longshot)