@capillarytech/react-native-hydra-lib 1.7.0-beta.1
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/CHANGELOG.md +252 -0
- package/DEPRECATION_POLICY.md +220 -0
- package/LICENSE +20 -0
- package/MIGRATION.md +361 -0
- package/README.md +491 -0
- package/RELEASE_NOTES.md +528 -0
- package/android/build.gradle +565 -0
- package/android/generated/java/com/hydralib/NativeHydraLibSpec.java +185 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNHydraLibSpec-generated.cpp +248 -0
- package/android/generated/jni/RNHydraLibSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/ComponentDescriptors.cpp +24 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/ComponentDescriptors.h +26 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/EventEmitters.cpp +18 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/EventEmitters.h +37 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/Props.cpp +39 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/Props.h +47 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/RNHydraLibSpecJSI-generated.cpp +283 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/RNHydraLibSpecJSI.h +395 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/ShadowNodes.cpp +19 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/ShadowNodes.h +54 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/States.h +53 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/AndroidManifestNew.xml +16 -0
- package/android/src/main/AndroidManifestNoFirebaseIcon.xml +5 -0
- package/android/src/main/java/com/hydralib/delegates/HydraActivityCallbacks.kt +90 -0
- package/android/src/main/java/com/hydralib/delegates/NonHydraNotificationActivity.kt +43 -0
- package/android/src/main/java/com/hydralib/eventemitter/HydraEventEmitter.kt +150 -0
- package/android/src/main/java/com/hydralib/eventemitter/HydraEventType.kt +44 -0
- package/android/src/main/java/com/hydralib/gamification/GamificationBannerViewManager.kt +121 -0
- package/android/src/main/java/com/hydralib/gamification/GamificationEmbedViewManager.kt +153 -0
- package/android/src/main/java/com/hydralib/gamification/GamificationLoyaltyViewManager.kt +95 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraCore.kt +860 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraExtenstions.kt +331 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraInAppMessages.kt +136 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraInbox.kt +70 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraInboxUI.kt +54 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraPushNotification.kt +299 -0
- package/android/src/main/java/com/hydralib/nativeapis/Hydra.kt +28 -0
- package/android/src/main/java/com/hydralib/nativeapis/HydraFirebaseRemoteConfigKeys.kt +76 -0
- package/android/src/main/java/com/hydralib/nativeapis/HydraInitializer.kt +130 -0
- package/android/src/main/java/com/hydralib/nativeapis/HydraNativeMessaging.kt +18 -0
- package/android/src/main/java/com/hydralib/nativeapis/HydraRemoteConfig.kt +59 -0
- package/android/src/main/java/com/hydralib/utils/RNHydraPreferencesManager.kt +154 -0
- package/android/src/main/java/com/hydralib/utils/ResourceUtil.kt +10 -0
- package/android/src/newarch/HydraLibModule.kt +218 -0
- package/android/src/oldarch/HydraLibModule.kt +258 -0
- package/android/src/rn72OrLess/HydraLibPackage.kt +43 -0
- package/android/src/rn73OrMore/HydraLibPackage.kt +53 -0
- package/ios/Delegates/HydraApplicationDelegate.swift +196 -0
- package/ios/Delegates/HydraFirebaseMessagingDelegate.swift +20 -0
- package/ios/Delegates/HydraUNUserNotificationCenterDelegate.swift +26 -0
- package/ios/EventEmitter/HydraEventEmitter.swift +98 -0
- package/ios/EventEmitter/HydraEventType.swift +28 -0
- package/ios/EventEmitter/HydraNativeEmitterBrigde.h +15 -0
- package/ios/EventEmitter/HydraNativeEmitterBrigde.mm +48 -0
- package/ios/GamificationViews/GamificationBannerViewComponentView.h +14 -0
- package/ios/GamificationViews/GamificationBannerViewComponentView.mm +125 -0
- package/ios/GamificationViews/GamificationEmbedViewComponentView.h +14 -0
- package/ios/GamificationViews/GamificationEmbedViewComponentView.mm +131 -0
- package/ios/GamificationViews/GamificationLoyaltyViewComponentView.h +14 -0
- package/ios/GamificationViews/GamificationLoyaltyViewComponentView.mm +120 -0
- package/ios/HydraLib.h +16 -0
- package/ios/HydraLib.mm +207 -0
- package/ios/HydraSDK/HydraInAppMessages.swift +93 -0
- package/ios/HydraSDK/HydraInbox.swift +97 -0
- package/ios/HydraSDK/HydraInboxUI.swift +105 -0
- package/ios/HydraSDK/HydraPushNotification.swift +476 -0
- package/ios/HydraSDK/HydraSDKCore.swift +707 -0
- package/ios/NativeAPIs/Hydra.h +34 -0
- package/ios/NativeAPIs/Hydra.mm +47 -0
- package/ios/NativeAPIs/HydraNativeFirebaseRemoteConfigKeys.h +23 -0
- package/ios/NativeAPIs/HydraNativeFirebaseRemoteConfigKeys.mm +80 -0
- package/ios/NativeAPIs/HydraNativeInitializer.h +16 -0
- package/ios/NativeAPIs/HydraNativeInitializer.mm +39 -0
- package/ios/NativeAPIs/HydraNativeMessaging.h +24 -0
- package/ios/NativeAPIs/HydraNativeMessaging.mm +53 -0
- package/ios/NativeAPIs/HydraNativeRemoteConfig.h +27 -0
- package/ios/NativeAPIs/HydraNativeRemoteConfig.mm +89 -0
- package/ios/Utils/HydraExtensions.swift +322 -0
- package/ios/Utils/HydraRNConstants.swift +13 -0
- package/ios/Utils/RNHydraLogger.swift +31 -0
- package/ios/generated/RNHydraLibSpec/ComponentDescriptors.cpp +24 -0
- package/ios/generated/RNHydraLibSpec/ComponentDescriptors.h +26 -0
- package/ios/generated/RNHydraLibSpec/EventEmitters.cpp +18 -0
- package/ios/generated/RNHydraLibSpec/EventEmitters.h +37 -0
- package/ios/generated/RNHydraLibSpec/Props.cpp +39 -0
- package/ios/generated/RNHydraLibSpec/Props.h +47 -0
- package/ios/generated/RNHydraLibSpec/RCTComponentViewHelpers.h +28 -0
- package/ios/generated/RNHydraLibSpec/RNHydraLibSpec-generated.mm +291 -0
- package/ios/generated/RNHydraLibSpec/RNHydraLibSpec.h +167 -0
- package/ios/generated/RNHydraLibSpec/ShadowNodes.cpp +19 -0
- package/ios/generated/RNHydraLibSpec/ShadowNodes.h +54 -0
- package/ios/generated/RNHydraLibSpec/States.cpp +16 -0
- package/ios/generated/RNHydraLibSpec/States.h +53 -0
- package/ios/generated/RNHydraLibSpecJSI-generated.cpp +283 -0
- package/ios/generated/RNHydraLibSpecJSI.h +395 -0
- package/lib/commonjs/GamificationBannerViewNativeComponent.js +10 -0
- package/lib/commonjs/GamificationBannerViewNativeComponent.js.map +1 -0
- package/lib/commonjs/GamificationEmbedViewNativeComponent.js +10 -0
- package/lib/commonjs/GamificationEmbedViewNativeComponent.js.map +1 -0
- package/lib/commonjs/GamificationLoyaltyViewNativeComponent.js +10 -0
- package/lib/commonjs/GamificationLoyaltyViewNativeComponent.js.map +1 -0
- package/lib/commonjs/NativeHydraLib.js +11 -0
- package/lib/commonjs/NativeHydraLib.js.map +1 -0
- package/lib/commonjs/components/GamificationBannerView.js +15 -0
- package/lib/commonjs/components/GamificationBannerView.js.map +1 -0
- package/lib/commonjs/components/GamificationEmbedView.js +15 -0
- package/lib/commonjs/components/GamificationEmbedView.js.map +1 -0
- package/lib/commonjs/components/GamificationLoyaltyView.js +15 -0
- package/lib/commonjs/components/GamificationLoyaltyView.js.map +1 -0
- package/lib/commonjs/hydra-apis/Hydra.js +43 -0
- package/lib/commonjs/hydra-apis/Hydra.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraCore.js +42 -0
- package/lib/commonjs/hydra-apis/HydraCore.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraInAppMessaging.js +24 -0
- package/lib/commonjs/hydra-apis/HydraInAppMessaging.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraInbox.js +29 -0
- package/lib/commonjs/hydra-apis/HydraInbox.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraInboxUI.js +18 -0
- package/lib/commonjs/hydra-apis/HydraInboxUI.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraNativeEventEmitter.js +133 -0
- package/lib/commonjs/hydra-apis/HydraNativeEventEmitter.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraPushNotification.js +21 -0
- package/lib/commonjs/hydra-apis/HydraPushNotification.js.map +1 -0
- package/lib/commonjs/index.js +230 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/models/HydraAccountConfig.js +41 -0
- package/lib/commonjs/models/HydraAccountConfig.js.map +1 -0
- package/lib/commonjs/models/HydraFirebaseRemoteConfigKeys.js +40 -0
- package/lib/commonjs/models/HydraFirebaseRemoteConfigKeys.js.map +1 -0
- package/lib/commonjs/models/HydraGeoConfig.js +24 -0
- package/lib/commonjs/models/HydraGeoConfig.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppButtonComponent.js +26 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppButtonComponent.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppComponentStyle.js +26 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppComponentStyle.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.js +39 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppMessage.js +60 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppMessage.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppTemplateType.js +66 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppTemplateType.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppTextComponent.js +21 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppTextComponent.js.map +1 -0
- package/lib/commonjs/models/HydraLogLevel.js +16 -0
- package/lib/commonjs/models/HydraLogLevel.js.map +1 -0
- package/lib/commonjs/models/HydraNativeEvent.js +27 -0
- package/lib/commonjs/models/HydraNativeEvent.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotification.js +70 -0
- package/lib/commonjs/models/HydraNotification/HydraNotification.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationBody.js +25 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationBody.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationCta.js +23 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationCta.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationCtaType.js +62 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationCtaType.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationExpandedDetails.js +25 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationExpandedDetails.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationGateway.js +13 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationGateway.js.map +1 -0
- package/lib/commonjs/models/HydraPushPreferences.js +20 -0
- package/lib/commonjs/models/HydraPushPreferences.js.map +1 -0
- package/lib/commonjs/models/HydraUserDetails.js +26 -0
- package/lib/commonjs/models/HydraUserDetails.js.map +1 -0
- package/lib/commonjs/models/HydraVisitorInfo.js +19 -0
- package/lib/commonjs/models/HydraVisitorInfo.js.map +1 -0
- package/lib/commonjs/models/NonHydraNotification.js +18 -0
- package/lib/commonjs/models/NonHydraNotification.js.map +1 -0
- package/lib/commonjs/models/UserState.js +41 -0
- package/lib/commonjs/models/UserState.js.map +1 -0
- package/lib/module/GamificationBannerViewNativeComponent.js +5 -0
- package/lib/module/GamificationBannerViewNativeComponent.js.map +1 -0
- package/lib/module/GamificationEmbedViewNativeComponent.js +5 -0
- package/lib/module/GamificationEmbedViewNativeComponent.js.map +1 -0
- package/lib/module/GamificationLoyaltyViewNativeComponent.js +5 -0
- package/lib/module/GamificationLoyaltyViewNativeComponent.js.map +1 -0
- package/lib/module/NativeHydraLib.js +7 -0
- package/lib/module/NativeHydraLib.js.map +1 -0
- package/lib/module/components/GamificationBannerView.js +10 -0
- package/lib/module/components/GamificationBannerView.js.map +1 -0
- package/lib/module/components/GamificationEmbedView.js +10 -0
- package/lib/module/components/GamificationEmbedView.js.map +1 -0
- package/lib/module/components/GamificationLoyaltyView.js +10 -0
- package/lib/module/components/GamificationLoyaltyView.js.map +1 -0
- package/lib/module/hydra-apis/Hydra.js +37 -0
- package/lib/module/hydra-apis/Hydra.js.map +1 -0
- package/lib/module/hydra-apis/HydraCore.js +36 -0
- package/lib/module/hydra-apis/HydraCore.js.map +1 -0
- package/lib/module/hydra-apis/HydraInAppMessaging.js +18 -0
- package/lib/module/hydra-apis/HydraInAppMessaging.js.map +1 -0
- package/lib/module/hydra-apis/HydraInbox.js +23 -0
- package/lib/module/hydra-apis/HydraInbox.js.map +1 -0
- package/lib/module/hydra-apis/HydraInboxUI.js +12 -0
- package/lib/module/hydra-apis/HydraInboxUI.js.map +1 -0
- package/lib/module/hydra-apis/HydraNativeEventEmitter.js +127 -0
- package/lib/module/hydra-apis/HydraNativeEventEmitter.js.map +1 -0
- package/lib/module/hydra-apis/HydraPushNotification.js +15 -0
- package/lib/module/hydra-apis/HydraPushNotification.js.map +1 -0
- package/lib/module/index.js +36 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/models/HydraAccountConfig.js +36 -0
- package/lib/module/models/HydraAccountConfig.js.map +1 -0
- package/lib/module/models/HydraFirebaseRemoteConfigKeys.js +35 -0
- package/lib/module/models/HydraFirebaseRemoteConfigKeys.js.map +1 -0
- package/lib/module/models/HydraGeoConfig.js +19 -0
- package/lib/module/models/HydraGeoConfig.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppButtonComponent.js +21 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppButtonComponent.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppComponentStyle.js +21 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppComponentStyle.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.js +35 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppMessage.js +55 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppMessage.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppTemplateType.js +62 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppTemplateType.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppTextComponent.js +16 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppTextComponent.js.map +1 -0
- package/lib/module/models/HydraLogLevel.js +12 -0
- package/lib/module/models/HydraLogLevel.js.map +1 -0
- package/lib/module/models/HydraNativeEvent.js +23 -0
- package/lib/module/models/HydraNativeEvent.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotification.js +65 -0
- package/lib/module/models/HydraNotification/HydraNotification.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationBody.js +20 -0
- package/lib/module/models/HydraNotification/HydraNotificationBody.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationCta.js +18 -0
- package/lib/module/models/HydraNotification/HydraNotificationCta.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationCtaType.js +58 -0
- package/lib/module/models/HydraNotification/HydraNotificationCtaType.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationExpandedDetails.js +20 -0
- package/lib/module/models/HydraNotification/HydraNotificationExpandedDetails.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationGateway.js +9 -0
- package/lib/module/models/HydraNotification/HydraNotificationGateway.js.map +1 -0
- package/lib/module/models/HydraPushPreferences.js +15 -0
- package/lib/module/models/HydraPushPreferences.js.map +1 -0
- package/lib/module/models/HydraUserDetails.js +21 -0
- package/lib/module/models/HydraUserDetails.js.map +1 -0
- package/lib/module/models/HydraVisitorInfo.js +14 -0
- package/lib/module/models/HydraVisitorInfo.js.map +1 -0
- package/lib/module/models/NonHydraNotification.js +13 -0
- package/lib/module/models/NonHydraNotification.js.map +1 -0
- package/lib/module/models/UserState.js +37 -0
- package/lib/module/models/UserState.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/GamificationBannerViewNativeComponent.d.ts +7 -0
- package/lib/typescript/commonjs/src/GamificationBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/GamificationEmbedViewNativeComponent.d.ts +7 -0
- package/lib/typescript/commonjs/src/GamificationEmbedViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/GamificationLoyaltyViewNativeComponent.d.ts +7 -0
- package/lib/typescript/commonjs/src/GamificationLoyaltyViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NativeHydraLib.d.ts +46 -0
- package/lib/typescript/commonjs/src/NativeHydraLib.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/GamificationBannerView.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/GamificationBannerView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/GamificationEmbedView.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/GamificationEmbedView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/GamificationLoyaltyView.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/GamificationLoyaltyView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/Hydra.d.ts +15 -0
- package/lib/typescript/commonjs/src/hydra-apis/Hydra.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraCore.d.ts +18 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraCore.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInAppMessaging.d.ts +8 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInAppMessaging.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInbox.d.ts +9 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInbox.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInboxUI.d.ts +5 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInboxUI.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraNativeEventEmitter.d.ts +35 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraNativeEventEmitter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraPushNotification.d.ts +6 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraPushNotification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +37 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraAccountConfig.d.ts +14 -0
- package/lib/typescript/commonjs/src/models/HydraAccountConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraFirebaseRemoteConfigKeys.d.ts +13 -0
- package/lib/typescript/commonjs/src/models/HydraFirebaseRemoteConfigKeys.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraGeoConfig.d.ts +14 -0
- package/lib/typescript/commonjs/src/models/HydraGeoConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppButtonComponent.d.ts +16 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppButtonComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppComponentStyle.d.ts +10 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppComponentStyle.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.d.ts +9 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppMessage.d.ts +29 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppMessage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppTemplateType.d.ts +15 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppTemplateType.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppTextComponent.d.ts +11 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppTextComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraLogLevel.d.ts +9 -0
- package/lib/typescript/commonjs/src/models/HydraLogLevel.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNativeEvent.d.ts +20 -0
- package/lib/typescript/commonjs/src/models/HydraNativeEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotification.d.ts +32 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationBody.d.ts +19 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationBody.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationCta.d.ts +13 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationCta.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationCtaType.d.ts +13 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationCtaType.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationExpandedDetails.d.ts +19 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationExpandedDetails.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationGateway.d.ts +6 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationGateway.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraPushPreferences.d.ts +10 -0
- package/lib/typescript/commonjs/src/models/HydraPushPreferences.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraUserDetails.d.ts +16 -0
- package/lib/typescript/commonjs/src/models/HydraUserDetails.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraVisitorInfo.d.ts +6 -0
- package/lib/typescript/commonjs/src/models/HydraVisitorInfo.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/NonHydraNotification.d.ts +9 -0
- package/lib/typescript/commonjs/src/models/NonHydraNotification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/UserState.d.ts +11 -0
- package/lib/typescript/commonjs/src/models/UserState.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/GamificationBannerViewNativeComponent.d.ts +7 -0
- package/lib/typescript/module/src/GamificationBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/GamificationEmbedViewNativeComponent.d.ts +7 -0
- package/lib/typescript/module/src/GamificationEmbedViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/GamificationLoyaltyViewNativeComponent.d.ts +7 -0
- package/lib/typescript/module/src/GamificationLoyaltyViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeHydraLib.d.ts +46 -0
- package/lib/typescript/module/src/NativeHydraLib.d.ts.map +1 -0
- package/lib/typescript/module/src/components/GamificationBannerView.d.ts +6 -0
- package/lib/typescript/module/src/components/GamificationBannerView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/GamificationEmbedView.d.ts +6 -0
- package/lib/typescript/module/src/components/GamificationEmbedView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/GamificationLoyaltyView.d.ts +6 -0
- package/lib/typescript/module/src/components/GamificationLoyaltyView.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/Hydra.d.ts +15 -0
- package/lib/typescript/module/src/hydra-apis/Hydra.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraCore.d.ts +18 -0
- package/lib/typescript/module/src/hydra-apis/HydraCore.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraInAppMessaging.d.ts +8 -0
- package/lib/typescript/module/src/hydra-apis/HydraInAppMessaging.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraInbox.d.ts +9 -0
- package/lib/typescript/module/src/hydra-apis/HydraInbox.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraInboxUI.d.ts +5 -0
- package/lib/typescript/module/src/hydra-apis/HydraInboxUI.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraNativeEventEmitter.d.ts +35 -0
- package/lib/typescript/module/src/hydra-apis/HydraNativeEventEmitter.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraPushNotification.d.ts +6 -0
- package/lib/typescript/module/src/hydra-apis/HydraPushNotification.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +37 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraAccountConfig.d.ts +14 -0
- package/lib/typescript/module/src/models/HydraAccountConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraFirebaseRemoteConfigKeys.d.ts +13 -0
- package/lib/typescript/module/src/models/HydraFirebaseRemoteConfigKeys.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraGeoConfig.d.ts +14 -0
- package/lib/typescript/module/src/models/HydraGeoConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppButtonComponent.d.ts +16 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppButtonComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppComponentStyle.d.ts +10 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppComponentStyle.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.d.ts +9 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppMessage.d.ts +29 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppMessage.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppTemplateType.d.ts +15 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppTemplateType.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppTextComponent.d.ts +11 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppTextComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraLogLevel.d.ts +9 -0
- package/lib/typescript/module/src/models/HydraLogLevel.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNativeEvent.d.ts +20 -0
- package/lib/typescript/module/src/models/HydraNativeEvent.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotification.d.ts +32 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotification.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationBody.d.ts +19 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationBody.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationCta.d.ts +13 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationCta.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationCtaType.d.ts +13 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationCtaType.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationExpandedDetails.d.ts +19 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationExpandedDetails.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationGateway.d.ts +6 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationGateway.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraPushPreferences.d.ts +10 -0
- package/lib/typescript/module/src/models/HydraPushPreferences.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraUserDetails.d.ts +16 -0
- package/lib/typescript/module/src/models/HydraUserDetails.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraVisitorInfo.d.ts +6 -0
- package/lib/typescript/module/src/models/HydraVisitorInfo.d.ts.map +1 -0
- package/lib/typescript/module/src/models/NonHydraNotification.d.ts +9 -0
- package/lib/typescript/module/src/models/NonHydraNotification.d.ts.map +1 -0
- package/lib/typescript/module/src/models/UserState.d.ts +11 -0
- package/lib/typescript/module/src/models/UserState.d.ts.map +1 -0
- package/package.json +225 -0
- package/react-native-hydra-lib.podspec +256 -0
- package/react-native.config.js +33 -0
- package/sbom.spdx.json +544 -0
- package/scripts/HydraPods.rb +151 -0
- package/scripts/generate-sbom.js +367 -0
- package/scripts/hydra-podspecs/HydraCore.podspec +13 -0
- package/scripts/hydra-podspecs/HydraInAppMessage.podspec +15 -0
- package/scripts/hydra-podspecs/HydraInboxCore.podspec +15 -0
- package/scripts/hydra-podspecs/HydraInboxUI.podspec +15 -0
- package/scripts/hydra-podspecs/HydraPushNotification.podspec +14 -0
- package/scripts/hydra-podspecs/HydraPushNotificationServiceExtension.podspec +15 -0
- package/src/GamificationBannerViewNativeComponent.ts +10 -0
- package/src/GamificationEmbedViewNativeComponent.ts +10 -0
- package/src/GamificationLoyaltyViewNativeComponent.ts +10 -0
- package/src/NativeHydraLib.ts +81 -0
- package/src/components/GamificationBannerView.tsx +10 -0
- package/src/components/GamificationEmbedView.tsx +10 -0
- package/src/components/GamificationLoyaltyView.tsx +10 -0
- package/src/hydra-apis/Hydra.ts +52 -0
- package/src/hydra-apis/HydraCore.ts +76 -0
- package/src/hydra-apis/HydraInAppMessaging.ts +25 -0
- package/src/hydra-apis/HydraInbox.ts +33 -0
- package/src/hydra-apis/HydraInboxUI.ts +10 -0
- package/src/hydra-apis/HydraNativeEventEmitter.ts +216 -0
- package/src/hydra-apis/HydraPushNotification.ts +15 -0
- package/src/index.tsx +71 -0
- package/src/models/HydraAccountConfig.ts +45 -0
- package/src/models/HydraFirebaseRemoteConfigKeys.ts +43 -0
- package/src/models/HydraGeoConfig.ts +27 -0
- package/src/models/HydraInAppMessage/HydraInAppButtonComponent.ts +27 -0
- package/src/models/HydraInAppMessage/HydraInAppComponentStyle.ts +24 -0
- package/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.ts +35 -0
- package/src/models/HydraInAppMessage/HydraInAppMessage.ts +89 -0
- package/src/models/HydraInAppMessage/HydraInAppTemplateType.ts +57 -0
- package/src/models/HydraInAppMessage/HydraInAppTextComponent.ts +18 -0
- package/src/models/HydraLogLevel.ts +8 -0
- package/src/models/HydraNativeEvent.ts +19 -0
- package/src/models/HydraNotification/HydraNotification.ts +97 -0
- package/src/models/HydraNotification/HydraNotificationBody.ts +23 -0
- package/src/models/HydraNotification/HydraNotificationCta.ts +20 -0
- package/src/models/HydraNotification/HydraNotificationCtaType.ts +59 -0
- package/src/models/HydraNotification/HydraNotificationExpandedDetails.ts +28 -0
- package/src/models/HydraNotification/HydraNotificationGateway.ts +5 -0
- package/src/models/HydraPushPreferences.ts +16 -0
- package/src/models/HydraUserDetails.ts +31 -0
- package/src/models/HydraVisitorInfo.ts +14 -0
- package/src/models/NonHydraNotification.ts +15 -0
- package/src/models/UserState.ts +33 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import groovy.json.JsonSlurper
|
|
2
|
+
|
|
3
|
+
buildscript {
|
|
4
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
5
|
+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["HydraLib_kotlinVersion"]
|
|
6
|
+
|
|
7
|
+
repositories {
|
|
8
|
+
google()
|
|
9
|
+
mavenCentral()
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
dependencies {
|
|
13
|
+
classpath "com.android.tools.build:gradle:7.2.2"
|
|
14
|
+
// noinspection DifferentKotlinGradleVersion
|
|
15
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
16
|
+
classpath 'org.codehaus.groovy:groovy-json:3.0.9'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
def reactNativeArchitectures() {
|
|
21
|
+
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
22
|
+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def isNewArchitectureEnabled() {
|
|
26
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
apply plugin: "com.android.library"
|
|
30
|
+
apply plugin: "kotlin-android"
|
|
31
|
+
|
|
32
|
+
if (isNewArchitectureEnabled()) {
|
|
33
|
+
apply plugin: "com.facebook.react"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
def getExtOrDefault(name) {
|
|
37
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["HydraLib_" + name]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
def getExtOrIntegerDefault(name) {
|
|
41
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["HydraLib_" + name]).toInteger()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
def supportsNamespace() {
|
|
45
|
+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
46
|
+
def major = parsed[0].toInteger()
|
|
47
|
+
def minor = parsed[1].toInteger()
|
|
48
|
+
|
|
49
|
+
// Namespace support was added in 7.3.0
|
|
50
|
+
return (major == 7 && minor >= 3) || major >= 8
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def reactNativeMinorVersion(){
|
|
54
|
+
def jsonFile = file("${project.rootDir}/../package.json")
|
|
55
|
+
def parsedPackageJson = new JsonSlurper().parseText(jsonFile.text)
|
|
56
|
+
String reactNativeVersion = parsedPackageJson.dependencies["react-native"]
|
|
57
|
+
def minorReactNativeVersion = reactNativeVersion.tokenize('.')[1].toInteger()
|
|
58
|
+
return minorReactNativeVersion
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
def isHydraFirebaseRegistrationEnabled() {
|
|
62
|
+
def rnJsonFile = file("${project.rootDir}/../capillary/hydra-config.json")
|
|
63
|
+
if(rnJsonFile.exists()){
|
|
64
|
+
println "rnJsonFile exists"
|
|
65
|
+
def parsedHydraConfig = new JsonSlurper().parseText(rnJsonFile.text)
|
|
66
|
+
return parsedHydraConfig.enable_hydra_sdk_firebase_registration
|
|
67
|
+
}
|
|
68
|
+
else{
|
|
69
|
+
println "rnJsonFile does not exist"
|
|
70
|
+
def jsonFile = file("${project.rootDir}/app/src/main/assets/hydra-config.json")
|
|
71
|
+
if(!jsonFile.exists()){
|
|
72
|
+
throw new GradleException("Hydra config file not found at ${rnJsonFile.absolutePath}")
|
|
73
|
+
}
|
|
74
|
+
def parsedHydraConfig = new JsonSlurper().parseText(jsonFile.text)
|
|
75
|
+
return parsedHydraConfig.push_notification.enable_hydra_sdk_firebase_registration
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
def isPushNotificationEnabled() {
|
|
81
|
+
def rnJsonFile = file("${project.rootDir}/../capillary/hydra-config.json")
|
|
82
|
+
if(rnJsonFile.exists()){
|
|
83
|
+
def parsedHydraConfig = new JsonSlurper().parseText(rnJsonFile.text)
|
|
84
|
+
return parsedHydraConfig.enable_push_notification == null ? true : parsedHydraConfig.enable_push_notification
|
|
85
|
+
}
|
|
86
|
+
else{
|
|
87
|
+
def jsonFile = file("${project.rootDir}/app/src/main/assets/hydra-config.json")
|
|
88
|
+
if(!jsonFile.exists()){
|
|
89
|
+
throw new GradleException("Hydra config file not found at ${rnJsonFile.absolutePath}")
|
|
90
|
+
}
|
|
91
|
+
def parsedHydraConfig = new JsonSlurper().parseText(jsonFile.text)
|
|
92
|
+
def pushNotificationConfig = parsedHydraConfig.push_notification?.enable_push_notification
|
|
93
|
+
return pushNotificationConfig == null ? true : pushNotificationConfig
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
android {
|
|
97
|
+
if (supportsNamespace()) {
|
|
98
|
+
namespace "com.hydralib"
|
|
99
|
+
|
|
100
|
+
sourceSets {
|
|
101
|
+
main {
|
|
102
|
+
manifest.srcFile isPushNotificationEnabled() ? "src/main/AndroidManifestNew.xml" : "src/main/AndroidManifestNoFirebaseIcon.xml"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
108
|
+
|
|
109
|
+
defaultConfig {
|
|
110
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
111
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
112
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
113
|
+
manifestPlaceholders.enable_hydra_messaging_service = isHydraFirebaseRegistrationEnabled()
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
buildFeatures {
|
|
117
|
+
buildConfig true
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
buildTypes {
|
|
121
|
+
release {
|
|
122
|
+
minifyEnabled false
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
lintOptions {
|
|
127
|
+
disable "GradleCompatible"
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
compileOptions {
|
|
131
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
132
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
sourceSets {
|
|
136
|
+
main {
|
|
137
|
+
if (isNewArchitectureEnabled()) {
|
|
138
|
+
java.srcDirs += [
|
|
139
|
+
"src/newarch"
|
|
140
|
+
]
|
|
141
|
+
if(reactNativeMinorVersion() >= 76){
|
|
142
|
+
java.srcDirs += [
|
|
143
|
+
"generated/java",
|
|
144
|
+
"generated/jni"
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else{
|
|
149
|
+
java.srcDirs += ["src/oldarch"]
|
|
150
|
+
}
|
|
151
|
+
if(reactNativeMinorVersion() > 72){
|
|
152
|
+
java.srcDirs +=[
|
|
153
|
+
"src/rn73OrMore"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
else{
|
|
157
|
+
java.srcDirs +=[
|
|
158
|
+
"src/rn72OrLess"
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
assets.srcDirs += ["${buildDir}/generated/assets"]
|
|
162
|
+
// Don't add generated/res to source sets to avoid task dependency conflicts
|
|
163
|
+
// The resources will be copied during the build process
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
repositories {
|
|
169
|
+
mavenCentral()
|
|
170
|
+
google()
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
174
|
+
|
|
175
|
+
dependencies {
|
|
176
|
+
// For < 0.71, this will be from the local maven repo
|
|
177
|
+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
178
|
+
//noinspection GradleDynamicVersion
|
|
179
|
+
implementation "com.facebook.react:react-native:+"
|
|
180
|
+
//noinspection GradleDependency
|
|
181
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
182
|
+
|
|
183
|
+
implementation "com.capillarytech:hydra-core:1.9.22-beta05"
|
|
184
|
+
implementation "com.capillarytech:hydra-pushbase:1.9.22-beta05"
|
|
185
|
+
implementation "com.capillarytech:hydra-firebase:1.9.22-beta05"
|
|
186
|
+
implementation "com.capillarytech:hydra-richnotification:1.9.22-beta05"
|
|
187
|
+
|
|
188
|
+
implementation "com.capillarytech:hydra-inbox-core:1.9.22-beta05"
|
|
189
|
+
implementation "com.capillarytech:hydra-inbox-ui:1.9.22-beta05"
|
|
190
|
+
implementation "com.capillarytech:hydra-inapp:1.9.22-beta05"
|
|
191
|
+
implementation "com.google.firebase:firebase-messaging-ktx:24.1.0"
|
|
192
|
+
|
|
193
|
+
implementation "com.google.code.gson:gson:2.11.0"
|
|
194
|
+
implementation 'com.google.firebase:firebase-config-ktx:22.1.0'
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (isNewArchitectureEnabled()) {
|
|
198
|
+
react {
|
|
199
|
+
jsRootDir = file("../src/")
|
|
200
|
+
libraryName = "HydraLib"
|
|
201
|
+
codegenJavaPackageName = "com.hydralib"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
task copyHydraConfig {
|
|
206
|
+
doLast {
|
|
207
|
+
def configSource = file("${project.rootDir}/../capillary/hydra-config.json")
|
|
208
|
+
def assetsDir = file("${buildDir}/generated/assets/capillary/")
|
|
209
|
+
|
|
210
|
+
if (!configSource.exists()) {
|
|
211
|
+
def configFromAndroid = file("${project.rootDir}/app/src/main/assets/hydra-config.json")
|
|
212
|
+
if(configFromAndroid.exists()){
|
|
213
|
+
println "Hydra config file not found at ${configSource.absolutePath}. Will use config from android/app/src/main/assets/hydra-config.json"
|
|
214
|
+
return
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
else{
|
|
218
|
+
throw new GradleException("Hydra config file not found at ${configSource.absolutePath}")
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (!assetsDir.exists()) {
|
|
223
|
+
assetsDir.mkdirs()
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
copy {
|
|
227
|
+
from configSource
|
|
228
|
+
into assetsDir
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
println "✅ Copied hydra config to build folder"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
task copyHydraDrawableResources {
|
|
236
|
+
doLast {
|
|
237
|
+
def iconsSourceDir = file("${project.rootDir}/../capillary/icons")
|
|
238
|
+
def drawableTargetDir = file("${projectDir}/src/main/res/drawable")
|
|
239
|
+
|
|
240
|
+
// Track which files were actually copied
|
|
241
|
+
def copiedFiles = []
|
|
242
|
+
|
|
243
|
+
// Check if source directory exists
|
|
244
|
+
if (!iconsSourceDir.exists()) {
|
|
245
|
+
println "⚠️ Icons source directory not found at ${iconsSourceDir.absolutePath}. Will check legacy location."
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Create target directory if it doesn't exist
|
|
249
|
+
if (!drawableTargetDir.exists()) {
|
|
250
|
+
drawableTargetDir.mkdirs()
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Determine which config file to use
|
|
254
|
+
def configFile = null
|
|
255
|
+
def configSource = "none"
|
|
256
|
+
|
|
257
|
+
def capillaryConfig = file("${project.rootDir}/../capillary/hydra-config.json")
|
|
258
|
+
def androidConfig = file("${project.rootDir}/app/src/main/assets/hydra-config.json")
|
|
259
|
+
|
|
260
|
+
if (capillaryConfig.exists()) {
|
|
261
|
+
configFile = capillaryConfig
|
|
262
|
+
configSource = "capillary directory"
|
|
263
|
+
} else if (androidConfig.exists()) {
|
|
264
|
+
configFile = androidConfig
|
|
265
|
+
configSource = "Android assets"
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Read feature flags from the determined config file
|
|
269
|
+
def enableInAppMessaging = false
|
|
270
|
+
def enableInboxUI = false
|
|
271
|
+
def enablePushNotification = true
|
|
272
|
+
|
|
273
|
+
if (configFile != null) {
|
|
274
|
+
try {
|
|
275
|
+
def config = new JsonSlurper().parseText(configFile.text)
|
|
276
|
+
enableInAppMessaging = config.enable_in_app_messaging ?: false
|
|
277
|
+
enableInboxUI = config.enable_inbox_ui ?: false
|
|
278
|
+
def pushNotificationConfig = (configSource == "capillary directory") ?
|
|
279
|
+
config.enable_push_notification :
|
|
280
|
+
config.push_notification?.enable_push_notification
|
|
281
|
+
enablePushNotification = pushNotificationConfig == null ? true : pushNotificationConfig
|
|
282
|
+
println "📋 Hydra config loaded from ${configSource} - InApp: ${enableInAppMessaging}, InboxUI: ${enableInboxUI}, PushNotification: ${enablePushNotification}"
|
|
283
|
+
} catch (Exception e) {
|
|
284
|
+
println "⚠️ Could not parse hydra-config.json from ${configSource}, using default values"
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
println "⚠️ hydra-config.json not found in any location, using default values"
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Define required resources based on config
|
|
291
|
+
def requiredResources = []
|
|
292
|
+
|
|
293
|
+
if (enablePushNotification) {
|
|
294
|
+
requiredResources.add("hydra_notification_small_icon")
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (enableInAppMessaging) {
|
|
298
|
+
requiredResources.add("hydra_in_app_placeholder")
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (enableInboxUI) {
|
|
302
|
+
requiredResources.add("hydra_inbox_ui_placeholder")
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Common image extensions to check
|
|
306
|
+
def imageExtensions = ["png", "jpg", "jpeg"]
|
|
307
|
+
|
|
308
|
+
requiredResources.each { baseFileName ->
|
|
309
|
+
def fileFound = false
|
|
310
|
+
|
|
311
|
+
// Try to find the file with different extensions in capillary/icons
|
|
312
|
+
for (extension in imageExtensions) {
|
|
313
|
+
def sourceFile = file("${iconsSourceDir.absolutePath}/${baseFileName}.${extension}")
|
|
314
|
+
if (sourceFile.exists()) {
|
|
315
|
+
copy {
|
|
316
|
+
from sourceFile
|
|
317
|
+
into drawableTargetDir
|
|
318
|
+
}
|
|
319
|
+
println "✅ Copied ${baseFileName}.${extension} to generated drawable folder"
|
|
320
|
+
copiedFiles.add("${baseFileName}.${extension}")
|
|
321
|
+
fileFound = true
|
|
322
|
+
break // Break out of the extension loop once file is found
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// If not found in capillary/icons, check for backward compatibility in android/app/src/main/res/drawable
|
|
327
|
+
if (!fileFound) {
|
|
328
|
+
def legacyDrawableDir = file("${project.rootDir}/../android/app/src/main/res/drawable")
|
|
329
|
+
def legacyFileFound = false
|
|
330
|
+
|
|
331
|
+
// For legacy location, also check XML files (vector drawables)
|
|
332
|
+
def legacyExtensions = imageExtensions + ["xml"]
|
|
333
|
+
for (extension in legacyExtensions) {
|
|
334
|
+
def legacyFile = file("${legacyDrawableDir.absolutePath}/${baseFileName}.${extension}")
|
|
335
|
+
if (legacyFile.exists()) {
|
|
336
|
+
println "ℹ️ Found ${baseFileName}.${extension} in legacy location (android/app/src/main/res/drawable). This will be used for backward compatibility."
|
|
337
|
+
legacyFileFound = true
|
|
338
|
+
break // Break out of the extension loop once file is found
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (!legacyFileFound) {
|
|
343
|
+
def errorMessage = "❌ ${baseFileName} not found in capillary/icons with any of the supported extensions: ${imageExtensions.join(', ')}"
|
|
344
|
+
|
|
345
|
+
// Add context about why this resource is required
|
|
346
|
+
if (baseFileName == "hydra_notification_small_icon") {
|
|
347
|
+
errorMessage += "\n This resource is required because enable_push_notification is set to true in hydra-config.json"
|
|
348
|
+
} else if (baseFileName == "hydra_in_app_placeholder") {
|
|
349
|
+
errorMessage += "\n This resource is required because enable_in_app_messaging is set to true in hydra-config.json"
|
|
350
|
+
} else if (baseFileName == "hydra_inbox_ui_placeholder") {
|
|
351
|
+
errorMessage += "\n This resource is required because enable_inbox_ui is set to true in hydra-config.json"
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
throw new GradleException(errorMessage)
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Store the list of copied files in project properties for cleanup task to use
|
|
360
|
+
project.ext.set("hydraCopiedFiles", copiedFiles)
|
|
361
|
+
|
|
362
|
+
println "✅ Completed copying Hydra drawable resources"
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
task cleanupHydraDrawableResources {
|
|
367
|
+
doLast {
|
|
368
|
+
def drawableTargetDir = file("${projectDir}/src/main/res/drawable")
|
|
369
|
+
|
|
370
|
+
// Get the list of files that were actually copied by copyHydraDrawableResources
|
|
371
|
+
def copiedFiles = project.ext.has("hydraCopiedFiles") ? project.ext.get("hydraCopiedFiles") : []
|
|
372
|
+
|
|
373
|
+
if (copiedFiles.isEmpty()) {
|
|
374
|
+
println "ℹ️ No Hydra drawable resources were copied, skipping cleanup"
|
|
375
|
+
return
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
copiedFiles.each { fileName ->
|
|
379
|
+
def fileToDelete = file("${drawableTargetDir.absolutePath}/${fileName}")
|
|
380
|
+
if (fileToDelete.exists()) {
|
|
381
|
+
fileToDelete.delete()
|
|
382
|
+
println "🗑️ Cleaned up ${fileName}"
|
|
383
|
+
} else {
|
|
384
|
+
println "⚠️ Expected file ${fileName} not found during cleanup"
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
println "✅ Completed cleanup of ${copiedFiles.size()} Hydra drawable resources"
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
task copyHydraColorResources{
|
|
393
|
+
doLast {
|
|
394
|
+
def valuesTargetDir = file("${projectDir}/src/main/res/values")
|
|
395
|
+
def hydraColorsFile = file("${valuesTargetDir}/hydra-colors.xml")
|
|
396
|
+
def valuesTargetDirRoot = file("${project.rootDir}/app/src/main/res/values")
|
|
397
|
+
|
|
398
|
+
// Determine which config file to use
|
|
399
|
+
def configFile = null
|
|
400
|
+
def configSource = "none"
|
|
401
|
+
|
|
402
|
+
def capillaryConfig = file("${project.rootDir}/../capillary/hydra-config.json")
|
|
403
|
+
|
|
404
|
+
if (capillaryConfig.exists()) {
|
|
405
|
+
configFile = capillaryConfig
|
|
406
|
+
configSource = "capillary directory"
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
def hydraNotificationColor = null
|
|
410
|
+
|
|
411
|
+
if (configFile != null) {
|
|
412
|
+
try {
|
|
413
|
+
def config = new JsonSlurper().parseText(configFile.text)
|
|
414
|
+
hydraNotificationColor = config.hydra_notification_color
|
|
415
|
+
println "📋 Hydra color config loaded from ${configSource} - Color: ${hydraNotificationColor}"
|
|
416
|
+
} catch (Exception e) {
|
|
417
|
+
println "❌ ERROR: Could not parse hydra-config.json from ${configSource}"
|
|
418
|
+
println " Please ensure the JSON file is valid"
|
|
419
|
+
}
|
|
420
|
+
} else {
|
|
421
|
+
println "hydra-config.json not found"
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (hydraNotificationColor != null) {
|
|
425
|
+
// Create values directory if it doesn't exist
|
|
426
|
+
|
|
427
|
+
// Check for existing hydra_notification_color in any XML files in values directory
|
|
428
|
+
// But only skip if the color is actually defined and accessible
|
|
429
|
+
def conflictingFile = null
|
|
430
|
+
|
|
431
|
+
if (valuesTargetDirRoot.exists()) {
|
|
432
|
+
valuesTargetDirRoot.listFiles().each { file ->
|
|
433
|
+
if (file.name.endsWith('.xml') && file.name != 'hydra-colors.xml') {
|
|
434
|
+
try {
|
|
435
|
+
def content = file.text
|
|
436
|
+
// Check if the color is actually defined (not just mentioned in comments)
|
|
437
|
+
if (content.contains('name="hydra_notification_color"')) {
|
|
438
|
+
// Parse the content to find active (non-commented) color definitions
|
|
439
|
+
def lines = content.split('\n')
|
|
440
|
+
def activeColorFound = false
|
|
441
|
+
|
|
442
|
+
lines.each { line ->
|
|
443
|
+
def trimmedLine = line.trim()
|
|
444
|
+
// Skip commented lines and look for active color definitions
|
|
445
|
+
if (!trimmedLine.startsWith('<!--') &&
|
|
446
|
+
!trimmedLine.startsWith('*') &&
|
|
447
|
+
trimmedLine.contains('name="hydra_notification_color"') &&
|
|
448
|
+
(trimmedLine.contains('<color') || trimmedLine.contains('color>'))) {
|
|
449
|
+
activeColorFound = true
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (activeColorFound) {
|
|
454
|
+
conflictingFile = file.name
|
|
455
|
+
println "ℹ️ Found active hydra_notification_color definition in ${file.name}"
|
|
456
|
+
} else {
|
|
457
|
+
println "ℹ️ Found hydra_notification_color reference in ${file.name} but it's commented out or not actively defined"
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
} catch (Exception ignored) {
|
|
461
|
+
// Skip files that can't be read
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// Only skip if the color is actually defined and accessible
|
|
468
|
+
if (conflictingFile != null) {
|
|
469
|
+
println "hydra_notification_color is already defined in ${conflictingFile}, skipping hydra-colors.xml creation"
|
|
470
|
+
project.ext.set("hydraColorFileCreated", false)
|
|
471
|
+
return
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (!valuesTargetDir.exists()) {
|
|
475
|
+
valuesTargetDir.mkdirs()
|
|
476
|
+
}
|
|
477
|
+
// Check if hydra-colors.xml already exists (shouldn't happen during normal build)
|
|
478
|
+
if (hydraColorsFile.exists()) {
|
|
479
|
+
println "⚠️ hydra-colors.xml already exists, will overwrite"
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
def colorResourceXml = """<?xml version="1.0" encoding="utf-8"?>
|
|
483
|
+
<resources>
|
|
484
|
+
<color name="hydra_notification_color">${hydraNotificationColor}</color>
|
|
485
|
+
</resources>"""
|
|
486
|
+
|
|
487
|
+
// Always create/overwrite the hydra-colors.xml file
|
|
488
|
+
hydraColorsFile.text = colorResourceXml
|
|
489
|
+
println "✅ Created hydra-colors.xml with hydra_notification_color"
|
|
490
|
+
|
|
491
|
+
// Mark that we created the file for cleanup
|
|
492
|
+
project.ext.set("hydraColorFileCreated", true)
|
|
493
|
+
} else {
|
|
494
|
+
println "ℹ️ No hydra_notification_color specified in config, skipping color resource generation"
|
|
495
|
+
project.ext.set("hydraColorFileCreated", false)
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
task cleanupHydraColorResources {
|
|
501
|
+
doLast {
|
|
502
|
+
def valuesTargetDir = file("${projectDir}/src/main/res/values")
|
|
503
|
+
def hydraColorsFile = file("${valuesTargetDir}/hydra-colors.xml")
|
|
504
|
+
|
|
505
|
+
// Only clean up if we actually created the file
|
|
506
|
+
def fileWasCreated = project.ext.has("hydraColorFileCreated") ? project.ext.get("hydraColorFileCreated") : false
|
|
507
|
+
|
|
508
|
+
if (!fileWasCreated) {
|
|
509
|
+
println "ℹ️ hydra-colors.xml was not created during build, skipping cleanup"
|
|
510
|
+
return
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
if (hydraColorsFile.exists()) {
|
|
514
|
+
hydraColorsFile.delete()
|
|
515
|
+
println "🗑️ Removed hydra-colors.xml file that was created during build"
|
|
516
|
+
} else {
|
|
517
|
+
println "⚠️ hydra-colors.xml not found during cleanup"
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
println "✅ Completed cleanup of Hydra color resources"
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
// Make it run before build
|
|
526
|
+
preBuild.dependsOn copyHydraConfig
|
|
527
|
+
preBuild.dependsOn copyHydraDrawableResources
|
|
528
|
+
preBuild.dependsOn copyHydraColorResources
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
// Ensure resources are copied before any build tasks
|
|
532
|
+
afterEvaluate {
|
|
533
|
+
tasks.matching { task ->
|
|
534
|
+
task.name.contains('processReleaseResources') ||
|
|
535
|
+
task.name.contains('processDebugResources')
|
|
536
|
+
}.configureEach { task ->
|
|
537
|
+
task.dependsOn copyHydraDrawableResources
|
|
538
|
+
task.dependsOn copyHydraColorResources
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// Clean up resources after build tasks complete
|
|
542
|
+
tasks.matching { task ->
|
|
543
|
+
task.name.contains('assembleRelease') ||
|
|
544
|
+
task.name.contains('assembleDebug') ||
|
|
545
|
+
task.name.contains('bundleRelease') ||
|
|
546
|
+
task.name.contains('bundleDebug') ||
|
|
547
|
+
task.name.contains('installDebug') ||
|
|
548
|
+
task.name.contains('installRelease') ||
|
|
549
|
+
task.name.contains('packageDebug') ||
|
|
550
|
+
task.name.contains('packageRelease')
|
|
551
|
+
}.configureEach { task ->
|
|
552
|
+
task.finalizedBy cleanupHydraDrawableResources
|
|
553
|
+
task.finalizedBy cleanupHydraColorResources
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// Also clean up after any task that might be the final task in a build
|
|
557
|
+
tasks.matching { task ->
|
|
558
|
+
task.name == 'build' ||
|
|
559
|
+
task.name == 'assemble' ||
|
|
560
|
+
task.name == 'bundle'
|
|
561
|
+
}.configureEach { task ->
|
|
562
|
+
task.finalizedBy cleanupHydraDrawableResources
|
|
563
|
+
task.finalizedBy cleanupHydraColorResources
|
|
564
|
+
}
|
|
565
|
+
}
|