A react-native module that wraps the native Apphub SDK (https://apphub.io/). Currently, only support iOS.
AppHub is a great tool to dynamically update react native apps, and it provides very clean APIs. However, since the majority of development (including logging) should be done in JS, it will be nice to control this updating function also in JS.
This RN library provides APIs including initAppHub, fetchNewBuild (Promise), and setServer (for self host).
npm install --save react-native-apphub
npm install --save apphub
react-native link apphub
ornpm install -g rnpm && rnpm link apphub
react-native link ract-native-apphub
ornpm install -g rnpm && rnpm link react-native-apphub
Connect Your App to AppHub (Example: AppDelegate.m)
#import "AppHub.h"
Add the following before creating an RCTRootView (most likely in AppDelegate.m). Leave this code commented while you are developing your app. Uncomment it when you are ready to distribute to test users and deploy to the App Store
/**
* OPTION 3 - AppHub
*
* Load cached code and images from AppHub.
*
*/
AHBuild *build = [[AppHub buildManager] currentBuild];
jsCodeLocation = [build.bundle URLForResource:@"main"
withExtension:@"jsbundle"];
import RNAppHub from 'react-native-apphub'; // Import package from node modules
// Init AppHub
// For self hosted app
// RootURL: AppHub Server
// ApplicationID: Unique app id
RNAppHub.initAppHubWithServer('RootURL', 'ApplicationID');
// For using AppHub service
// RNAppHub.initAppHub('ApplicationID');
// Poll New app bundle
RNAppHub.fetchBuild();