0
votes

I'm using worklight application management features from an Android native App.

I want that when in the console the application status is changed to "Access Disabled" the only option for the user will be to quit.

In the Knowledge Center and in Developer works there is documentation about how to do it:

http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.appadmin.doc/admin/t_denying_access_to_older_app_versions.html?lang=en https://www.ibm.com/developerworks/community/blogs/worklight/entry/how_to_create_a_customized_remote_disable_behavior?lang=en

It is explained that you must set a specific value for the initOptions object used in the WL.Client.init() method.

But in the Android native API I have not found the way to set the initOptions. The init method is deprecated and it does not accept initOptions.

Also, in case of Remote Disable the ResponseListener used in the WLClient.connect(aResponseListener) is not invoked, success or failure, no method is executed. Is this working as designed? I would expect a failure or success but not nothing.

Is it possible in a native app to force the application to close in case of Remote Disable? How could I handle this situation manually in the app?

2
I don't know yet if this is possible technically (you probably need to overwrite some function to implement it yourself), but it should be noted that Not Apple nor Google encourage to force your user to quit. That action belongs to the user to decide. Additionally, Remote Disable is not meant to disable the application, but to disable the access to the server - meaning to make it not possible to invoke adapters, or use any features that require server, any other functionality in the app is still accessible.Idan Adar
Ok, for example, in case of remote disable I want to disable the options related to server features, disabling buttons forexample. How can I know in the app that the app is disabled?Jxadro
Click the button that is supposed to do some adapter invocation - you will receive the Disabled dialog again. BTW, the documentation and blog post you've read is meant for Hybrid applications, not native ones.Idan Adar
Of course, that is the OOTB behaviour, but I think that is a poor experience for the user having all the buttons or options enabled if I know that they are not going to work. So if I could get any kind of response from the server that allows me to know that the application is disabled I could do whatever is needed. It was just an example. Not getting an answer in the .connect() is a problem, you can act in case of success or failure but if none of those methods are invoked it is hard to manage.Jxadro
I understand. I will check if there is any such property that you can check against, but currently I think not. Until then see my answer for general guidelines about creating your own remote disable dialog (best I can provide at this time).Idan Adar

2 Answers

1
votes

Unfortunately I do not have an example for you, but this is the general idea.
See if you can work with it (if someone can produce an example - please do...):

You need to create your own Remote Disable challenge handler that will extend the default Worklight Remote Disable challenge handler (RemoteDisableChallengeHandler.java).

class MyRemoteDisableChallengeHandler extends WLRemoteDisableChallengeHandler

Then you need to implement your custom logic in MyRemoteDisableChallengeHandler

WLClient.registerChallengeHander(new MyRemoteDisableChallengeHandler())

This will override the original.
You'll need to create your own dialog with a Quit button.

Some additional documentation.

0
votes

For handling MaM configurations, this is, when you configure the app as Lost, Stolen, etc, in the Worklight Console -> Devices tab you must install the Fix IF201408281937 (Worklight 6.2) or later.

This events are also handled with the ChallengeHandler registered for the realm "wl_remoteDisableRealm"