How can i create local Notification in worklight - notifications

I'm creating an app using Worklight. I need to show a Notification at specific time like an alarm clock. It'd work when offline so i cannot use Push Notification.
I need Notification like image below. Thanks.

iOS's Local Notifications feature does not have built-in support in Worklight.
One way to add Local Notifications support is by extending your application using a Cordova plug-in, which will allow you to run Native code.
This means that you will natively implement it by following Apple's APIs: to schedule the notification in the app and to then receive a notification locally via the OS, that will in turn allow you to open the app and execute an optional callback, etc...
You could either write a custom Cordova plug-in of your own,
Or find existing plug-ins on the web.
When adding an existing Cordova plug-in to Worklight (depending on your version of Worklight and version of Cordova), the instructions to do so are a bit different at this time.
This video demonstrates one instance of how to do add an existing Cordova plug-in: Integrating Cordova plugins into Worklight applications

Related

Implement mobilefirst service in ios app

In IBM bluemix, i basically have to use mobileFirst service to host my ios application being implemented in it. I have seen several tutorials and stack overflow search for that but didn't got any satisfactory answer from that. If you can provide any sequential tutorial for that will be very helpful.
Set up your Mobile Foundation service instance, as instructed in the following doc: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/bluemix/using-mobile-foundation/
Create an iOS application. It can be a native app or a Cordova app with the iOS platform.
Add the MobileFirst SDK to the application by following the instructions per the required platform, here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/sdk/
Register the application in the server. You can do this either via CLI or via a graphical interface. You can see a "quick start" way, here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/quick-start/
Basically, to register an app from the command-line, simply navigate to the app root folder and run the command: mfpdev app register.
To ensure the connection between the server and client, you can make a simple call to obtain a token. You can find this code in the Quick Start docs mentioned above.
For iOS, be sure to enable "Keychain Sharing" in Xcode.

how to Manage app and data on a device (Block, Wipe and others) in ibm mobilefirst 8.0

How to Manage app and data on a device (Block, Wipe and others) in ibm mobilefirst 8.0?
Following options are available in Mobilefirst 7.1:
Managing app distribution (using the Application Center)
Managing app versions (using the Operations Console)
Managing app access (using the Operations Console)
Managing usage, performance, warnings and errors (using the Analytics Console)
Managing data access
I suggest that you will take a tour of the MobileFirst Operations Console in MobileFirst Foundation 8.0. See here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/product-overview/components/console/
Managing data access / Managing app access
I assume you are referring to "remote disable". This is available from the application screen in the console. Select the desired registered application from the sidebar navigation and under the Management tab you will see a Application Access title.
Managing usage, performance, warnings and errors (using the Analytics Console)
Unsurprisingly, this is available from the Analytics console as before.
Learn more about Analytics console here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/analytics/console/
Managing app distribution (using the Application Center)
This has not changed and it not related to MobileFirst Foundation 8.0. You do this through the AppCenter console as before. AppCenter did not change between 7.1 and 8.0.
Managing app versions
In previous versions you would have upped the version value in application-descriptor.xml. In v8.0 instead whenever you want to release a new point release, i.e. 1.1 or 2.0 etc, you need to register another app versions, either using the MobileFirst CLI or directly via the console.
I suggest that you will start getting familiar with the product...
Product overview: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/product-overview/
Upgrading/Migrating: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/upgrading/
Application development: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/

Push notification does not work on mobilefirst platform 7.1 server

We have develop a cross platform app with mobilefirst studio 7.0 and test it on production environment.
It was fine before we upgrade our project with mobilefirst studio 7.1.0.00-201510120-1525 and test it on clean staging server (7.1.0.0 20151012-1525).
It seems that the push notification functionality dedicated on mobilefirst 7.0 did not work properly on production server of mobilefirst platform version 7.1. The source code and configuration file of our mobilefirst push notifcation adapter and configuration files are here.
Inorder to fix the issue, we refer to official push notification tutorial which was documented here.
Surprisingly, although the source project in official tutorial looks fine on development server, it still not work on production server either.
We have test this project using iphone5s with ios 8.4 and HTC 816h phone with android 4.4.2, both of them fail to register push notification service after we login to the HybridEventSource sample application and tap the “Subscribe Notification” button.
The Mobilefirst server logs down internal server error message during the registration process of client devices.
I am wondering how to let the push notification mechanism work again on mobilefirst 7.1?
Either a valid push notification sample code of mobilefirst 7.1 or any fix pack which we do not know is welcomed.
Since we did not authenticate users via mobilefirst server, and devices were connected through vpn to server,
we prefer to have a solution which does not depends on particular mobilefirst server side authentication mechanism.
The server log message generated during this test is in this file.
The log file generated while we run EventSourceNotification app as xcode project is in this file.
For detail system log from ios device, please refer to device log file
And the Log message generated by HTC 816h android 4.4.2 phone is here
Information about our server environment:
Operating system : centos 5.8 linux
Java development kit : Oracle jdk 1.8 update 65 x86-64
Application server : Apache tomcat server 7.0.63
Worklight environment database : oracle database 11g.
Apple push notification service certificate : sandbox version
Well that's kinda suspicious, isn't it?
Since we did not authenticate users via mobilefirst server, and devices were connected through vpn to server, we prefer to have a solution which does not depends on particular mobilefirst server side authentication mechanism.
You are using the push mechanism provided by MFPF but you do not want to go through MFPF? You are required to go through MFPF if you want to use the push mechanism provided by MFPF... What did you mean by the above?
That said, did your DBA examine mf7-1-EventSourceNotifications-catalina.out.log? There are quite a few Oracle-related exceptions there that you should look at.
If you are still unable to resolve it I suggest to open a PMR instead so that the development team will be able to further investigate.

IBM Worklight Offline Support

we have an app which uses JSONStore to support offline, if device is offline and user submit data it stores it offline, now when device is online and when user login to the app it sync with server and submit all data to server.
the question is, Is it possible when device comes online then my offline data sync with server without user open my app ?
Does worklight support that? Or I have to do something else?
please advice
Like Idan said, Worklight does not support this, but depending on the OS, it could support it.
For instance, on Android, you could use BroadcastReceivers to detect changes in network connectivity, and execute an action when it happens, regardless of whether your app is closed or not.
Here is the API for the receiver: http://developer.android.com/reference/android/content/BroadcastReceiver.html and here is a SO answer explaining how to use it to detect WiFi connectivity: https://stackoverflow.com/a/22626736/2245921 So you can modify this BroadcastReceiver to run the sync code that you would normally do if your app was already open.
If you are using any other platform (iOS, Windows) there might be an equivalent that you can use.
Also, keep in mind that if you are doing a hybrid application, you can create your own Cordova plugin to execute native code from Javascript. Here is the documentation on how to do so: http://cordova.apache.org/docs/en/3.5.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide

Worklight how to retrieve latest app version on server from client side?

I need to compare the current app version with the latest app version deployed on worklight server from both android and ios app.
Did some research and found the link below but the mentioned api only returns current app version.
Can we get the app version and IP address info using worklight api?
Is there any way the mobile client can retrieve the latest app version?
I'm using Worklight version 5.0.6
Thanks in advance.
As written in the comments:
The way you're trying to do this is not the right one IMO.
with the Remote Disable feature as it is now you can block any environment and a specific version of it that you'd like, as long as it is deployed to the Worklight Server.
For the feature to work, you do not need to know what is the latest version; simply go to the console and disable the app version that is installed on the the device. You can customize this remote disable dialog and/or its behavior, see this blog post: How to Create a Customized Remote Disable Behavior.
The written in the blog post is supported in the latest Worklight versions: 5.0.6.2, 6.0.0.2 and 6.1.0.1.