import MFLiveUpdate from 'react-native-ibm-mobilefirst-liveupdate/js/MFLiveUpdate.js'
MFLiveUpdate
This class represents MFLiveUpdate.
Method Summary
Public Methods | ||
public |
async obtainConfiguration(useClientCache: boolean): Promise<Map, String> Obtain the liveupdate configuration object from server |
|
public |
async isFeatureEnabled(featureId: string): Promise<Boolean> Check if a feature is enabled on the configuration object returned from the server by calling obtainConfiguration API. Return true if feature is enabled or undfined for non existing feature for the given featureId |
|
public |
async getProperty(propertyId: string): Promise<String> Get value of a property on the configuration object returned from the server by calling obtainConfiguration API. Return the value for the given propertyId or undefined in case the property doesn't exist |
Public Methods
public async obtainConfiguration(useClientCache: boolean): Promise<Map, String> source
Obtain the liveupdate configuration object from server
Params:
Name | Type | Attribute | Description |
useClientCache | boolean | useClientCache - true (default) tells the native iOS/Android code if we want to cache the result of the calls, cache expiratrion is set in the MFP admin console. |
Return:
Promise<Map, String> | If success, a configuration object response containing features and properties fields returned from the server. |
public async isFeatureEnabled(featureId: string): Promise<Boolean> source
Check if a feature is enabled on the configuration object returned from the server by calling obtainConfiguration API. Return true if feature is enabled or undefined for non existing feature for the given featureId
Params:
Name | Type | Attribute | Description |
featureId | string | featureId - the feature id to be checked. |
Return:
Promise<Boolean> | If success, return true if feature is enabled or undefined for non existing feature for the given featureId . |
public async getProperty(propertyId: string): Promise<String> source
Get value of a property on the configuration object returned from the server by calling obtainConfiguration API. Return the value for the given propertyId or undefined in case the property doesn't exist
Params:
Name | Type | Attribute | Description |
propertyId | string | propertyId - the property id . |
Return:
Promise<String> | If success, return the value for the given propertyId or undefined in case the property doesn't exist . |