npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-ibm-mobilefirst-liveupdate

v8.0.2020051909

Published

React Native SDK for IBM Mobile liveupdate. Works with IBM Mobile First.

Downloads

8

Readme

IBM MobileFirst - LiveUpdate React Native SDK plug-in

To add IBM MobileFirst™ LiveUpdate feature to an existing React Native app, you add the react-native-ibm-mobilefirst & react-native-ibm-mobilefirst-liveupdate plug-in to your app. The react-native-ibm-mobilefirst plug-in contains the IBM MobileFirst Platform Foundation SDK and the react-native-ibm-mobilefirst-liveupdate contains API to work with LiveUpdate feature.

Refer to the documentation links for more information.

Installation

Download the react-native-ibm-mobilefirst-liveupdate.tar.gz from this repo and run the following command to install LiveUpdate plugin

npm install react-native-ibm-mobilefirst-liveupdate --save

Getting Started

Pre-requisites

  1. Make sure you have all the pre-requisites for a React Native app covered. See the React Native Getting Started page if you're new to this whole stuff.
  2. Setup of MobileFirst server

Create React Native Project

  • The first step is to create a React Native project. Let's call our app as the MobileFirstApp. Use the React Native CLI to create a new project.

react-native init MFLiveUpdateApp

  • Next, add the react native plugin to your app

cd MFLiveUpdateApp

npm install react-native-ibm-mobilefirst-liveupdate —-save

Note : LiveUpdate package supports React Native v0.62.x and above.

  • Install Mobilefirst specific cocopods dependencies to the project.

cd ios && pod install

This step is applicable only for iOS platform.

  • react-native-ibm-mobilefirst-liveupdate plugin internally depends on react-native-ibm-mobilefirst plugin, so your app will be required to have mfpclient configuration file. Make sure your application is added with mfpclient configuration file updated with Valid MobileFirst Server Host Address.

Configure the Application

Android

Make the following changes to AndroidManifest.xml (<PROJECT_ROOT>/android/app/src/main/)

  • Add xmlns:tools="http://schemas.android.com/tools" to the manifest tag. E.g.
<manifest 
  xmlns:android="http://schemas.android.com/apk/res/android" 
  xmlns:tools="http://schemas.android.com/tools"
  package="com.mobilefirstapp">
  • Add tools:replace="android:allowBackup" to the application tag. E.g.
<application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
      tools:replace="android:allowBackup">
iOS
  • Install Mobilefirst specific cocopods dependencies to the project.

cd ios && pod install

This step is applicable only for iOS platform.

Test the Application

Android

  • To run the application :

react-native run-android

iOS

  • To run the application :

react-native run-ios

Supported platforms

  • Android
  • iOS

Configuration In MobileFirst Operation Console

  1. Add a scope mapping for liveupdate.mobileclient in MobileFirst Operations Console → [your application] → Security tab → Scope-Elements Mapping. Map it to an empty string if you want to use the default protection or to a security check if you're using one.

Learn more about scope mapping

  1. You can add schemas and features from the MobileFirst Operations Console → [your application] → Live Update Settings

Once you've setup schemas and features you can start use the client side API.

Sample Usages of the API

var useClientCache = false; //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.

var featureId = 'featureId';
var propertyId = 'propertyId' ;

MFLiveUpdate.obtainConfiguration(useClientCache)
  .then(result => {
  
 console.log('Is feature enabled for' + featureId + ':' + result.isFeatureEnabled('featureId')); 
console.log ('Property value for the ' + propertyId + 'is :' +result.getProperty('propertyId'));


 }) 
  .catch(err => console.log('There was an error:' + err))

Documentation

See the IBM MobileFirst Platform Foundation section of IBM Dev Center:

IBM Live Update service