@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,331 @@
|
|
|
1
|
+
package com.hydralib.hydrasdk
|
|
2
|
+
|
|
3
|
+
import com.capillary.hydra.inapp.database.entity.CampaignPayload
|
|
4
|
+
import com.capillary.hydra.inbox.core.internal.Constants.NOTIFICATION_EXPANDED_DETAILS
|
|
5
|
+
import com.capillary.hydra.inbox.core.model.Action
|
|
6
|
+
import com.capillary.hydra.inbox.core.model.CTATYPE
|
|
7
|
+
import com.capillary.hydra.inbox.core.model.GATEWAY
|
|
8
|
+
import com.capillary.hydra.inbox.core.model.InboxMessage
|
|
9
|
+
import com.capillary.hydra.inbox.core.model.MediaContent
|
|
10
|
+
import com.capillary.hydra.inbox.core.model.TextContent
|
|
11
|
+
import com.facebook.react.bridge.ReadableArray
|
|
12
|
+
import com.facebook.react.bridge.ReadableMap
|
|
13
|
+
import com.facebook.react.bridge.ReadableType
|
|
14
|
+
import com.google.gson.Gson
|
|
15
|
+
import org.json.JSONArray
|
|
16
|
+
import org.json.JSONObject
|
|
17
|
+
|
|
18
|
+
fun com.capillary.hydra.pushbase.notification.model.NotificationPayload.toMap(): Map<String, Any> {
|
|
19
|
+
val payloadMap = mutableMapOf<String, Any>()
|
|
20
|
+
|
|
21
|
+
payloadMap["accountId"] = accountId
|
|
22
|
+
campaignId?.let { payloadMap["campaignId"] = it }
|
|
23
|
+
payloadMap["channelId"] = channelId
|
|
24
|
+
payloadMap["cuid"] = cuid
|
|
25
|
+
customData?.let { payloadMap["customData"] = it }
|
|
26
|
+
payloadMap["gateway"] = gateway.name
|
|
27
|
+
payloadMap["messageId"] = messageId
|
|
28
|
+
payloadMap["body"] = notificationBody.toMap()
|
|
29
|
+
notificationExpandedDetails?.toMap()?.let { payloadMap["expandableDetails"] = it }
|
|
30
|
+
payloadMap["scope"] = scope
|
|
31
|
+
senderId?.let { payloadMap["senderId"] = it }
|
|
32
|
+
payloadMap["senderSource"] = senderSource
|
|
33
|
+
variationId?.let { payloadMap["variationId"] = it }
|
|
34
|
+
payloadMap["createdAt"] = createdAt
|
|
35
|
+
return payloadMap
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
fun com.capillary.hydra.pushbase.notification.model.CTA.toMap(): Map<String, Any> {
|
|
39
|
+
val ctaMap = mutableMapOf<String, Any>()
|
|
40
|
+
|
|
41
|
+
action?.let { ctaMap["action"] = it }
|
|
42
|
+
actionText?.let { ctaMap["actionText"] = it }
|
|
43
|
+
ctaMap["type"] = type.name
|
|
44
|
+
|
|
45
|
+
return ctaMap
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fun com.capillary.hydra.inapp.repository.model.CTA.toMap(): Map<String, Any> {
|
|
49
|
+
val ctaMap = mutableMapOf<String, Any>()
|
|
50
|
+
|
|
51
|
+
action?.let { ctaMap["action"] = it }
|
|
52
|
+
actionText?.let { ctaMap["actionText"] = it }
|
|
53
|
+
ctaMap["type"] = type.name
|
|
54
|
+
|
|
55
|
+
return ctaMap
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
fun com.capillary.hydra.pushbase.notification.model.NotificationBody.toMap(): Map<String, Any> {
|
|
59
|
+
val bodyMap = mutableMapOf<String, Any>()
|
|
60
|
+
|
|
61
|
+
cta?.toMap()?.let { bodyMap["cta"] = it }
|
|
62
|
+
image?.let { bodyMap["image"] = it }
|
|
63
|
+
bodyMap["message"] = message
|
|
64
|
+
title?.let { bodyMap["title"] = it }
|
|
65
|
+
|
|
66
|
+
return bodyMap
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
fun com.capillary.hydra.pushbase.notification.model.NotificationExpandedDetails.toMap(): Map<String, Any> {
|
|
70
|
+
val detailsMap = mutableMapOf<String, Any>()
|
|
71
|
+
|
|
72
|
+
detailsMap["ctas"] = ctas.map { it.toMap() }
|
|
73
|
+
image?.let { detailsMap["image"] = it }
|
|
74
|
+
detailsMap["message"] = message
|
|
75
|
+
detailsMap["style"] = style.name
|
|
76
|
+
|
|
77
|
+
return detailsMap
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
fun com.google.firebase.messaging.RemoteMessage.toMap(): Map<String, Any> {
|
|
81
|
+
val remoteMessageMap = mutableMapOf<String, Any>()
|
|
82
|
+
val notificationMap = mutableMapOf<String, Any>()
|
|
83
|
+
|
|
84
|
+
notification?.title?.let { notificationMap["title"] = it }
|
|
85
|
+
notification?.body?.let { notificationMap["body"] = it }
|
|
86
|
+
notification?.icon?.let { notificationMap["icon"] = it }
|
|
87
|
+
notification?.imageUrl?.let { notificationMap["imageUrl"] = it }
|
|
88
|
+
|
|
89
|
+
remoteMessageMap["data"] = data
|
|
90
|
+
remoteMessageMap["notification"] = notificationMap
|
|
91
|
+
|
|
92
|
+
return remoteMessageMap
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
fun ReadableMap.toMap(): Map<String, Any> {
|
|
96
|
+
val immutableMap = mutableMapOf<String, Any>()
|
|
97
|
+
val iterator = keySetIterator()
|
|
98
|
+
while (iterator.hasNextKey()) {
|
|
99
|
+
val key = iterator.nextKey()
|
|
100
|
+
when (getType(key)) {
|
|
101
|
+
ReadableType.Boolean -> immutableMap[key] = getBoolean(key)
|
|
102
|
+
ReadableType.Number -> immutableMap[key] = getDouble(key)
|
|
103
|
+
ReadableType.String -> immutableMap[key] = getString(key) as String
|
|
104
|
+
ReadableType.Map -> immutableMap[key] =
|
|
105
|
+
getMap(key)!!.toMap()
|
|
106
|
+
|
|
107
|
+
ReadableType.Array -> {
|
|
108
|
+
getArray(key)?.toList()
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
else -> { /* Handle other types if needed */
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return immutableMap
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
fun ReadableArray.toList(): List<Any> {
|
|
119
|
+
val immutableList = mutableListOf<Any>()
|
|
120
|
+
for (i in 0 until size()) {
|
|
121
|
+
when (getType(i)) {
|
|
122
|
+
ReadableType.Boolean -> immutableList.add(getBoolean(i))
|
|
123
|
+
ReadableType.Number -> immutableList.add(getDouble(i))
|
|
124
|
+
ReadableType.String -> getString(i)?.let { immutableList.add(it) }
|
|
125
|
+
ReadableType.Map -> getMap(i)?.let { immutableList.add(it.toMap()) }
|
|
126
|
+
ReadableType.Array -> getArray(i)?.let { immutableList.add(it.toList()) }
|
|
127
|
+
else -> { /* Handle other types if needed */
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return immutableList
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
fun Map<*, *>.toInboxMessage(): InboxMessage? {
|
|
136
|
+
val scope = this["scope"] as String?
|
|
137
|
+
val accountId = this["accountId"] as String?
|
|
138
|
+
val senderId = this["senderId"] as String?
|
|
139
|
+
val messageId = this["messageId"] as String?
|
|
140
|
+
val gatewayString = this["gateway"] as String?
|
|
141
|
+
val createdAt = this["createdAt"] as String?
|
|
142
|
+
val isRead = this["isRead"] == "true"
|
|
143
|
+
val payload = (this["payload"] as String?)?.let { JSONObject(it) } ?: JSONObject()
|
|
144
|
+
val validity = (this["validity"] as String?) ?: ""
|
|
145
|
+
val isExpanded = (this["isExpanded"] as Boolean?) == true
|
|
146
|
+
|
|
147
|
+
if (scope == null || accountId == null || senderId == null || messageId == null || gatewayString == null || createdAt == null) {
|
|
148
|
+
return null
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
val gateway = GATEWAY.valueOf(gatewayString)
|
|
152
|
+
|
|
153
|
+
var textContent: TextContent? = null
|
|
154
|
+
var action: Action? = null
|
|
155
|
+
var mediaContent: MediaContent? = null
|
|
156
|
+
val bodyMap = this["body"] as Map<*, *>?
|
|
157
|
+
|
|
158
|
+
if (bodyMap != null) {
|
|
159
|
+
val title = bodyMap["title"] as String?
|
|
160
|
+
val message = bodyMap["message"] as String?
|
|
161
|
+
textContent = TextContent(title ?: "", message ?: "")
|
|
162
|
+
|
|
163
|
+
val image = bodyMap["image"] as String?
|
|
164
|
+
if (image != null) {
|
|
165
|
+
mediaContent = MediaContent(image)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
val ctaMap = bodyMap["cta"] as Map<*, *>?
|
|
169
|
+
if (ctaMap != null) {
|
|
170
|
+
val ctaAction = ctaMap["action"] as String?
|
|
171
|
+
val ctaActionType = (ctaMap["type"] as String?)?.let { CTATYPE.valueOf(it) }
|
|
172
|
+
val ctaActionText = ctaMap["actionText"] as String?
|
|
173
|
+
action = Action(ctaActionText, ctaActionType!!, ctaAction)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return InboxMessage(
|
|
178
|
+
scope,
|
|
179
|
+
accountId,
|
|
180
|
+
senderId,
|
|
181
|
+
messageId,
|
|
182
|
+
gateway,
|
|
183
|
+
textContent!!,
|
|
184
|
+
action,
|
|
185
|
+
mediaContent,
|
|
186
|
+
isRead,
|
|
187
|
+
createdAt,
|
|
188
|
+
payload,
|
|
189
|
+
validity,
|
|
190
|
+
isExpanded,
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
fun InboxMessage.toMap(): Map<String, Any> {
|
|
195
|
+
val inboxMessageMap = mutableMapOf<String, Any>()
|
|
196
|
+
inboxMessageMap["scope"] = scope
|
|
197
|
+
inboxMessageMap["accountId"] = accountId
|
|
198
|
+
inboxMessageMap["senderId"] = senderId
|
|
199
|
+
inboxMessageMap["messageId"] = messageId
|
|
200
|
+
inboxMessageMap["gateway"] = gateway.name
|
|
201
|
+
|
|
202
|
+
val bodyMap = mutableMapOf<String, Any>()
|
|
203
|
+
bodyMap["title"] = textContent.title
|
|
204
|
+
bodyMap["message"] = textContent.message
|
|
205
|
+
|
|
206
|
+
primaryAction?.toMap()?.let {
|
|
207
|
+
bodyMap["cta"] = it
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
mediaContent?.image?.let {
|
|
211
|
+
bodyMap["image"] = it
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
inboxMessageMap["body"] = bodyMap
|
|
215
|
+
inboxMessageMap["isRead"] = isRead.toString()
|
|
216
|
+
inboxMessageMap["createdAt"] = createdAt
|
|
217
|
+
inboxMessageMap["payload"] = payload.toString()
|
|
218
|
+
if (payload.has(NOTIFICATION_EXPANDED_DETAILS)) {
|
|
219
|
+
val expandedDetailsStr = payload.get(NOTIFICATION_EXPANDED_DETAILS) as String?
|
|
220
|
+
expandedDetailsStr?.let {
|
|
221
|
+
inboxMessageMap["expandableDetails"] = JSONObject(expandedDetailsStr).toMap()
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
inboxMessageMap["validity"] = validity
|
|
226
|
+
inboxMessageMap["isExpanded"] = isExpanded
|
|
227
|
+
|
|
228
|
+
return inboxMessageMap
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
fun CampaignPayload.toMap(): Map<String, Any> {
|
|
232
|
+
val inAppMap = mutableMapOf<String, Any>()
|
|
233
|
+
inAppMap["scope"] = scope
|
|
234
|
+
campaignId?.let { inAppMap["campaignId"] = it }
|
|
235
|
+
cuid?.let { inAppMap["cuid"] = it }
|
|
236
|
+
senderId?.let { inAppMap["senderId"] = it }
|
|
237
|
+
|
|
238
|
+
title?.let {
|
|
239
|
+
val titleMap = mutableMapOf<String, Any?>()
|
|
240
|
+
it["text"]?.let { text -> titleMap["text"] = text }
|
|
241
|
+
titleMap["style"] = getInAppStyleMap(it)
|
|
242
|
+
inAppMap["title"] = titleMap
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
message.let {
|
|
246
|
+
val messageMap = mutableMapOf<String, Any?>()
|
|
247
|
+
it["text"]?.let { text -> messageMap["text"] = text }
|
|
248
|
+
messageMap["style"] = getInAppStyleMap(it)
|
|
249
|
+
inAppMap["message"] = messageMap
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
image?.let { inAppMap["imageUrl"] = it.value }
|
|
253
|
+
inAppMap["campaignType"] = campaignType
|
|
254
|
+
eventAttribiutes?.let { inAppMap["eventAttributes"] = it }
|
|
255
|
+
inAppMap["templateType"] = templateType
|
|
256
|
+
actionButton?.let {
|
|
257
|
+
inAppMap["actionButton"] = getInAppActionButtonMap(it)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
negativeActionButton.let{
|
|
261
|
+
inAppMap["negativeActionButton"] = getInAppActionButtonMap(it)
|
|
262
|
+
}
|
|
263
|
+
inAppMap["phoneBackgroundColor"] = phoneBackgroundColor
|
|
264
|
+
inAppMap["layoutBackgroundColor"] = layoutBackgroundColor
|
|
265
|
+
feedbackType?.let { inAppMap["feedbackType"] = it }
|
|
266
|
+
feedbackOptions?.let {
|
|
267
|
+
feedbackOptions?.let { optionsMap ->
|
|
268
|
+
val prefix = optionsMap.keys.firstOrNull()?.takeWhile { !it.isDigit() }
|
|
269
|
+
if (prefix != null) {
|
|
270
|
+
inAppMap["feedbackOptions"] = optionsMap.entries
|
|
271
|
+
.sortedBy { it.key.removePrefix(prefix).toIntOrNull() }
|
|
272
|
+
.map { it.value }
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
selectedColor?.let { inAppMap["ratingSelectedColor"] = it }
|
|
277
|
+
unselectedColor?.let { inAppMap["ratingUnselectedColor"] = it }
|
|
278
|
+
inAppMap["createdAt"] = createdAt
|
|
279
|
+
inAppMap["nativeJsonPayload"] = Gson().toJson(this)
|
|
280
|
+
return inAppMap
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
fun getInAppStyleMap(originalMap : Map<String, Any?>): Map<String, Any?> {
|
|
286
|
+
val styleMap = mutableMapOf<String, Any?>()
|
|
287
|
+
originalMap.forEach {
|
|
288
|
+
when (it.key) {
|
|
289
|
+
"textColor" -> styleMap["textColor"] = it.value
|
|
290
|
+
"textSize" -> styleMap["fontSize"] = it.value
|
|
291
|
+
"backgroundColor" -> styleMap["backgroundColor"] = it.value
|
|
292
|
+
"textStyle" -> styleMap["fontStyle"] = it.value
|
|
293
|
+
"textFont" -> styleMap["fontName"] = it.value
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return styleMap
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
fun getInAppActionButtonMap(originalMap : Map<String, Any?>): Map<String, Any?> {
|
|
300
|
+
val actionButtonMap = mutableMapOf<String, Any?>()
|
|
301
|
+
originalMap.forEach {
|
|
302
|
+
when (it.key) {
|
|
303
|
+
"actionText" -> actionButtonMap["actionText"] = it.value
|
|
304
|
+
"type" -> actionButtonMap["type"] = it.value
|
|
305
|
+
"action" -> actionButtonMap["action"] = it.value
|
|
306
|
+
}
|
|
307
|
+
actionButtonMap["style"] = getInAppStyleMap(originalMap)
|
|
308
|
+
}
|
|
309
|
+
return actionButtonMap
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
fun Action.toMap(): Map<String, Any> {
|
|
313
|
+
val actionMap = mutableMapOf<String, Any>()
|
|
314
|
+
actionMap["actionText"] = actionText!!
|
|
315
|
+
actionMap["type"] = type.name
|
|
316
|
+
actionMap["action"] = action!!
|
|
317
|
+
return actionMap
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
fun JSONObject.toMap(): Map<String, Any?> =
|
|
321
|
+
keys().asSequence().associateWith { key -> toValue(get(key)) }
|
|
322
|
+
|
|
323
|
+
fun JSONArray.toList(): List<Any?> =
|
|
324
|
+
(0 until length()).map { index -> toValue(get(index)) }
|
|
325
|
+
|
|
326
|
+
private fun toValue(element: Any) = when (element) {
|
|
327
|
+
JSONObject.NULL -> null
|
|
328
|
+
is JSONObject -> element.toMap()
|
|
329
|
+
is JSONArray -> element.toList()
|
|
330
|
+
else -> element
|
|
331
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
package com.hydralib.hydrasdk
|
|
2
|
+
|
|
3
|
+
import com.capillary.hydra.android.sdk.utils.Logger
|
|
4
|
+
import com.capillary.hydra.inapp.database.entity.CampaignPayload
|
|
5
|
+
import com.capillary.hydra.inapp.listener.OnMessageClickListener
|
|
6
|
+
import com.capillary.hydra.inapp.listener.SelfHandledInAppMessageListener
|
|
7
|
+
import com.capillary.hydra.inapp.utils.HydraInAppUIHelper
|
|
8
|
+
import com.facebook.react.bridge.Promise
|
|
9
|
+
import com.facebook.react.bridge.ReadableArray
|
|
10
|
+
import com.facebook.react.bridge.ReadableMap
|
|
11
|
+
import com.google.gson.Gson
|
|
12
|
+
import com.hydralib.eventemitter.HydraEventEmitter
|
|
13
|
+
import com.hydralib.eventemitter.HydraEventType
|
|
14
|
+
import kotlinx.coroutines.suspendCancellableCoroutine
|
|
15
|
+
import kotlin.coroutines.resume
|
|
16
|
+
|
|
17
|
+
object HydraInAppMessages {
|
|
18
|
+
|
|
19
|
+
private fun asInAppMessageClickListener() =
|
|
20
|
+
OnMessageClickListener { _, cta ->
|
|
21
|
+
Logger.d(
|
|
22
|
+
"HydraInAppMessages.OnMessageClickListener",
|
|
23
|
+
"received in app message click with cta = $cta"
|
|
24
|
+
)
|
|
25
|
+
val detailMap = mutableMapOf<String, Any>()
|
|
26
|
+
detailMap["cta"] = cta.toMap()
|
|
27
|
+
HydraEventEmitter.sendEvent(
|
|
28
|
+
HydraEventType.ON_HYDRA_NOTIFICATION_CLICKED,
|
|
29
|
+
detailMap
|
|
30
|
+
)
|
|
31
|
+
true
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private fun asSelfHandledInAppMessageListener() =
|
|
35
|
+
SelfHandledInAppMessageListener { message ->
|
|
36
|
+
Logger.d(
|
|
37
|
+
"HydraInAppMessages.SelfHandledInAppMessageListener",
|
|
38
|
+
"message details - type = ${message.templateType}, title = ${message.title?.get("text")}, message = ${message.message["text"]}"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
suspendCancellableCoroutine<Boolean> { continuation ->
|
|
42
|
+
HydraEventEmitter.sendEvent(
|
|
43
|
+
HydraEventType.ON_HYDRA_IN_APP_MESSAGE,
|
|
44
|
+
message.toMap()
|
|
45
|
+
) { result ->
|
|
46
|
+
val handled = result as? Boolean ?: false
|
|
47
|
+
continuation.resume(handled)
|
|
48
|
+
if (handled) {
|
|
49
|
+
Logger.d("HydraInAppMessages.SelfHandledInAppMessageListener", "message handled in RN")
|
|
50
|
+
HydraInAppUIHelper.getInstance()
|
|
51
|
+
.reportInAppMessageShown(HydraCore.appContext!!, message)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
fun registerListener() {
|
|
59
|
+
HydraInAppUIHelper.getInstance().registerOnMessageClickListener(asInAppMessageClickListener())
|
|
60
|
+
HydraInAppUIHelper.getInstance()
|
|
61
|
+
.registerSelfHandledInAppMessageListener(asSelfHandledInAppMessageListener())
|
|
62
|
+
Logger.d("HydraInAppMessages.registerListener", "message click listener registered")
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
fun reportMessageClicked(
|
|
66
|
+
message: ReadableMap?,
|
|
67
|
+
promise: Promise?
|
|
68
|
+
) {
|
|
69
|
+
|
|
70
|
+
message?.let {
|
|
71
|
+
val messageMap = message.toMap()
|
|
72
|
+
messageMap["nativeJsonPayload"]?.let {
|
|
73
|
+
val jsonString = Gson().toJson(it)
|
|
74
|
+
val payloadFromJson = Gson().fromJson(jsonString, CampaignPayload::class.java)
|
|
75
|
+
HydraInAppUIHelper.getInstance()
|
|
76
|
+
.reportInAppMessageIsClicked(HydraCore.appContext!!, payloadFromJson)
|
|
77
|
+
promise?.resolve(true)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
fun reportMessageDismissed(
|
|
83
|
+
message: ReadableMap?,
|
|
84
|
+
promise: Promise?
|
|
85
|
+
) {
|
|
86
|
+
message?.let {
|
|
87
|
+
val messageMap = message.toMap()
|
|
88
|
+
messageMap["nativeJsonPayload"]?.let {
|
|
89
|
+
val jsonString = Gson().toJson(it)
|
|
90
|
+
val payloadFromJson = Gson().fromJson(jsonString, CampaignPayload::class.java)
|
|
91
|
+
HydraInAppUIHelper.getInstance()
|
|
92
|
+
.reportInAppMessageDismissed(HydraCore.appContext!!, payloadFromJson)
|
|
93
|
+
promise?.resolve(true)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
fun reportMessageRating(
|
|
99
|
+
message: ReadableMap?,
|
|
100
|
+
rating: Double,
|
|
101
|
+
promise: Promise?
|
|
102
|
+
) {
|
|
103
|
+
message?.let {
|
|
104
|
+
val messageMap = message.toMap()
|
|
105
|
+
messageMap["nativeJsonPayload"]?.let {
|
|
106
|
+
val jsonString = Gson().toJson(it)
|
|
107
|
+
val payloadFromJson = Gson().fromJson(jsonString, CampaignPayload::class.java)
|
|
108
|
+
HydraInAppUIHelper.getInstance()
|
|
109
|
+
.reportInAppMessageRating(HydraCore.appContext!!, payloadFromJson, rating.toInt())
|
|
110
|
+
promise?.resolve(true)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
fun reportMessageFeedback(
|
|
116
|
+
message: ReadableMap?,
|
|
117
|
+
feedback: String?,
|
|
118
|
+
feedbackOptions: ReadableArray?,
|
|
119
|
+
promise: Promise?
|
|
120
|
+
) {
|
|
121
|
+
message?.let {
|
|
122
|
+
val messageMap = message.toMap()
|
|
123
|
+
messageMap["nativeJsonPayload"]?.let {
|
|
124
|
+
val jsonString = Gson().toJson(it)
|
|
125
|
+
val payloadFromJson = Gson().fromJson(jsonString, CampaignPayload::class.java)
|
|
126
|
+
val feedbackOptionsList = feedbackOptions?.toList()?.mapNotNull { option -> option as? Int } ?: listOf()
|
|
127
|
+
HydraInAppUIHelper.getInstance().reportInAppMessageFeedback(
|
|
128
|
+
HydraCore.appContext!!,
|
|
129
|
+
payloadFromJson,
|
|
130
|
+
feedbackOptionsList
|
|
131
|
+
)
|
|
132
|
+
promise?.resolve(true)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
package com.hydralib.hydrasdk
|
|
2
|
+
|
|
3
|
+
import com.capillary.hydra.android.sdk.utils.Logger
|
|
4
|
+
import com.capillary.hydra.inbox.core.HydraInboxCoreApi
|
|
5
|
+
import com.capillary.hydra.inbox.core.listener.OnMessagesAvailableListener
|
|
6
|
+
import com.capillary.hydra.inbox.core.listener.UnReadCountListener
|
|
7
|
+
import com.facebook.react.bridge.Arguments
|
|
8
|
+
|
|
9
|
+
import com.facebook.react.bridge.Promise
|
|
10
|
+
import com.facebook.react.bridge.ReadableMap
|
|
11
|
+
import com.facebook.react.bridge.WritableArray
|
|
12
|
+
|
|
13
|
+
object HydraInbox {
|
|
14
|
+
fun getInboxMessages(promise: Promise?) {
|
|
15
|
+
val listener = OnMessagesAvailableListener { inboxMessages ->
|
|
16
|
+
Logger.d("HydraInbox.getInboxMessages", "got ${inboxMessages.size} messages")
|
|
17
|
+
val processedList: WritableArray = Arguments.createArray()
|
|
18
|
+
inboxMessages.forEach {
|
|
19
|
+
processedList.pushMap(Arguments.makeNativeMap(it.toMap()))
|
|
20
|
+
}
|
|
21
|
+
Logger.d("HydraInbox.getInboxMessages", "resolving promise with processedList = $processedList")
|
|
22
|
+
promise?.resolve(processedList)
|
|
23
|
+
}
|
|
24
|
+
Logger.d("HydraInbox.getInboxMessages", "fetching inbox messages")
|
|
25
|
+
HydraInboxCoreApi.getInstance().fetchInboxMessages(HydraCore.appContext!!, listener)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
fun getUnreadInboxMessagesCount(promise: Promise?) {
|
|
29
|
+
val listener = UnReadCountListener {
|
|
30
|
+
Logger.d("HydraInbox.getUnreadInboxMessagesCount", "Received unread message count is $it")
|
|
31
|
+
promise?.resolve(it)
|
|
32
|
+
}
|
|
33
|
+
Logger.d("HydraInbox.getUnreadInboxMessagesCount", "getting unread message count")
|
|
34
|
+
HydraInboxCoreApi.getInstance().getUnReadMessagesCount(HydraCore.appContext!!, listener)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
fun markInboxMessageAsRead(inboxMessage: ReadableMap?, promise: Promise?) {
|
|
38
|
+
Logger.d("HydraInbox.markInboxMessageAsRead", "marking inboxMessage as read, input message = $inboxMessage")
|
|
39
|
+
inboxMessage?.toMap()?.toInboxMessage()?.let {
|
|
40
|
+
HydraInboxCoreApi.getInstance()
|
|
41
|
+
.trackInboxMessageClick(HydraCore.appContext!!, it)
|
|
42
|
+
promise?.resolve(true)
|
|
43
|
+
Logger.d("HydraInbox.markInboxMessageAsRead", "Inbox message marked read successfully")
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
Logger.d("HydraInbox.markInboxMessageAsRead", "Invalid inbox message details")
|
|
47
|
+
promise?.resolve(false)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
fun deleteInboxMessage(inboxMessage: ReadableMap?, promise: Promise?) {
|
|
51
|
+
Logger.d("HydraInbox.deleteInboxMessage", "Deleting inbox message, input message = $inboxMessage")
|
|
52
|
+
inboxMessage?.toMap()?.toInboxMessage()?.let {
|
|
53
|
+
HydraInboxCoreApi.getInstance()
|
|
54
|
+
.deleteInboxMessage(HydraCore.appContext!!, it)
|
|
55
|
+
promise?.resolve(true)
|
|
56
|
+
Logger.d("HydraInbox.deleteInboxMessage", "Inbox message deleted successfully")
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
Logger.d("HydraInbox.deleteInboxMessage", "Invalid inbox message details")
|
|
60
|
+
promise?.resolve(false)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
fun deleteAllInboxMessages(promise: Promise?) {
|
|
64
|
+
Logger.d("HydraInbox.deleteAllInboxMessages", "Deleting all inbox messages")
|
|
65
|
+
HydraInboxCoreApi.getInstance().deleteAllInboxMessages(HydraCore.appContext!!)
|
|
66
|
+
Logger.d("HydraInbox.deleteAllInboxMessages", "All Inbox messages deleted successfully")
|
|
67
|
+
promise?.resolve(true)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
package com.hydralib.hydrasdk
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import com.capillary.hydra.android.sdk.utils.Logger
|
|
6
|
+
import com.capillary.hydra.inbox.core.model.Action
|
|
7
|
+
import com.capillary.hydra.inbox.ui.HydraInboxUIHelper
|
|
8
|
+
import com.capillary.hydra.inbox.ui.listener.OnMessageClickListener
|
|
9
|
+
import com.capillary.hydra.inbox.ui.view.InboxActivity
|
|
10
|
+
import com.facebook.react.bridge.Promise
|
|
11
|
+
import com.hydralib.eventemitter.HydraEventEmitter
|
|
12
|
+
import com.hydralib.eventemitter.HydraEventType
|
|
13
|
+
import java.util.Timer
|
|
14
|
+
import kotlin.concurrent.schedule
|
|
15
|
+
|
|
16
|
+
object HydraInboxUI {
|
|
17
|
+
var curInboxActivity : InboxActivity? = null
|
|
18
|
+
private fun asInboxMessageClickListener() =
|
|
19
|
+
OnMessageClickListener { _: Context, action: Action ->
|
|
20
|
+
val detailMap = mutableMapOf<String, Any>()
|
|
21
|
+
Logger.d("HydraInboxUI.OnMessageClickListener", "received message click with action = $action")
|
|
22
|
+
detailMap["cta"] = action.toMap()
|
|
23
|
+
HydraEventEmitter.sendEvent(
|
|
24
|
+
HydraEventType.ON_HYDRA_NOTIFICATION_CLICKED,
|
|
25
|
+
detailMap
|
|
26
|
+
)
|
|
27
|
+
true
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
fun registerListener() {
|
|
31
|
+
HydraInboxUIHelper.getInstance().registerOnMessageClickListener(asInboxMessageClickListener())
|
|
32
|
+
Logger.d("HydraInboxUI.registerListener", "Registered Click listener successfully")
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
fun showNotificationCenter(promise: Promise?) {
|
|
36
|
+
Logger.d("HydraInboxUI.showNotificationCenter", "Starting InboxActivity")
|
|
37
|
+
val inboxActivity = Intent(HydraCore.appContext!!, InboxActivity::class.java)
|
|
38
|
+
inboxActivity.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
39
|
+
HydraCore.appContext!!.startActivity( inboxActivity, null)
|
|
40
|
+
Logger.d("HydraInboxUI.showNotificationCenter", "InboxActivity started successfully")
|
|
41
|
+
promise?.resolve(true)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
fun hideNotificationCenterIfShowing(promise: Promise?){
|
|
45
|
+
curInboxActivity?.let {
|
|
46
|
+
curInboxActivity!!.finish()
|
|
47
|
+
Timer().schedule(30){
|
|
48
|
+
promise?.resolve(true)
|
|
49
|
+
}
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
promise?.resolve(true)
|
|
53
|
+
}
|
|
54
|
+
}
|