How to enable WL.JSONStore in Worklight project? - ibm-mobilefirst

When I played with the sample Using_JSONStore, I always tested WL.JSONStore=="undefined" on Android Mobile Browser Simulator or on a Android Virtual Device Emulator, or on my real Android device (Android version 2.3.5). How to enable the WL.JSONStore feature in the Worklight project? Thanks.

In Worklight 5.0.6.x, JSONStore is always part of the Android and iOS environments, so it is always present. There is nothing to 'enable'.
What you want to do, is perhaps initialize it, that is - use the init method. Is that what you're after?
Please also consult with the JSONStore documentation.

Enabling JSONStore
Since IBM® Worklight® V6.0, JSONStore is an optional feature. To use JSONStore, you must take steps to enable it.
About this task
To use JSONStore you must enable it by modifying the application-descriptor.xml file.
Procedure
Using the Application Descriptor Editor, open the file application-descriptor.xml
Click the Design tab.
Under Overview, expand Application [your application's name].
Click Optional Features.
Click Add.
Select JSONStore.
Click Ok.
Under Worklight Project, right-click the folder titled with your application name.
Select Run As….
Click Run on Worklight Development Server.
http://www-01.ibm.com/support/knowledgecenter/api/content/nl/it/SSZH4A_6.1.0/com.ibm.worklight.dev.doc/devref/t_enabling_jsonstore.html

Related

Deploy app onto a real device and get rid of local-dev-server dependence

Appreciate your lecture.
Currently, I can successfully deploy the app onto my iPhone device.
However, the app is rely on local-dev-server.
How could I get rid of the local-dev-server?
I used this command to deploy the app react-native run-ios --device 'iPhone' onto my cellphone
Here's my repo
https://github.com/poc7667/reacti-native-album
Here is a section from RN docs:
Building an app for distribution in the App Store requires using the Release scheme in Xcode. Apps built for Release will automatically disable the in-app Developer menu, which will prevent your users from inadvertently accessing the menu in production. It will also bundle the JavaScript locally, so you can put the app on a device and test whilst not connected to the computer.
To configure your app to be built using the Release scheme, go to Product → Scheme → Edit Scheme. Select the Run tab in the sidebar, then set the Build Configuration dropdown to Release.
you just need to select the Release scheme on the run configuration in xCode and hit the run button.

Fabric.io: new app does not show up in the dashboard

For some reason we needed to change the package-id of our existing android application. We already use Fabric for Crashlytics.
I'm trying to bring that new app up in the Fabric dashboard, but it's not showing there, despite the device log showing no issues (as fas as I can see): device log
Any ideas why the new package-id isn't visible in our dashboard?
Best,
Sven
I experienced a very similar issue to this when building an app with multiple flavours. The solution is to manually specify the package name, and not let Fabric try to automatically grab it, as it tries very hard to "stick" your old package name.
There is a full post available (disclaimer: my site), but essentially you need to use:
Fabric.with(
Fabric.Builder(this)
.kits(Crashlytics())
.appIdentifier(BuildConfig.APPLICATION_ID)
.build()
)
Make sure to include all dependencies on their dedicated gradle.build and meta in manifest file. Next is to throw a force runtime error on your device with internet connection also do not forget to initialize it first with Fabric.with(this,new Crashlytics()). If this doesn't work try to download and install Fabric for Android plugin in Android Studio, restart the IDE and you will see a fabric icon above. Start it and select your package name.
I had the exact same problem, in the log I clearly see that the Crashlytics is in use.
I/CrashlyticsCore: Crashlytics report upload complete: <ID>
But I cannot see my project on the dashboard, and always redirect to the tutorial.
After a Build-Clean and an Android studio restart, build and run the app again to my phone, and voilá, it finds itself. Now working, without any change.
I have the same problem. After hours of researches I resolve this for my application.
First: After adding new flavour, I make changes in Firebase console (added new app in existing project, with production SHA1, changed google-services.json).
After that app does not show in fabric dashboard and fabric plugin in Android Studio. Problem was resolved after linking new app in crashlitycs in firebase console. And after that check your roles, must have Owner role (on Firebase Console Project).

How to automatically reload changes HTML/CSS after "Run on Worklight Dev Server"?

I have a hybrid Worklight app and every time I change the HTML code I have to delete the app from Admin Console, Clean from Eclipse, clear Chrome browsing data and redeploy.
How can I automatically make WL reload the HTML changes every time I redeploy a WL environment (no more remove from Console or Clean from Eclipse)?
My first response is: huh?
You are totally not supposed to do this...
Starting Worklight 6.1, after a change in any of an application's web resources (HTML, JS, CSS, images, ...), after the initial deployment of the app (Run As > Run on Worklight Development Server) you no longer even need to re-build the app.
When you preview the app via Worklight Console, all you need to do is to refresh the browser window. That's it.
You most definitely should not delete the app from Worklight Console or "Clean from Eclipse".
That said, if you are talking about previewing the "Common web resources" option in Worklight Console, what you may want to do (hopefully as a one-time action) is to:
Close Eclipse
Locate your temp folder (Windows, OS X)
Delete the wlBuildResources folder (optionally wlPreview folder as well)
Open Eclipse
Re-build
Should work.
Now that that's fixed you can click the Go/Refresh Button of the simulator to utilize the "instant preview" feature during development.

Worklight 6.1 - App Center Mobile Client error

I'm currently trying to build the mobile client for IOS. There are 2 issue currently lingering:
The mobile client will be used for user to download the app from our test server. When i build, i run the Build Setting and Deploy Target script and tick the checkbox to deploy for another server. However i'm not sure the context path need to be put as what, the current default is /IBMAppCenter
When i try run the app center in the XCode simulator, the app center keep running with a loading icon. I check the log and found that it says:
ERROR: Plugin 'com.ibm.mobile.InstallerPlugin' not found, or is not a CDVPlugin.
Check your plugin mapping in config.xml
I check my native folder (ipad\native\CordovaLib) and true enough, the CDVPlugin was not in the plugin folder, but when i look into the Classes folder, the header (.h) and implementation (.m) files are there. How should i configure to make it work?
Any help is appreciated. Thanks.
About question 1:
The deploy target is irrelevant. It is only relevant for "normal" Worklight applications that are managed by a Worklight Console (so you must specify on which server your Worklight Console runs). But the Application Center client is not managed by any Worklight Console. All what you do is to build the environment, create the IPA and upload it to the Application Center server. Therefore, please only use the "Build all environments" menu item and ignore anything with deploy target!
See here: http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.appadmin.doc%2Fappcenter%2Ft_ac_proj_imp_build.html
About question 2:
The Application Center mobile client for iOS should be in the iphone environment, not in the ipad environment. The code in the iphone environment folder should work for ipad as well but you cannot generate an ipad environment for the Application Center client, as well as you cannot delete the iphone environment and regenerated it via File > New > Environment, because when you do that, the libAppCenterInstallerLib.a gets deleted. You must take the project as it was in your original installation.
Please check IBMAppCenter/apps/AppCenter/iphone/native/appCenterLib. This should contain subdirectories (for Release, Debug ...) which contain libAppCenterInstallerLib.a. The error message that you see means that it cannot find this library; probably because you deleted the iphone environment or because you attempted to create an ipad environment.

IBM Worklight 6.1 - Unable to pull app to device using MTWW

First off let me be clear. I have several iOS devices. On the devices that have 7.0.6 I have no issues. When I updated one of the devices to 7.1 I'm having an issue. Let me explain.
On the iOS device that has 7.1 I navigate to the workbench URL and then I go to Manage applications and select install. I then get this message "Cannot install applications because the certificate for >ip address< is not vald. This process works on devices that have 7.0.6. I'm assuming there are issues with the new iOS update.
Now I did some searching and I found something that said there's an issue when trying to download an app from a HTTP site, so I changed a Web Reports setting (found in Eclipse Preferences -> Test -> Performance Test Reports -> Web Reports) to "Security is required to access reports". Thus it changed the port number to "8443". I then navigate back to the workbench URL using the https : // ip:port and try to install the app again. This time it just says Cannot open.
Any ideas on this?
Here is a workaround to be able to test with iOS 7.1
1) Get the zip of instrumented Application from developer or other who can run rtwBuildXcode.sh on a Mac and who has the source code for Application. [RmotXXXXXXXX.zip file]
2) Use RTWec "Add Application to list..." button and brows to the zip to "import" it into RTWec.
3) UnZip the zip and use iTunes (for Windows) "Add File to Library..." menu to navigate in zip folder to the instrumented iOS Device application [XXXXXXXX.ipa in “instrumented/iOS Device” folder]
4) Plug in iDevice to Windows using USB, select the App, click associated "Install" button, then "Sync" iTunes.
5) Now test as usual...
Thanks
MTWW in Worklight 6.1.0.0 and 6.1.0.1 (to be released, soon) does not support iOS 7.1.
Work is under way to provide support in a future release of Worklight.