Can I use a MobileFirst app without the MobileFirst server?

390 views Asked by At

Can I consume a web service in a MobileFirst application without a MobileFirst server?

4

There are 4 answers

0
Idan Adar On

If the call is for example to an external resource you can use the same plain regular AJAX calls as you would anywhere else.

If the resource is protected by MobileFirst Platform, then you must use adapters. Adapters must go through the MobileFirst Server.

0
Yoel Nunez On

Yes, you can use your MobileFirst app without the need to connect to a MobileFirst server.

The drawback of not using the MobileFirst server is that you'll be loosing all of the features it provides like authentication, security, adapters, unified push notifications, direct update (for hybrid), remote disable, and other features.

If you want to make a request to any endpoint you can use WLResourceRequest (available from version 7.0 onwards) or any other native method to make HTTP requests.

Information on how to use WLResourceRequest

Android: https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.apiref.doc/html/refjava-worklight-android-native/html/com/worklight/wlclient/api/WLResourceRequest.html

Hybrid: https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/WLResourceRequest.html?cp=SSHS8R_7.0.0%2F9-0-0-1-31

iOS: https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.apiref.doc/html/refobjc-worklight-ios/html/interface_w_l_resource_request.html%23a004749b662c6f4a55a3b76e47f7e6062?lang=en

5
Sachin Thapa On

You cannot use a mobile first app if you are using MF 7.0 or higher without a server, as soon as you launch the app it invokes an authorization request something like following:

<< domain >>/<< context >>/authorization/v1/clients/instance

Which connects to your workflight server and if it doesnt get response it will fail.

As far as invoking a web service is concerned that is just javascript if you are doing hybrid you can use AJAX as mentioned in another answer. If you are building native IOS or Android you can invoke http request using sdk libraries.

Cheers !

0
Praj On

Use it like simple IDE to develop application(Native and hybrid).You can use client side API also that do not connect to the mobilefirst server.