reactnative-plugin-appice 1.4.0 → 1.4.3
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.
- package/README.md +1 -59
- package/android/build.gradle +14 -54
- package/android/libs/logutility.jar +0 -0
- package/android/local.properties +2 -2
- package/android/src/main/AndroidManifest.xml +21 -124
- package/android/src/main/java/com/reactlibrary/AppICEUtils.java +38 -0
- package/android/src/main/java/com/reactlibrary/AppIceReactPluginModule.java +330 -78
- package/android/src/main/java/com/reactlibrary/CampaignCampsReceiver.java +20 -3
- package/android/src/main/java/com/reactlibrary/InAppWebView.java +68 -0
- package/android/src/main/java/com/reactlibrary/NotificationEventService.java +0 -0
- package/android/src/main/java/com/reactlibrary/React-Native workspace.code-workspace +29 -0
- package/example/App.js +126 -0
- package/example/Gemfile +6 -0
- package/example/__tests__/App-test.js +14 -0
- package/example/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
- package/{android/.gradle/5.4.1/fileHashes/fileHashes.bin → example/android/.gradle/7.3.3/checksums/md5-checksums.bin} +0 -0
- package/example/android/.gradle/7.3.3/checksums/sha1-checksums.bin +0 -0
- package/example/android/.gradle/7.3.3/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/{android/.gradle/5.4.1 → example/android/.gradle/7.3.3/dependencies-accessors}/gc.properties +0 -0
- package/example/android/.gradle/7.3.3/executionHistory/executionHistory.lock +0 -0
- package/{android/.gradle/5.4.1 → example/android/.gradle/7.3.3}/fileChanges/last-build.bin +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/fileHashes.bin +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/resourceHashesCache.bin +0 -0
- package/{android/.gradle/vcs-1 → example/android/.gradle/7.3.3}/gc.properties +0 -0
- package/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/example/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/example/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/example/android/.gradle/vcs-1/gc.properties +0 -0
- package/example/android/.idea/.name +1 -0
- package/example/android/.idea/compiler.xml +6 -0
- package/example/android/.idea/gradle.xml +34 -0
- package/example/android/.idea/jarRepositories.xml +55 -0
- package/example/android/.idea/misc.xml +10 -0
- package/example/android/.idea/vcs.xml +6 -0
- package/example/android/app/_BUCK +55 -0
- package/example/android/app/build.gradle +321 -0
- package/example/android/app/build_defs.bzl +19 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/google-services.json +275 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/debug/AndroidManifest.xml +13 -0
- package/example/android/app/src/debug/java/com/example/ReactNativeFlipper.java +73 -0
- package/example/android/app/src/main/AndroidManifest.xml +72 -0
- package/example/android/app/src/main/java/com/example/MainActivity.java +48 -0
- package/example/android/app/src/main/java/com/example/MainApplication.java +91 -0
- package/example/android/app/src/main/java/com/example/newarchitecture/MainApplicationReactNativeHost.java +116 -0
- package/example/android/app/src/main/java/com/example/newarchitecture/components/MainComponentsRegistry.java +36 -0
- package/example/android/app/src/main/java/com/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -0
- package/example/android/app/src/main/jni/Android.mk +48 -0
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +24 -0
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
- package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +61 -0
- package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
- package/example/android/app/src/main/jni/OnLoad.cpp +11 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/build.gradle +54 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/example/android/gradle.properties +40 -0
- package/example/android/gradlew +234 -0
- package/example/android/gradlew.bat +89 -0
- package/example/android/local.properties +8 -0
- package/example/android/settings.gradle +11 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +3 -0
- package/example/index.js +9 -0
- package/example/ios/Podfile +44 -0
- package/example/ios/Podfile.lock +561 -0
- package/example/ios/_xcode.env +11 -0
- package/example/ios/example/AppDelegate.h +8 -0
- package/example/ios/example/AppDelegate.mm +174 -0
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/example/Images.xcassets/Contents.json +6 -0
- package/example/ios/example/Info.plist +62 -0
- package/example/ios/example/LaunchScreen.storyboard +47 -0
- package/example/ios/example/example.entitlements +8 -0
- package/example/ios/example/main.m +10 -0
- package/example/ios/example.xcodeproj/project.pbxproj +712 -0
- package/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +88 -0
- package/example/ios/example.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/example/ios/exampleTests/Info.plist +24 -0
- package/example/ios/exampleTests/exampleTests.m +66 -0
- package/example/metro.config.js +17 -0
- package/example/package-lock.json +22484 -0
- package/example/package.json +34 -0
- package/example/yarn.lock +7604 -0
- package/index.js +107 -3
- package/ios/AppICEReactEvent.h +22 -0
- package/ios/AppICEReactEvent.m +65 -0
- package/ios/AppICESDK/appICE.momd/VersionInfo.plist +0 -0
- package/ios/AppICESDK/appICE.momd/appICE 4.mom +0 -0
- package/ios/AppICESDK/appICE.momd/appICE 4.omo +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/APPChildViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfFooterNOTINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfHeaderINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/objects-11.0+.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/runtime.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/Info.plist +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/RatingViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/SurveyViewController.nib +0 -0
- package/ios/AppICESDK/include/iosAppiceSDK/AppICEHelper.h +77 -0
- package/ios/AppICESDK/include/iosAppiceSDK/AppICEInboxMessage.h +1 -0
- package/ios/AppICESDK/include/iosAppiceSDK/AppICEJSInterface.h +21 -0
- package/ios/AppICESDK/include/iosAppiceSDK/appICE.h +68 -22
- package/ios/AppICESDK/include/iosAppiceSDK/appICEUserDetails.h +6 -0
- package/ios/AppICESDK/include/iosAppiceSDK/isrgrootx1.der +0 -0
- package/ios/AppICESDK/include/iosAppiceSDK/lets-encrypt-r3.der +0 -0
- package/ios/AppICESDK/{libiosAppiceSDK_v1.7.15.a → libiosAppiceSDK_v1.7.37.a} +0 -0
- package/ios/AppIceReactPlugin.h +16 -2
- package/ios/AppIceReactPlugin.m +96 -13
- package/ios/AppIceReactPlugin.xcodeproj/project.pbxproj +67 -55
- package/package.json +3 -2
- package/android/.gradle/5.4.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/5.4.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/5.4.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.idea/caches/build_file_checksums.ser +0 -0
- package/android/.idea/caches/gradle_models.ser +0 -0
- package/android/.idea/codeStyles/Project.xml +0 -116
- package/android/.idea/dictionaries/Adi.xml +0 -3
- package/android/.idea/gradle.xml +0 -16
- package/android/.idea/libraries/Gradle____local_aars____Users_Adi_ReactModule_AppICEReactLibrary_android_libs_AppICE_SDK_v2_4_18_jar_unspecified_jar.xml +0 -9
- package/android/.idea/libraries/Gradle____local_aars____Users_Adi_ReactModule_AppICEReactLibrary_android_libs_logutility_jar_unspecified_jar.xml +0 -9
- package/android/.idea/libraries/Gradle__android_arch_core_common_1_0_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_0_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_23_0_1_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_android_support_customtabs_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_recyclerview_v7_23_0_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_annotations_23_0_1_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_android_support_support_annotations_26_1_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_android_support_support_compat_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_core_ui_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_core_utils_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_fragment_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_media_compat_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_v4_23_0_1_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_android_support_support_v4_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_20_1_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_2_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_okhttp_1_2_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_2_3_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_base_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_identifier_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_lite_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_base_16_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_basement_16_2_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_gass_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_location_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_api_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_base_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_impl_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_sdk_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_sdk_api_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_places_placereport_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_stats_16_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_tasks_16_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_auto_value_auto_value_annotations_1_6_3_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_analytics_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_common_17_0_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_core_16_0_9_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_iid_18_0_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_iid_interop_16_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_measurement_connector_17_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_messaging_18_0_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_nineoldandroids_library_2_4_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_parse_bolts_bolts_android_1_1_4_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_2_5_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_ws_2_5_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_6_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__commons_cli_commons_cli_1_2_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__org_webkit_android_jsc_r174650_aar.xml +0 -10
- package/android/.idea/misc.xml +0 -23
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/runConfigurations.xml +0 -12
- package/android/.idea/workspace.xml +0 -322
- package/android/libs/AppICE_SDK_v2.4.18.jar +0 -0
- package/ios/.DS_Store +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib +0 -0
- package/ios/AppICESDK/include/iosAppiceSDK/appICEDB.h +0 -52
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
+
* directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
package com.example;
|
|
8
|
+
|
|
9
|
+
import android.content.Context;
|
|
10
|
+
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
+
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
+
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
+
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
+
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
+
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
+
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
+
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
+
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
+
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
+
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
|
|
21
|
+
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
22
|
+
import com.facebook.react.ReactInstanceEventListener;
|
|
23
|
+
import com.facebook.react.ReactInstanceManager;
|
|
24
|
+
import com.facebook.react.bridge.ReactContext;
|
|
25
|
+
import com.facebook.react.modules.network.NetworkingModule;
|
|
26
|
+
import okhttp3.OkHttpClient;
|
|
27
|
+
|
|
28
|
+
public class ReactNativeFlipper {
|
|
29
|
+
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
30
|
+
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
31
|
+
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
32
|
+
|
|
33
|
+
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
34
|
+
client.addPlugin(new ReactFlipperPlugin());
|
|
35
|
+
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
36
|
+
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
37
|
+
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
38
|
+
|
|
39
|
+
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
40
|
+
NetworkingModule.setCustomClientBuilder(
|
|
41
|
+
new NetworkingModule.CustomClientBuilder() {
|
|
42
|
+
@Override
|
|
43
|
+
public void apply(OkHttpClient.Builder builder) {
|
|
44
|
+
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
client.addPlugin(networkFlipperPlugin);
|
|
48
|
+
client.start();
|
|
49
|
+
|
|
50
|
+
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
51
|
+
// Hence we run if after all native modules have been initialized
|
|
52
|
+
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
53
|
+
if (reactContext == null) {
|
|
54
|
+
reactInstanceManager.addReactInstanceEventListener(
|
|
55
|
+
new ReactInstanceEventListener() {
|
|
56
|
+
@Override
|
|
57
|
+
public void onReactContextInitialized(ReactContext reactContext) {
|
|
58
|
+
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
59
|
+
reactContext.runOnNativeModulesQueueThread(
|
|
60
|
+
new Runnable() {
|
|
61
|
+
@Override
|
|
62
|
+
public void run() {
|
|
63
|
+
client.addPlugin(new FrescoFlipperPlugin());
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
client.addPlugin(new FrescoFlipperPlugin());
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
package="com.example">
|
|
3
|
+
|
|
4
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
+
|
|
6
|
+
<application
|
|
7
|
+
android:name=".MainApplication"
|
|
8
|
+
android:label="@string/app_name"
|
|
9
|
+
android:icon="@mipmap/ic_launcher"
|
|
10
|
+
android:roundIcon="@mipmap/ic_launcher_round"
|
|
11
|
+
android:allowBackup="false"
|
|
12
|
+
android:theme="@style/AppTheme">
|
|
13
|
+
<activity
|
|
14
|
+
android:name=".MainActivity"
|
|
15
|
+
android:label="@string/app_name"
|
|
16
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
17
|
+
android:launchMode="singleTask"
|
|
18
|
+
android:windowSoftInputMode="adjustResize"
|
|
19
|
+
android:exported="true">
|
|
20
|
+
<intent-filter>
|
|
21
|
+
<action android:name="android.intent.action.MAIN" />
|
|
22
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
23
|
+
</intent-filter>
|
|
24
|
+
</activity>
|
|
25
|
+
|
|
26
|
+
<service
|
|
27
|
+
android:name="semusi.ruleengine.pushmanager.SdkFcmListenerService"
|
|
28
|
+
android:protectionLevel="signature"
|
|
29
|
+
android:exported="true">
|
|
30
|
+
<intent-filter>
|
|
31
|
+
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
|
32
|
+
</intent-filter>
|
|
33
|
+
</service>
|
|
34
|
+
|
|
35
|
+
<receiver
|
|
36
|
+
android:name="semusi.context.counthandler.NotificationEventReceiver"
|
|
37
|
+
android:exported="true"
|
|
38
|
+
android:protectionLevel="signature" />
|
|
39
|
+
|
|
40
|
+
<activity android:name="semusi.context.ui.AppICENotifUI"
|
|
41
|
+
android:exported="true">
|
|
42
|
+
|
|
43
|
+
<intent-filter>
|
|
44
|
+
<action android:name="android.intent.action.VIEW"/>
|
|
45
|
+
|
|
46
|
+
<category android:name="android.intent.category.DEFAULT"/>
|
|
47
|
+
<category android:name="android.intent.category.BROWSABLE"/>
|
|
48
|
+
|
|
49
|
+
<data
|
|
50
|
+
android:host="ai.io"
|
|
51
|
+
android:scheme="https"/>
|
|
52
|
+
</intent-filter>
|
|
53
|
+
</activity>
|
|
54
|
+
|
|
55
|
+
<receiver
|
|
56
|
+
android:name="com.reactlibrary.CampaignCampsReceiver"
|
|
57
|
+
android:protectionLevel="signature"
|
|
58
|
+
android:exported="true">
|
|
59
|
+
<intent-filter>
|
|
60
|
+
<action android:name="com.appice.campaignEvent" />
|
|
61
|
+
</intent-filter>
|
|
62
|
+
</receiver>
|
|
63
|
+
<service
|
|
64
|
+
android:name="com.reactlibrary.NotificationEventService"
|
|
65
|
+
android:permission="android.permission.BIND_JOB_SERVICE"
|
|
66
|
+
android:exported="true">
|
|
67
|
+
<intent-filter>
|
|
68
|
+
<action android:name="com.appice.campaignEvent" />
|
|
69
|
+
</intent-filter>
|
|
70
|
+
</service>
|
|
71
|
+
</application>
|
|
72
|
+
</manifest>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package com.example;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactActivity;
|
|
4
|
+
import com.facebook.react.ReactActivityDelegate;
|
|
5
|
+
import com.facebook.react.ReactRootView;
|
|
6
|
+
|
|
7
|
+
public class MainActivity extends ReactActivity {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
11
|
+
* rendering of the component.
|
|
12
|
+
*/
|
|
13
|
+
@Override
|
|
14
|
+
protected String getMainComponentName() {
|
|
15
|
+
return "example";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
|
|
20
|
+
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
|
|
21
|
+
* (Paper).
|
|
22
|
+
*/
|
|
23
|
+
@Override
|
|
24
|
+
protected ReactActivityDelegate createReactActivityDelegate() {
|
|
25
|
+
return new MainActivityDelegate(this, getMainComponentName());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static class MainActivityDelegate extends ReactActivityDelegate {
|
|
29
|
+
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
|
|
30
|
+
super(activity, mainComponentName);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
protected ReactRootView createRootView() {
|
|
35
|
+
ReactRootView reactRootView = new ReactRootView(getContext());
|
|
36
|
+
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
|
37
|
+
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
|
|
38
|
+
return reactRootView;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Override
|
|
42
|
+
protected boolean isConcurrentRootEnabled() {
|
|
43
|
+
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
|
|
44
|
+
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
45
|
+
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
package com.example;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import com.facebook.react.PackageList;
|
|
6
|
+
import com.facebook.react.ReactApplication;
|
|
7
|
+
import com.facebook.react.ReactInstanceManager;
|
|
8
|
+
import com.facebook.react.ReactNativeHost;
|
|
9
|
+
import com.facebook.react.ReactPackage;
|
|
10
|
+
import com.facebook.react.config.ReactFeatureFlags;
|
|
11
|
+
import com.facebook.soloader.SoLoader;
|
|
12
|
+
import com.example.newarchitecture.MainApplicationReactNativeHost;
|
|
13
|
+
import java.lang.reflect.InvocationTargetException;
|
|
14
|
+
import java.util.List;
|
|
15
|
+
|
|
16
|
+
public class MainApplication extends Application implements ReactApplication {
|
|
17
|
+
|
|
18
|
+
private final ReactNativeHost mReactNativeHost =
|
|
19
|
+
new ReactNativeHost(this) {
|
|
20
|
+
@Override
|
|
21
|
+
public boolean getUseDeveloperSupport() {
|
|
22
|
+
return BuildConfig.DEBUG;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Override
|
|
26
|
+
protected List<ReactPackage> getPackages() {
|
|
27
|
+
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
28
|
+
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
29
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
30
|
+
// packages.add(new MyReactNativePackage());
|
|
31
|
+
return packages;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@Override
|
|
35
|
+
protected String getJSMainModuleName() {
|
|
36
|
+
return "index";
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
private final ReactNativeHost mNewArchitectureNativeHost =
|
|
41
|
+
new MainApplicationReactNativeHost(this);
|
|
42
|
+
|
|
43
|
+
@Override
|
|
44
|
+
public ReactNativeHost getReactNativeHost() {
|
|
45
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
46
|
+
return mNewArchitectureNativeHost;
|
|
47
|
+
} else {
|
|
48
|
+
return mReactNativeHost;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Override
|
|
53
|
+
public void onCreate() {
|
|
54
|
+
super.onCreate();
|
|
55
|
+
// If you opted-in for the New Architecture, we enable the TurboModule system
|
|
56
|
+
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
57
|
+
SoLoader.init(this, /* native exopackage */ false);
|
|
58
|
+
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
|
63
|
+
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
64
|
+
*
|
|
65
|
+
* @param context
|
|
66
|
+
* @param reactInstanceManager
|
|
67
|
+
*/
|
|
68
|
+
private static void initializeFlipper(
|
|
69
|
+
Context context, ReactInstanceManager reactInstanceManager) {
|
|
70
|
+
if (BuildConfig.DEBUG) {
|
|
71
|
+
try {
|
|
72
|
+
/*
|
|
73
|
+
We use reflection here to pick up the class that initializes Flipper,
|
|
74
|
+
since Flipper library is not available in release mode
|
|
75
|
+
*/
|
|
76
|
+
Class<?> aClass = Class.forName("com.example.ReactNativeFlipper");
|
|
77
|
+
aClass
|
|
78
|
+
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
|
79
|
+
.invoke(null, context, reactInstanceManager);
|
|
80
|
+
} catch (ClassNotFoundException e) {
|
|
81
|
+
e.printStackTrace();
|
|
82
|
+
} catch (NoSuchMethodException e) {
|
|
83
|
+
e.printStackTrace();
|
|
84
|
+
} catch (IllegalAccessException e) {
|
|
85
|
+
e.printStackTrace();
|
|
86
|
+
} catch (InvocationTargetException e) {
|
|
87
|
+
e.printStackTrace();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
package com.example.newarchitecture;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import androidx.annotation.NonNull;
|
|
5
|
+
import com.facebook.react.PackageList;
|
|
6
|
+
import com.facebook.react.ReactInstanceManager;
|
|
7
|
+
import com.facebook.react.ReactNativeHost;
|
|
8
|
+
import com.facebook.react.ReactPackage;
|
|
9
|
+
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
|
10
|
+
import com.facebook.react.bridge.JSIModulePackage;
|
|
11
|
+
import com.facebook.react.bridge.JSIModuleProvider;
|
|
12
|
+
import com.facebook.react.bridge.JSIModuleSpec;
|
|
13
|
+
import com.facebook.react.bridge.JSIModuleType;
|
|
14
|
+
import com.facebook.react.bridge.JavaScriptContextHolder;
|
|
15
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
16
|
+
import com.facebook.react.bridge.UIManager;
|
|
17
|
+
import com.facebook.react.fabric.ComponentFactory;
|
|
18
|
+
import com.facebook.react.fabric.CoreComponentsRegistry;
|
|
19
|
+
import com.facebook.react.fabric.FabricJSIModuleProvider;
|
|
20
|
+
import com.facebook.react.fabric.ReactNativeConfig;
|
|
21
|
+
import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
22
|
+
import com.example.BuildConfig;
|
|
23
|
+
import com.example.newarchitecture.components.MainComponentsRegistry;
|
|
24
|
+
import com.example.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
|
|
25
|
+
import java.util.ArrayList;
|
|
26
|
+
import java.util.List;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
|
|
30
|
+
* TurboModule delegates and the Fabric Renderer.
|
|
31
|
+
*
|
|
32
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
33
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
34
|
+
*/
|
|
35
|
+
public class MainApplicationReactNativeHost extends ReactNativeHost {
|
|
36
|
+
public MainApplicationReactNativeHost(Application application) {
|
|
37
|
+
super(application);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public boolean getUseDeveloperSupport() {
|
|
42
|
+
return BuildConfig.DEBUG;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Override
|
|
46
|
+
protected List<ReactPackage> getPackages() {
|
|
47
|
+
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
48
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
49
|
+
// packages.add(new MyReactNativePackage());
|
|
50
|
+
// TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
|
|
51
|
+
// packages.add(new TurboReactPackage() { ... });
|
|
52
|
+
// If you have custom Fabric Components, their ViewManagers should also be loaded here
|
|
53
|
+
// inside a ReactPackage.
|
|
54
|
+
return packages;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@Override
|
|
58
|
+
protected String getJSMainModuleName() {
|
|
59
|
+
return "index";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@NonNull
|
|
63
|
+
@Override
|
|
64
|
+
protected ReactPackageTurboModuleManagerDelegate.Builder
|
|
65
|
+
getReactPackageTurboModuleManagerDelegateBuilder() {
|
|
66
|
+
// Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
|
|
67
|
+
// for the new architecture and to use TurboModules correctly.
|
|
68
|
+
return new MainApplicationTurboModuleManagerDelegate.Builder();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@Override
|
|
72
|
+
protected JSIModulePackage getJSIModulePackage() {
|
|
73
|
+
return new JSIModulePackage() {
|
|
74
|
+
@Override
|
|
75
|
+
public List<JSIModuleSpec> getJSIModules(
|
|
76
|
+
final ReactApplicationContext reactApplicationContext,
|
|
77
|
+
final JavaScriptContextHolder jsContext) {
|
|
78
|
+
final List<JSIModuleSpec> specs = new ArrayList<>();
|
|
79
|
+
|
|
80
|
+
// Here we provide a new JSIModuleSpec that will be responsible of providing the
|
|
81
|
+
// custom Fabric Components.
|
|
82
|
+
specs.add(
|
|
83
|
+
new JSIModuleSpec() {
|
|
84
|
+
@Override
|
|
85
|
+
public JSIModuleType getJSIModuleType() {
|
|
86
|
+
return JSIModuleType.UIManager;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@Override
|
|
90
|
+
public JSIModuleProvider<UIManager> getJSIModuleProvider() {
|
|
91
|
+
final ComponentFactory componentFactory = new ComponentFactory();
|
|
92
|
+
CoreComponentsRegistry.register(componentFactory);
|
|
93
|
+
|
|
94
|
+
// Here we register a Components Registry.
|
|
95
|
+
// The one that is generated with the template contains no components
|
|
96
|
+
// and just provides you the one from React Native core.
|
|
97
|
+
MainComponentsRegistry.register(componentFactory);
|
|
98
|
+
|
|
99
|
+
final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
|
|
100
|
+
|
|
101
|
+
ViewManagerRegistry viewManagerRegistry =
|
|
102
|
+
new ViewManagerRegistry(
|
|
103
|
+
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
|
|
104
|
+
|
|
105
|
+
return new FabricJSIModuleProvider(
|
|
106
|
+
reactApplicationContext,
|
|
107
|
+
componentFactory,
|
|
108
|
+
ReactNativeConfig.DEFAULT_CONFIG,
|
|
109
|
+
viewManagerRegistry);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return specs;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package com.example.newarchitecture.components;
|
|
2
|
+
|
|
3
|
+
import com.facebook.jni.HybridData;
|
|
4
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
5
|
+
import com.facebook.react.fabric.ComponentFactory;
|
|
6
|
+
import com.facebook.soloader.SoLoader;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Class responsible to load the custom Fabric Components. This class has native methods and needs a
|
|
10
|
+
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
|
11
|
+
* folder for you).
|
|
12
|
+
*
|
|
13
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
14
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
public class MainComponentsRegistry {
|
|
18
|
+
static {
|
|
19
|
+
SoLoader.loadLibrary("fabricjni");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@DoNotStrip private final HybridData mHybridData;
|
|
23
|
+
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
private native HybridData initHybrid(ComponentFactory componentFactory);
|
|
26
|
+
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
private MainComponentsRegistry(ComponentFactory componentFactory) {
|
|
29
|
+
mHybridData = initHybrid(componentFactory);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
public static MainComponentsRegistry register(ComponentFactory componentFactory) {
|
|
34
|
+
return new MainComponentsRegistry(componentFactory);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package com.example.newarchitecture.modules;
|
|
2
|
+
|
|
3
|
+
import com.facebook.jni.HybridData;
|
|
4
|
+
import com.facebook.react.ReactPackage;
|
|
5
|
+
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
+
import com.facebook.soloader.SoLoader;
|
|
8
|
+
import java.util.List;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Class responsible to load the TurboModules. This class has native methods and needs a
|
|
12
|
+
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
|
13
|
+
* folder for you).
|
|
14
|
+
*
|
|
15
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
16
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
17
|
+
*/
|
|
18
|
+
public class MainApplicationTurboModuleManagerDelegate
|
|
19
|
+
extends ReactPackageTurboModuleManagerDelegate {
|
|
20
|
+
|
|
21
|
+
private static volatile boolean sIsSoLibraryLoaded;
|
|
22
|
+
|
|
23
|
+
protected MainApplicationTurboModuleManagerDelegate(
|
|
24
|
+
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
|
|
25
|
+
super(reactApplicationContext, packages);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
protected native HybridData initHybrid();
|
|
29
|
+
|
|
30
|
+
native boolean canCreateTurboModule(String moduleName);
|
|
31
|
+
|
|
32
|
+
public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
|
|
33
|
+
protected MainApplicationTurboModuleManagerDelegate build(
|
|
34
|
+
ReactApplicationContext context, List<ReactPackage> packages) {
|
|
35
|
+
return new MainApplicationTurboModuleManagerDelegate(context, packages);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Override
|
|
40
|
+
protected synchronized void maybeLoadOtherSoLibraries() {
|
|
41
|
+
if (!sIsSoLibraryLoaded) {
|
|
42
|
+
// If you change the name of your application .so file in the Android.mk file,
|
|
43
|
+
// make sure you update the name here as well.
|
|
44
|
+
SoLoader.loadLibrary("example_appmodules");
|
|
45
|
+
sIsSoLibraryLoaded = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
THIS_DIR := $(call my-dir)
|
|
2
|
+
|
|
3
|
+
include $(REACT_ANDROID_DIR)/Android-prebuilt.mk
|
|
4
|
+
|
|
5
|
+
# If you wish to add a custom TurboModule or Fabric component in your app you
|
|
6
|
+
# will have to include the following autogenerated makefile.
|
|
7
|
+
# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk
|
|
8
|
+
include $(CLEAR_VARS)
|
|
9
|
+
|
|
10
|
+
LOCAL_PATH := $(THIS_DIR)
|
|
11
|
+
|
|
12
|
+
# You can customize the name of your application .so file here.
|
|
13
|
+
LOCAL_MODULE := example_appmodules
|
|
14
|
+
|
|
15
|
+
LOCAL_C_INCLUDES := $(LOCAL_PATH)
|
|
16
|
+
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
17
|
+
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
|
18
|
+
|
|
19
|
+
# If you wish to add a custom TurboModule or Fabric component in your app you
|
|
20
|
+
# will have to uncomment those lines to include the generated source
|
|
21
|
+
# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)
|
|
22
|
+
#
|
|
23
|
+
# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
|
|
24
|
+
# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)
|
|
25
|
+
# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
|
|
26
|
+
|
|
27
|
+
# Here you should add any native library you wish to depend on.
|
|
28
|
+
LOCAL_SHARED_LIBRARIES := \
|
|
29
|
+
libfabricjni \
|
|
30
|
+
libfbjni \
|
|
31
|
+
libfolly_runtime \
|
|
32
|
+
libglog \
|
|
33
|
+
libjsi \
|
|
34
|
+
libreact_codegen_rncore \
|
|
35
|
+
libreact_debug \
|
|
36
|
+
libreact_nativemodule_core \
|
|
37
|
+
libreact_render_componentregistry \
|
|
38
|
+
libreact_render_core \
|
|
39
|
+
libreact_render_debug \
|
|
40
|
+
libreact_render_graphics \
|
|
41
|
+
librrc_view \
|
|
42
|
+
libruntimeexecutor \
|
|
43
|
+
libturbomodulejsijni \
|
|
44
|
+
libyoga
|
|
45
|
+
|
|
46
|
+
LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall
|
|
47
|
+
|
|
48
|
+
include $(BUILD_SHARED_LIBRARY)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#include "MainApplicationModuleProvider.h"
|
|
2
|
+
|
|
3
|
+
#include <rncore.h>
|
|
4
|
+
|
|
5
|
+
namespace facebook {
|
|
6
|
+
namespace react {
|
|
7
|
+
|
|
8
|
+
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
9
|
+
const std::string moduleName,
|
|
10
|
+
const JavaTurboModule::InitParams ¶ms) {
|
|
11
|
+
// Here you can provide your own module provider for TurboModules coming from
|
|
12
|
+
// either your application or from external libraries. The approach to follow
|
|
13
|
+
// is similar to the following (for a library called `samplelibrary`:
|
|
14
|
+
//
|
|
15
|
+
// auto module = samplelibrary_ModuleProvider(moduleName, params);
|
|
16
|
+
// if (module != nullptr) {
|
|
17
|
+
// return module;
|
|
18
|
+
// }
|
|
19
|
+
// return rncore_ModuleProvider(moduleName, params);
|
|
20
|
+
return rncore_ModuleProvider(moduleName, params);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
} // namespace react
|
|
24
|
+
} // namespace facebook
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <memory>
|
|
4
|
+
#include <string>
|
|
5
|
+
|
|
6
|
+
#include <ReactCommon/JavaTurboModule.h>
|
|
7
|
+
|
|
8
|
+
namespace facebook {
|
|
9
|
+
namespace react {
|
|
10
|
+
|
|
11
|
+
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
12
|
+
const std::string moduleName,
|
|
13
|
+
const JavaTurboModule::InitParams ¶ms);
|
|
14
|
+
|
|
15
|
+
} // namespace react
|
|
16
|
+
} // namespace facebook
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#include "MainApplicationTurboModuleManagerDelegate.h"
|
|
2
|
+
#include "MainApplicationModuleProvider.h"
|
|
3
|
+
|
|
4
|
+
namespace facebook {
|
|
5
|
+
namespace react {
|
|
6
|
+
|
|
7
|
+
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
|
|
8
|
+
MainApplicationTurboModuleManagerDelegate::initHybrid(
|
|
9
|
+
jni::alias_ref<jhybridobject>) {
|
|
10
|
+
return makeCxxInstance();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
void MainApplicationTurboModuleManagerDelegate::registerNatives() {
|
|
14
|
+
registerHybrid({
|
|
15
|
+
makeNativeMethod(
|
|
16
|
+
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
|
|
17
|
+
makeNativeMethod(
|
|
18
|
+
"canCreateTurboModule",
|
|
19
|
+
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
std::shared_ptr<TurboModule>
|
|
24
|
+
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
25
|
+
const std::string name,
|
|
26
|
+
const std::shared_ptr<CallInvoker> jsInvoker) {
|
|
27
|
+
// Not implemented yet: provide pure-C++ NativeModules here.
|
|
28
|
+
return nullptr;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
std::shared_ptr<TurboModule>
|
|
32
|
+
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
33
|
+
const std::string name,
|
|
34
|
+
const JavaTurboModule::InitParams ¶ms) {
|
|
35
|
+
return MainApplicationModuleProvider(name, params);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
|
|
39
|
+
std::string name) {
|
|
40
|
+
return getTurboModule(name, nullptr) != nullptr ||
|
|
41
|
+
getTurboModule(name, {.moduleName = name}) != nullptr;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
} // namespace react
|
|
45
|
+
} // namespace facebook
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#include <memory>
|
|
2
|
+
#include <string>
|
|
3
|
+
|
|
4
|
+
#include <ReactCommon/TurboModuleManagerDelegate.h>
|
|
5
|
+
#include <fbjni/fbjni.h>
|
|
6
|
+
|
|
7
|
+
namespace facebook {
|
|
8
|
+
namespace react {
|
|
9
|
+
|
|
10
|
+
class MainApplicationTurboModuleManagerDelegate
|
|
11
|
+
: public jni::HybridClass<
|
|
12
|
+
MainApplicationTurboModuleManagerDelegate,
|
|
13
|
+
TurboModuleManagerDelegate> {
|
|
14
|
+
public:
|
|
15
|
+
// Adapt it to the package you used for your Java class.
|
|
16
|
+
static constexpr auto kJavaDescriptor =
|
|
17
|
+
"Lcom/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
|
|
18
|
+
|
|
19
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);
|
|
20
|
+
|
|
21
|
+
static void registerNatives();
|
|
22
|
+
|
|
23
|
+
std::shared_ptr<TurboModule> getTurboModule(
|
|
24
|
+
const std::string name,
|
|
25
|
+
const std::shared_ptr<CallInvoker> jsInvoker) override;
|
|
26
|
+
std::shared_ptr<TurboModule> getTurboModule(
|
|
27
|
+
const std::string name,
|
|
28
|
+
const JavaTurboModule::InitParams ¶ms) override;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Test-only method. Allows user to verify whether a TurboModule can be
|
|
32
|
+
* created by instances of this class.
|
|
33
|
+
*/
|
|
34
|
+
bool canCreateTurboModule(std::string name);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
} // namespace react
|
|
38
|
+
} // namespace facebook
|