@mendix/native 2.0.0-alpha.1 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/ios/mendixnative.xcframework/Info.plist +44 -0
  2. package/ios/mendixnative.xcframework/ios-arm64/Headers/AppMenuProtocol.h +10 -0
  3. package/ios/mendixnative.xcframework/ios-arm64/Headers/AppPreferences.h +18 -0
  4. package/ios/mendixnative.xcframework/ios-arm64/Headers/AppUrl.h +16 -0
  5. package/ios/mendixnative.xcframework/ios-arm64/Headers/DevAppMenuUIAlertController.h +7 -0
  6. package/ios/mendixnative.xcframework/ios-arm64/Headers/JSBundleFileProviderProtocol.h +9 -0
  7. package/ios/mendixnative.xcframework/ios-arm64/Headers/MendixApp.h +33 -0
  8. package/ios/mendixnative.xcframework/ios-arm64/Headers/MendixBackwardsCompatUtility.h +14 -0
  9. package/ios/mendixnative.xcframework/ios-arm64/Headers/MendixNative.h +20 -0
  10. package/ios/mendixnative.xcframework/ios-arm64/Headers/MendixReactWindow.h +10 -0
  11. package/ios/mendixnative.xcframework/ios-arm64/Headers/MxConfiguration.h +26 -0
  12. package/ios/mendixnative.xcframework/ios-arm64/Headers/NativeDownloadHandler.h +26 -0
  13. package/ios/mendixnative.xcframework/ios-arm64/Headers/NativeOtaModule.h +14 -0
  14. package/ios/mendixnative.xcframework/ios-arm64/Headers/NativeReloadHandler.h +12 -0
  15. package/ios/mendixnative.xcframework/ios-arm64/Headers/OtaConstants.h +35 -0
  16. package/ios/mendixnative.xcframework/ios-arm64/Headers/OtaHelpers.h +13 -0
  17. package/ios/mendixnative.xcframework/ios-arm64/Headers/OtaJSBundleFileProvider.h +10 -0
  18. package/ios/mendixnative.xcframework/ios-arm64/Headers/ReactNative.h +54 -0
  19. package/ios/mendixnative.xcframework/ios-arm64/Headers/RuntimeInfo.h +14 -0
  20. package/ios/mendixnative.xcframework/ios-arm64/Headers/RuntimeInfoProvider.h +10 -0
  21. package/ios/mendixnative.xcframework/ios-arm64/Headers/RuntimeInfoResponse.h +13 -0
  22. package/ios/mendixnative.xcframework/ios-arm64/Headers/SplashScreenPresenterProtocol.h +10 -0
  23. package/ios/mendixnative.xcframework/ios-arm64/Headers/UnsupportedFeatures.h +12 -0
  24. package/ios/mendixnative.xcframework/ios-arm64/Headers/WarningsFilter.h +12 -0
  25. package/ios/{libMendixNative.a → mendixnative.xcframework/ios-arm64/libMendixNative.a} +0 -0
  26. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/AppMenuProtocol.h +10 -0
  27. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/AppPreferences.h +18 -0
  28. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/AppUrl.h +16 -0
  29. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/DevAppMenuUIAlertController.h +7 -0
  30. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/JSBundleFileProviderProtocol.h +9 -0
  31. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/MendixApp.h +33 -0
  32. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/MendixBackwardsCompatUtility.h +14 -0
  33. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/MendixNative.h +20 -0
  34. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/MendixReactWindow.h +10 -0
  35. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/MxConfiguration.h +26 -0
  36. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/NativeDownloadHandler.h +26 -0
  37. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/NativeOtaModule.h +14 -0
  38. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/NativeReloadHandler.h +12 -0
  39. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/OtaConstants.h +35 -0
  40. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/OtaHelpers.h +13 -0
  41. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/OtaJSBundleFileProvider.h +10 -0
  42. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/ReactNative.h +54 -0
  43. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/RuntimeInfo.h +14 -0
  44. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/RuntimeInfoProvider.h +10 -0
  45. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/RuntimeInfoResponse.h +13 -0
  46. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/SplashScreenPresenterProtocol.h +10 -0
  47. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/UnsupportedFeatures.h +12 -0
  48. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/Headers/WarningsFilter.h +12 -0
  49. package/ios/mendixnative.xcframework/ios-arm64_x86_64-simulator/libMendixNative.a +0 -0
  50. package/package.json +1 -1
@@ -0,0 +1,44 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>HeadersPath</key>
9
+ <string>Headers</string>
10
+ <key>LibraryIdentifier</key>
11
+ <string>ios-arm64</string>
12
+ <key>LibraryPath</key>
13
+ <string>libMendixNative.a</string>
14
+ <key>SupportedArchitectures</key>
15
+ <array>
16
+ <string>arm64</string>
17
+ </array>
18
+ <key>SupportedPlatform</key>
19
+ <string>ios</string>
20
+ </dict>
21
+ <dict>
22
+ <key>HeadersPath</key>
23
+ <string>Headers</string>
24
+ <key>LibraryIdentifier</key>
25
+ <string>ios-arm64_x86_64-simulator</string>
26
+ <key>LibraryPath</key>
27
+ <string>libMendixNative.a</string>
28
+ <key>SupportedArchitectures</key>
29
+ <array>
30
+ <string>arm64</string>
31
+ <string>x86_64</string>
32
+ </array>
33
+ <key>SupportedPlatform</key>
34
+ <string>ios</string>
35
+ <key>SupportedPlatformVariant</key>
36
+ <string>simulator</string>
37
+ </dict>
38
+ </array>
39
+ <key>CFBundlePackageType</key>
40
+ <string>XFWK</string>
41
+ <key>XCFrameworkFormatVersion</key>
42
+ <string>1.0</string>
43
+ </dict>
44
+ </plist>
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @protocol AppMenuProtocol
8
+ @required
9
+ -(void) show:(BOOL)devMode;
10
+ @end
@@ -0,0 +1,18 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @interface AppPreferences : NSObject
8
+ + (NSString *) getAppUrl;
9
+ + (void) setAppUrl:(NSString *)url;
10
+ + (BOOL) devModeEnabled;
11
+ + (void) devMode:(BOOL)enable;
12
+ + (BOOL) remoteDebuggingEnabled;
13
+ + (void) remoteDebugging:(BOOL)enable;
14
+ + (void) setRemoteDebuggingPackagerPort:(NSInteger)port;
15
+ + (int) getRemoteDebuggingPackagerPort;
16
+ + (BOOL) isElementInspectorEnabled;
17
+ + (void) setElementInspector:(BOOL)enable;
18
+ @end
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @interface AppUrl: NSObject
8
+ + (int) defaultPackagerPort;
9
+
10
+ + (NSURL *) forBundle:(NSString *)url port:(int)port isDebuggingRemotely:(BOOL)isDebuggingRemotely isDevModeEnabled:(BOOL)isDevModeEnabled;
11
+ + (NSURL *) forRuntime:(NSString *)url;
12
+ + (NSURL *) forValidation:(NSString*)url;
13
+ + (NSURL *) forRuntimeInfo:(NSString*)url;
14
+ + (NSURL *) forPackagerStatus:(NSString*)url port:(int)port;
15
+ + (BOOL) isValid:(NSString*)url;
16
+ @end
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <UIKit/UIKit.h>
5
+
6
+ @interface DevAppMenuUIAlertController : UIAlertController
7
+ @end
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ @protocol JSBundleFileProviderProtocol <NSObject>
6
+
7
+ + (nullable NSURL *)getBundleUrl;
8
+
9
+ @end
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import <UIKit/UIKit.h>
7
+ #import "AppMenuProtocol.h"
8
+ #import "SplashScreenPresenterProtocol.h"
9
+ #import "WarningsFilter.h"
10
+
11
+ @interface MendixApp : NSObject
12
+ @property NSURL * _Nonnull bundleUrl;
13
+ @property NSURL * _Nonnull runtimeUrl;
14
+ @property WarningsFilter warningsFilter;
15
+ @property NSString * _Nullable identifier;
16
+ @property BOOL isDeveloperApp;
17
+ @property BOOL clearDataAtLaunch;
18
+ @property id<AppMenuProtocol> _Nullable appMenu;
19
+ @property id<SplashScreenPresenterProtocol> _Nullable splashScreenPresenter;
20
+ @property UIStoryboard * _Nullable reactLoading;
21
+ @property BOOL enableThreeFingerGestures;
22
+
23
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch splashScreenPresenter:(id<SplashScreenPresenterProtocol> _Nonnull)splashScreenPresenter;
24
+
25
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch reactLoading:(UIStoryboard * _Nonnull)reactLoading;
26
+
27
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch splashScreenPresenter:(id<SplashScreenPresenterProtocol> _Nonnull)splashScreenPresenter enableThreeFingerGestures:(BOOL)enableThreeFingerGestures ;
28
+
29
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch reactLoading:(UIStoryboard * _Nonnull)reactLoading enableThreeFingerGestures:(BOOL)enableThreeFingerGestures;
30
+
31
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch;
32
+
33
+ @end
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import "UnsupportedFeatures.h"
7
+
8
+ extern const UnsupportedFeatures *DEFAULT_UNSUPPORTED_FEATURES;
9
+
10
+ @interface MendixBackwardsCompatUtility: NSObject
11
+ + (NSDictionary<NSString *, UnsupportedFeatures *> *) versionDictionary;
12
+ + (UnsupportedFeatures *) unsupportedFeatures;
13
+ + (void) update:(NSString *)forVersion;
14
+ @end
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright (c) Mendix B.V., Inc. All rights reserved.
3
+ //
4
+
5
+ #import "AppMenuProtocol.h"
6
+ #import "AppPreferences.h"
7
+ #import "AppUrl.h"
8
+ #import "MxConfiguration.h"
9
+ #import "MendixApp.h"
10
+ #import "NativeReloadHandler.h"
11
+ #import "ReactNative.h"
12
+ #import "WarningsFilter.h"
13
+ #import "SplashScreenPresenterProtocol.h"
14
+ #import "MendixReactWindow.h"
15
+ #import "MendixBackwardsCompatUtility.h"
16
+ #import "RuntimeInfoProvider.h"
17
+ #import "NativeDownloadHandler.h"
18
+ #import "DevAppMenuUIAlertController.h"
19
+ #import "JSBundleFileProviderProtocol.h"
20
+ #import "OtaJSBundleFileProvider.h"
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import "UIKit/UIKit.h"
7
+
8
+ @interface MendixReactWindow : UIWindow
9
+
10
+ @end
@@ -0,0 +1,26 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import <React/RCTBridgeModule.h>
7
+ #import "WarningsFilter.h"
8
+
9
+ @interface MxConfiguration : NSObject <RCTBridgeModule>
10
+ + (NSURL *) runtimeUrl;
11
+ + (NSString *) appName;
12
+ + (BOOL) isDeveloperApp;
13
+ + (NSString *) databaseName;
14
+ + (NSString *) filesDirectoryName;
15
+ + (NSString *) codePushKey;
16
+ + (NSString *) appSessionId;
17
+ + (WarningsFilter) warningsFilter;
18
+ + (void) setRuntimeUrl:(NSURL*)value;
19
+ + (void) setAppName:(NSString*)value;
20
+ + (void) setDatabaseName:(NSString*)value;
21
+ + (void) setFilesDirectoryName:(NSString*)value;
22
+ + (void) setWarningsFilter:(WarningsFilter)value;
23
+ + (void) setCodePushKey:(NSString*)value;
24
+ + (void) setIsDeveloperApp:(BOOL)value;
25
+ + (void) setAppSessionId:(NSString*)value;
26
+ @end
@@ -0,0 +1,26 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <React/RCTBridgeModule.h>
5
+ #import <React/RCTEventEmitter.h>
6
+
7
+ @interface NativeDownloadHandler : NSObject<NSURLSessionDelegate>
8
+
9
+ @property (strong, nonnull) NSString *mimeType;
10
+ @property int connectionTimeout;
11
+ @property (copy, nonnull) void (^doneCallback)(void);
12
+ @property (copy, nonnull) void (^progressCallback)(long long, long long);
13
+ @property (copy, nonnull) void (^failCallback)(NSError *_Nullable err);
14
+ @property (strong, nonnull) NSString *downloadPath;
15
+
16
+ - (nonnull id)init:(NSDictionary * _Nullable)config doneCallback:(void (^_Nonnull)(void))doneCallback
17
+ progressCallback:(void (^_Nullable)(long long, long long))progressCallback
18
+ failCallback:(void (^_Nonnull)(NSError *_Nonnull err))failCallback;
19
+
20
+ - (void)download:(NSString *_Nonnull)url downloadPath:(NSString *_Nonnull)downloadPath;
21
+
22
+ @end
23
+
24
+ @interface NativeDownloadModule : RCTEventEmitter<RCTBridgeModule>
25
+
26
+ @end
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <React/RCTBridgeModule.h>
6
+
7
+ @interface NativeOtaModule : NSObject <RCTBridgeModule>
8
+
9
+ + (NSString *)resolveAppVersion;
10
+ + (NSString *)resolveAbsolutePathRelativeToOtaDir:(NSString *)relativePath;
11
+ - (void)deploy:(NSDictionary *)config
12
+ resolver:(RCTPromiseResolveBlock)resolve
13
+ rejecter:(RCTPromiseRejectBlock)reject;
14
+ @end
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import <React/RCTEventEmitter.h>
7
+
8
+ @interface NativeReloadHandler : RCTEventEmitter<RCTBridgeModule>
9
+ - (void) reloadClientWithState;
10
+ - (void) reload;
11
+ - (void) exitApp;
12
+ @end
@@ -0,0 +1,35 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <Foundation/Foundation.h>
5
+
6
+ #pragma mark - Paths
7
+
8
+ extern NSString *const MANIFEST_FILE_NAME;
9
+ extern NSString *const OTA_DIR_NAME;
10
+
11
+ #pragma mark - ErrorCodes
12
+
13
+ extern NSString *const INVALID_RUNTIME_URL;
14
+ extern NSString *const INVALID_DEPLOY_CONFIG;
15
+ extern NSString *const OTA_ZIP_FILE_MISSING;
16
+ extern NSString *const OTA_UNZIP_DIR_EXISTS;
17
+ extern NSString *const OTA_DEPLOYMENT_FAILED;
18
+ extern NSString *const INVALID_DOWNLOAD_CONFIG;
19
+ extern NSString *const OTA_DOWNLOAD_FAILED;
20
+
21
+ #pragma mark - Download Config Keys
22
+
23
+ extern NSString *const DOWNLOAD_CONFIG_URL_KEY;
24
+
25
+ #pragma mark - Deploy Config Keys
26
+
27
+ extern NSString *const DEPLOY_CONFIG_OTA_PACKAGE_KEY;
28
+ extern NSString *const DEPLOY_CONFIG_EXTRACTION_DIR;
29
+ extern NSString *const DEPLOY_CONFIG_OTA_DEPLOYMENT_ID_KEY;
30
+
31
+ #pragma mark - Manifest Keys
32
+
33
+ extern NSString *const MANIFEST_OTA_DEPLOYMENT_ID_KEY;
34
+ extern NSString *const MANIFEST_RELATIVE_BUNDLE_PATH_KEY;
35
+ extern NSString *const MANIFEST_APP_VERSION_KEY;
@@ -0,0 +1,13 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <Foundation/Foundation.h>
5
+
6
+ @interface OtaHelpers : NSObject
7
+ + (NSString *)resolveAppVersion;
8
+ + (NSString *)getOtaDir;
9
+ + (NSString *)getOtaManifestFilepath;
10
+ + (NSString *)resolveAbsolutePathRelativeToOtaDir:(NSString *)relativePath;
11
+ + (NSDictionary *)readManifestAsDictionary;
12
+ + (NSDictionary *)getNativeDependencies;
13
+ @end
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <Foundation/Foundation.h>
5
+ #import <React/RCTBridgeModule.h>
6
+ #import "JSBundleFileProviderProtocol.h"
7
+
8
+ @interface OtaJSBundleFileProvider : NSObject<JSBundleFileProviderProtocol>
9
+ +(nullable NSURL *)getBundleUrl;
10
+ @end
@@ -0,0 +1,54 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import <UIKit/UIKit.h>
7
+ #import <React/RCTBridge.h>
8
+ #import <React/RCTBridgeDelegate.h>
9
+ #import <React/RCTReloadCommand.h>
10
+ #import "MendixApp.h"
11
+
12
+ @protocol ReactNativeDelegate;
13
+ @interface ReactNative: NSObject<RCTBridgeDelegate, RCTReloadListener> {
14
+ RCTBridge *bridge;
15
+ UIWindow *rootWindow;
16
+ UIWindow *appWindow;
17
+ MendixApp *mendixApp;
18
+ NSURL *bundleUrl;
19
+ NSString *codePushKey;
20
+ NSDictionary *launchOptions;
21
+ BOOL mendixOTAEnabled;
22
+ }
23
+
24
+ @property(nonatomic, weak) id<ReactNativeDelegate> delegate;
25
+ @property(class, nonatomic, readonly) ReactNative *instance;
26
+
27
+ + (void) clearKeychain;
28
+ + (NSString *) warningsFilterToString:(WarningsFilter)warningsFilter;
29
+ - (void) setup:(MendixApp *)mendixApp launchOptions:(NSDictionary *)launchOptions;
30
+ - (void) setup:(MendixApp *)mendixApp launchOptions:(NSDictionary *)launchOptions mendixOTAEnabled:(BOOL)mendixOTAEnabled;
31
+ - (void) start;
32
+ - (BOOL) isActive;
33
+ - (NSURL *) getJSBundleFile;
34
+ - (BOOL) useCodePush;
35
+ - (void) showAppMenu;
36
+ - (void) showSplashScreen;
37
+ - (void) hideSplashScreen;
38
+ - (void) toggleElementInspector;
39
+ - (RCTBridge *) getBridge;
40
+ - (UIView * _Nullable) getRootView;
41
+ - (void) clearData;
42
+ - (void) clearAsyncStorage;
43
+ - (void) clearCookies;
44
+ - (void) stop;
45
+ - (void) reload;
46
+ - (BOOL) isDebuggingRemotely;
47
+ - (void) remoteDebugging:(BOOL)enable;
48
+ - (void) setRemoteDebuggingPackagerPort:(NSInteger)port;
49
+
50
+ @end
51
+
52
+ @protocol ReactNativeDelegate
53
+ - (void) onAppClosed;
54
+ @end
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @interface RuntimeInfo: NSObject
8
+ @property (nonatomic, copy, readonly) NSString *cacheburst;
9
+ @property (nonatomic, readonly) long nativeBinaryVersion;
10
+ @property (nonatomic, readonly) long packagerPort;
11
+ @property (nonatomic, copy, readonly) NSString *version;
12
+
13
+ - (instancetype) initWithVersion:(NSString *)version cacheburst:(NSString *)cacheburst nativeBinaryVersion:(long)nativeBinaryVersion packagerPort:(long)packagerPort;
14
+ @end
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import "RuntimeInfoResponse.h"
7
+
8
+ @interface RuntimeInfoProvider: NSObject
9
+ + (void) getRuntimeInfo:(NSURL*) runtimeURL completionHandler:(void (^)(RuntimeInfoResponse *response))completionHandler;
10
+ @end
@@ -0,0 +1,13 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import "RuntimeInfo.h"
7
+
8
+ @interface RuntimeInfoResponse : NSObject
9
+ @property (nonatomic, copy, readonly) NSString *status;
10
+ @property (nonatomic, copy, readonly) RuntimeInfo *runtimeInfo;
11
+
12
+ - (instancetype) initWithStatus:(NSString *)status runtimeInfo:(RuntimeInfo *)runtimeInfo;
13
+ @end
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <UIKit/UIKit.h>
6
+
7
+ @protocol SplashScreenPresenterProtocol
8
+ - (void) show:(UIView * _Nullable)rootView;
9
+ - (void) hide;
10
+ @end
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @interface UnsupportedFeatures: NSObject
8
+ @property BOOL reloadInClient;
9
+ @property BOOL hideSplashScreenInClient;
10
+ - (id _Nonnull)init:(BOOL)reloadInClient;
11
+ - (id _Nonnull)init:(BOOL)reloadInClient hideSplashScreenInClient:(BOOL)hideSplashScreenInClient;
12
+ @end
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ typedef NS_ENUM(NSInteger, WarningsFilter) {
8
+ all,
9
+ partial,
10
+ none
11
+ };
12
+ extern NSString * const WarningsFilter_toString[];
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @protocol AppMenuProtocol
8
+ @required
9
+ -(void) show:(BOOL)devMode;
10
+ @end
@@ -0,0 +1,18 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @interface AppPreferences : NSObject
8
+ + (NSString *) getAppUrl;
9
+ + (void) setAppUrl:(NSString *)url;
10
+ + (BOOL) devModeEnabled;
11
+ + (void) devMode:(BOOL)enable;
12
+ + (BOOL) remoteDebuggingEnabled;
13
+ + (void) remoteDebugging:(BOOL)enable;
14
+ + (void) setRemoteDebuggingPackagerPort:(NSInteger)port;
15
+ + (int) getRemoteDebuggingPackagerPort;
16
+ + (BOOL) isElementInspectorEnabled;
17
+ + (void) setElementInspector:(BOOL)enable;
18
+ @end
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @interface AppUrl: NSObject
8
+ + (int) defaultPackagerPort;
9
+
10
+ + (NSURL *) forBundle:(NSString *)url port:(int)port isDebuggingRemotely:(BOOL)isDebuggingRemotely isDevModeEnabled:(BOOL)isDevModeEnabled;
11
+ + (NSURL *) forRuntime:(NSString *)url;
12
+ + (NSURL *) forValidation:(NSString*)url;
13
+ + (NSURL *) forRuntimeInfo:(NSString*)url;
14
+ + (NSURL *) forPackagerStatus:(NSString*)url port:(int)port;
15
+ + (BOOL) isValid:(NSString*)url;
16
+ @end
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <UIKit/UIKit.h>
5
+
6
+ @interface DevAppMenuUIAlertController : UIAlertController
7
+ @end
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ @protocol JSBundleFileProviderProtocol <NSObject>
6
+
7
+ + (nullable NSURL *)getBundleUrl;
8
+
9
+ @end
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import <UIKit/UIKit.h>
7
+ #import "AppMenuProtocol.h"
8
+ #import "SplashScreenPresenterProtocol.h"
9
+ #import "WarningsFilter.h"
10
+
11
+ @interface MendixApp : NSObject
12
+ @property NSURL * _Nonnull bundleUrl;
13
+ @property NSURL * _Nonnull runtimeUrl;
14
+ @property WarningsFilter warningsFilter;
15
+ @property NSString * _Nullable identifier;
16
+ @property BOOL isDeveloperApp;
17
+ @property BOOL clearDataAtLaunch;
18
+ @property id<AppMenuProtocol> _Nullable appMenu;
19
+ @property id<SplashScreenPresenterProtocol> _Nullable splashScreenPresenter;
20
+ @property UIStoryboard * _Nullable reactLoading;
21
+ @property BOOL enableThreeFingerGestures;
22
+
23
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch splashScreenPresenter:(id<SplashScreenPresenterProtocol> _Nonnull)splashScreenPresenter;
24
+
25
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch reactLoading:(UIStoryboard * _Nonnull)reactLoading;
26
+
27
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch splashScreenPresenter:(id<SplashScreenPresenterProtocol> _Nonnull)splashScreenPresenter enableThreeFingerGestures:(BOOL)enableThreeFingerGestures ;
28
+
29
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch reactLoading:(UIStoryboard * _Nonnull)reactLoading enableThreeFingerGestures:(BOOL)enableThreeFingerGestures;
30
+
31
+ -(id _Nonnull)init:(NSString * _Nullable)identifier bundleUrl:(NSURL * _Nonnull)bundleUrl runtimeUrl:(NSURL * _Nonnull)runtimeUrl warningsFilter:(WarningsFilter)warningsFilter isDeveloperApp:(BOOL)enableGestures clearDataAtLaunch:(BOOL)clearDataAtLaunch;
32
+
33
+ @end
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import "UnsupportedFeatures.h"
7
+
8
+ extern const UnsupportedFeatures *DEFAULT_UNSUPPORTED_FEATURES;
9
+
10
+ @interface MendixBackwardsCompatUtility: NSObject
11
+ + (NSDictionary<NSString *, UnsupportedFeatures *> *) versionDictionary;
12
+ + (UnsupportedFeatures *) unsupportedFeatures;
13
+ + (void) update:(NSString *)forVersion;
14
+ @end
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright (c) Mendix B.V., Inc. All rights reserved.
3
+ //
4
+
5
+ #import "AppMenuProtocol.h"
6
+ #import "AppPreferences.h"
7
+ #import "AppUrl.h"
8
+ #import "MxConfiguration.h"
9
+ #import "MendixApp.h"
10
+ #import "NativeReloadHandler.h"
11
+ #import "ReactNative.h"
12
+ #import "WarningsFilter.h"
13
+ #import "SplashScreenPresenterProtocol.h"
14
+ #import "MendixReactWindow.h"
15
+ #import "MendixBackwardsCompatUtility.h"
16
+ #import "RuntimeInfoProvider.h"
17
+ #import "NativeDownloadHandler.h"
18
+ #import "DevAppMenuUIAlertController.h"
19
+ #import "JSBundleFileProviderProtocol.h"
20
+ #import "OtaJSBundleFileProvider.h"
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import "UIKit/UIKit.h"
7
+
8
+ @interface MendixReactWindow : UIWindow
9
+
10
+ @end
@@ -0,0 +1,26 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import <React/RCTBridgeModule.h>
7
+ #import "WarningsFilter.h"
8
+
9
+ @interface MxConfiguration : NSObject <RCTBridgeModule>
10
+ + (NSURL *) runtimeUrl;
11
+ + (NSString *) appName;
12
+ + (BOOL) isDeveloperApp;
13
+ + (NSString *) databaseName;
14
+ + (NSString *) filesDirectoryName;
15
+ + (NSString *) codePushKey;
16
+ + (NSString *) appSessionId;
17
+ + (WarningsFilter) warningsFilter;
18
+ + (void) setRuntimeUrl:(NSURL*)value;
19
+ + (void) setAppName:(NSString*)value;
20
+ + (void) setDatabaseName:(NSString*)value;
21
+ + (void) setFilesDirectoryName:(NSString*)value;
22
+ + (void) setWarningsFilter:(WarningsFilter)value;
23
+ + (void) setCodePushKey:(NSString*)value;
24
+ + (void) setIsDeveloperApp:(BOOL)value;
25
+ + (void) setAppSessionId:(NSString*)value;
26
+ @end
@@ -0,0 +1,26 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <React/RCTBridgeModule.h>
5
+ #import <React/RCTEventEmitter.h>
6
+
7
+ @interface NativeDownloadHandler : NSObject<NSURLSessionDelegate>
8
+
9
+ @property (strong, nonnull) NSString *mimeType;
10
+ @property int connectionTimeout;
11
+ @property (copy, nonnull) void (^doneCallback)(void);
12
+ @property (copy, nonnull) void (^progressCallback)(long long, long long);
13
+ @property (copy, nonnull) void (^failCallback)(NSError *_Nullable err);
14
+ @property (strong, nonnull) NSString *downloadPath;
15
+
16
+ - (nonnull id)init:(NSDictionary * _Nullable)config doneCallback:(void (^_Nonnull)(void))doneCallback
17
+ progressCallback:(void (^_Nullable)(long long, long long))progressCallback
18
+ failCallback:(void (^_Nonnull)(NSError *_Nonnull err))failCallback;
19
+
20
+ - (void)download:(NSString *_Nonnull)url downloadPath:(NSString *_Nonnull)downloadPath;
21
+
22
+ @end
23
+
24
+ @interface NativeDownloadModule : RCTEventEmitter<RCTBridgeModule>
25
+
26
+ @end
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <React/RCTBridgeModule.h>
6
+
7
+ @interface NativeOtaModule : NSObject <RCTBridgeModule>
8
+
9
+ + (NSString *)resolveAppVersion;
10
+ + (NSString *)resolveAbsolutePathRelativeToOtaDir:(NSString *)relativePath;
11
+ - (void)deploy:(NSDictionary *)config
12
+ resolver:(RCTPromiseResolveBlock)resolve
13
+ rejecter:(RCTPromiseRejectBlock)reject;
14
+ @end
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import <React/RCTEventEmitter.h>
7
+
8
+ @interface NativeReloadHandler : RCTEventEmitter<RCTBridgeModule>
9
+ - (void) reloadClientWithState;
10
+ - (void) reload;
11
+ - (void) exitApp;
12
+ @end
@@ -0,0 +1,35 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <Foundation/Foundation.h>
5
+
6
+ #pragma mark - Paths
7
+
8
+ extern NSString *const MANIFEST_FILE_NAME;
9
+ extern NSString *const OTA_DIR_NAME;
10
+
11
+ #pragma mark - ErrorCodes
12
+
13
+ extern NSString *const INVALID_RUNTIME_URL;
14
+ extern NSString *const INVALID_DEPLOY_CONFIG;
15
+ extern NSString *const OTA_ZIP_FILE_MISSING;
16
+ extern NSString *const OTA_UNZIP_DIR_EXISTS;
17
+ extern NSString *const OTA_DEPLOYMENT_FAILED;
18
+ extern NSString *const INVALID_DOWNLOAD_CONFIG;
19
+ extern NSString *const OTA_DOWNLOAD_FAILED;
20
+
21
+ #pragma mark - Download Config Keys
22
+
23
+ extern NSString *const DOWNLOAD_CONFIG_URL_KEY;
24
+
25
+ #pragma mark - Deploy Config Keys
26
+
27
+ extern NSString *const DEPLOY_CONFIG_OTA_PACKAGE_KEY;
28
+ extern NSString *const DEPLOY_CONFIG_EXTRACTION_DIR;
29
+ extern NSString *const DEPLOY_CONFIG_OTA_DEPLOYMENT_ID_KEY;
30
+
31
+ #pragma mark - Manifest Keys
32
+
33
+ extern NSString *const MANIFEST_OTA_DEPLOYMENT_ID_KEY;
34
+ extern NSString *const MANIFEST_RELATIVE_BUNDLE_PATH_KEY;
35
+ extern NSString *const MANIFEST_APP_VERSION_KEY;
@@ -0,0 +1,13 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <Foundation/Foundation.h>
5
+
6
+ @interface OtaHelpers : NSObject
7
+ + (NSString *)resolveAppVersion;
8
+ + (NSString *)getOtaDir;
9
+ + (NSString *)getOtaManifestFilepath;
10
+ + (NSString *)resolveAbsolutePathRelativeToOtaDir:(NSString *)relativePath;
11
+ + (NSDictionary *)readManifestAsDictionary;
12
+ + (NSDictionary *)getNativeDependencies;
13
+ @end
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+ #import <Foundation/Foundation.h>
5
+ #import <React/RCTBridgeModule.h>
6
+ #import "JSBundleFileProviderProtocol.h"
7
+
8
+ @interface OtaJSBundleFileProvider : NSObject<JSBundleFileProviderProtocol>
9
+ +(nullable NSURL *)getBundleUrl;
10
+ @end
@@ -0,0 +1,54 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import <UIKit/UIKit.h>
7
+ #import <React/RCTBridge.h>
8
+ #import <React/RCTBridgeDelegate.h>
9
+ #import <React/RCTReloadCommand.h>
10
+ #import "MendixApp.h"
11
+
12
+ @protocol ReactNativeDelegate;
13
+ @interface ReactNative: NSObject<RCTBridgeDelegate, RCTReloadListener> {
14
+ RCTBridge *bridge;
15
+ UIWindow *rootWindow;
16
+ UIWindow *appWindow;
17
+ MendixApp *mendixApp;
18
+ NSURL *bundleUrl;
19
+ NSString *codePushKey;
20
+ NSDictionary *launchOptions;
21
+ BOOL mendixOTAEnabled;
22
+ }
23
+
24
+ @property(nonatomic, weak) id<ReactNativeDelegate> delegate;
25
+ @property(class, nonatomic, readonly) ReactNative *instance;
26
+
27
+ + (void) clearKeychain;
28
+ + (NSString *) warningsFilterToString:(WarningsFilter)warningsFilter;
29
+ - (void) setup:(MendixApp *)mendixApp launchOptions:(NSDictionary *)launchOptions;
30
+ - (void) setup:(MendixApp *)mendixApp launchOptions:(NSDictionary *)launchOptions mendixOTAEnabled:(BOOL)mendixOTAEnabled;
31
+ - (void) start;
32
+ - (BOOL) isActive;
33
+ - (NSURL *) getJSBundleFile;
34
+ - (BOOL) useCodePush;
35
+ - (void) showAppMenu;
36
+ - (void) showSplashScreen;
37
+ - (void) hideSplashScreen;
38
+ - (void) toggleElementInspector;
39
+ - (RCTBridge *) getBridge;
40
+ - (UIView * _Nullable) getRootView;
41
+ - (void) clearData;
42
+ - (void) clearAsyncStorage;
43
+ - (void) clearCookies;
44
+ - (void) stop;
45
+ - (void) reload;
46
+ - (BOOL) isDebuggingRemotely;
47
+ - (void) remoteDebugging:(BOOL)enable;
48
+ - (void) setRemoteDebuggingPackagerPort:(NSInteger)port;
49
+
50
+ @end
51
+
52
+ @protocol ReactNativeDelegate
53
+ - (void) onAppClosed;
54
+ @end
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @interface RuntimeInfo: NSObject
8
+ @property (nonatomic, copy, readonly) NSString *cacheburst;
9
+ @property (nonatomic, readonly) long nativeBinaryVersion;
10
+ @property (nonatomic, readonly) long packagerPort;
11
+ @property (nonatomic, copy, readonly) NSString *version;
12
+
13
+ - (instancetype) initWithVersion:(NSString *)version cacheburst:(NSString *)cacheburst nativeBinaryVersion:(long)nativeBinaryVersion packagerPort:(long)packagerPort;
14
+ @end
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import "RuntimeInfoResponse.h"
7
+
8
+ @interface RuntimeInfoProvider: NSObject
9
+ + (void) getRuntimeInfo:(NSURL*) runtimeURL completionHandler:(void (^)(RuntimeInfoResponse *response))completionHandler;
10
+ @end
@@ -0,0 +1,13 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+ #import "RuntimeInfo.h"
7
+
8
+ @interface RuntimeInfoResponse : NSObject
9
+ @property (nonatomic, copy, readonly) NSString *status;
10
+ @property (nonatomic, copy, readonly) RuntimeInfo *runtimeInfo;
11
+
12
+ - (instancetype) initWithStatus:(NSString *)status runtimeInfo:(RuntimeInfo *)runtimeInfo;
13
+ @end
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <UIKit/UIKit.h>
6
+
7
+ @protocol SplashScreenPresenterProtocol
8
+ - (void) show:(UIView * _Nullable)rootView;
9
+ - (void) hide;
10
+ @end
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ @interface UnsupportedFeatures: NSObject
8
+ @property BOOL reloadInClient;
9
+ @property BOOL hideSplashScreenInClient;
10
+ - (id _Nonnull)init:(BOOL)reloadInClient;
11
+ - (id _Nonnull)init:(BOOL)reloadInClient hideSplashScreenInClient:(BOOL)hideSplashScreenInClient;
12
+ @end
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright (c) Mendix, Inc. All rights reserved.
3
+ //
4
+
5
+ #import <Foundation/Foundation.h>
6
+
7
+ typedef NS_ENUM(NSInteger, WarningsFilter) {
8
+ all,
9
+ partial,
10
+ none
11
+ };
12
+ extern NSString * const WarningsFilter_toString[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendix/native",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.2",
4
4
  "copyright": "© Mendix Technology BV. All rights reserved.",
5
5
  "files": [
6
6
  "android/",