react-native-firework-sdk 2.0.0-beta.1 → 2.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModel.kt +10 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +21 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModel.kt +11 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +24 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSystemTypeface.kt +9 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +4 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +24 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +29 -12
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +33 -6
- package/ios/Components/VideoFeed.swift +12 -23
- package/ios/Components/VideoPlayerConfiguration.swift +0 -5
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -0
- package/ios/Models/NativeToRN/FireworkEventName.swift +1 -0
- package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +20 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +30 -5
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +13 -3
- package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +29 -0
- package/lib/commonjs/FireworkSDK.js +42 -26
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +20 -5
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +22 -19
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/AndroidFontInfo.js +2 -0
- package/lib/commonjs/models/AndroidFontInfo.js.map +1 -0
- package/lib/commonjs/models/FWEventName.js +1 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/SDKInitOptions.js +2 -0
- package/lib/commonjs/models/SDKInitOptions.js.map +1 -0
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +43 -25
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +18 -5
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +20 -18
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/AndroidFontInfo.js +2 -0
- package/lib/module/models/AndroidFontInfo.js.map +1 -0
- package/lib/module/models/FWEventName.js +1 -0
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/SDKInitOptions.js +2 -0
- package/lib/module/models/SDKInitOptions.js.map +1 -0
- package/lib/module/modules/FireworkSDKModule.js +1 -2
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +23 -14
- package/lib/typescript/LiveStream.d.ts +2 -2
- package/lib/typescript/VideoShopping.d.ts +4 -4
- package/lib/typescript/components/StoryBlock.d.ts +6 -2
- package/lib/typescript/components/VideoFeed.d.ts +9 -2
- package/lib/typescript/index.d.ts +7 -3
- package/lib/typescript/models/AdBadgeConfiguration.d.ts +1 -1
- package/lib/typescript/models/AndroidFontInfo.d.ts +14 -0
- package/lib/typescript/models/FWEventName.d.ts +1 -0
- package/lib/typescript/models/IOSFontInfo.d.ts +2 -2
- package/lib/typescript/models/SDKInitOptions.d.ts +6 -0
- package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +9 -12
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +4 -9
- package/lib/typescript/modules/FireworkSDKModule.d.ts +4 -3
- package/package.json +7 -4
- package/src/FireworkSDK.ts +42 -24
- package/src/VideoShopping.ts +3 -7
- package/src/components/StoryBlock.tsx +22 -4
- package/src/components/VideoFeed.tsx +24 -11
- package/src/index.ts +10 -1
- package/src/models/AndroidFontInfo.ts +14 -0
- package/src/models/FWEventName.ts +1 -0
- package/src/models/SDKInitOptions.ts +7 -0
- package/src/models/VideoFeedConfiguration.ts +8 -11
- package/src/models/VideoPlayerConfiguration.ts +1 -7
- package/src/modules/FireworkSDKModule.ts +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWLoggerUtil","FWVideoFeed","NativeComponentName","VideoFeed","Component","createRef","log","JSON","stringify","props","nativeNodeHandle","nativeComponentRef","current","commandId","getViewManagerConfig","Commands","refresh","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","componentDidMount","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","adConfiguration","enablePictureInPicture","videoFeedConfiguration","_getVideoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","enableAutoplay","enablePictureInPictureLegacy","gridColumns","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","showAdBadge","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length","vastAttributes","attribute","Math","floor"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,SAASC,WAAT,QAA4B,uBAA5B;AAKA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAuDA,MAAMC,mBAAmB,GAAG,aAA5B;AAEA,eAAe,MAAMC,SAAN,SAAwBV,KAAK,CAACW,SAA9B,CAAyD;AAAA;AAAA;;AAAA,6DAKjDX,KAAK,CAACY,SAAN,EALiD;;AAAA,2CAO/B,EAP+B;;AAAA,qCAYrD,MAAM;AACrBL,MAAAA,YAAY,CAACM,GAAb,CAAkB,qBAAoBC,IAAI,CAACC,SAAL,CAAe,KAAKC,KAApB,CAA2B,EAAjE;AAEA,YAAMC,gBAAgB,GAAGhB,cAAc,CAAC,KAAKiB,kBAAL,CAAwBC,OAAzB,CAAvC;AAEA,UAAIC,SAA0B,GAC5BjB,SAAS,CAACkB,oBAAV,CAA+BZ,mBAA/B,EAAoDa,QAApD,CAA6DC,OAD/D;;AAEA,UAAIrB,QAAQ,CAACsB,EAAT,KAAgB,SAApB,EAA+B;AAC7BJ,QAAAA,SAAS,GAAGA,SAAS,CAACK,QAAV,EAAZ;AACD;;AAEDtB,MAAAA,SAAS,CAACuB,0BAAV,CACEzB,cAAc,CAACgB,gBAAD,CADhB,EAEEG,SAFF,EAGE,EAHF;AAKD,KA5BqE;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E;AAELoB,QAAAA,WAAW,EAAEsB,IAAI,CAACC,KAAL,CAAW3C,sBAAsB,CAACoB,WAAlC;AAFR,OAAP;AAID,KATD,MASO;AACL,aAAOpB,sBAAP;AACD;AACF;;AAzNqE;;gBAAnD3C,S,kBACG;AACpBwC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport {\n EmitterSubscription,\n findNodeHandle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.The playlistGroup is only supported on iOS\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);\n\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh;\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedLoadFinished } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n if (reason) {\n onVideoFeedLoadFinished({ name, reason });\n } else {\n onVideoFeedLoadFinished({ name });\n }\n } else {\n onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n FWLoggerUtil.log(\n `VideoFeed componentWillUnmount ${JSON.stringify(this.props)}`\n );\n\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n FWLoggerUtil.log(`VideoFeed render ${JSON.stringify(this.props)}`);\n\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n adConfiguration,\n enablePictureInPicture = false,\n } = this.props;\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;\n\n let enablePictureInPictureLegacy = false;\n if (videoFeedConfiguration) {\n enablePictureInPictureLegacy =\n (videoFeedConfiguration as any).enablePictureInPicture ?? false;\n }\n const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;\n const requiresAds = adConfiguration?.requiresAds ?? false;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;\n const vastAttributesString = this._generateVastAttributesString();\n const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_enableAutoplay:${enableAutoplay}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_enablePictureInPictureLegacy:${enablePictureInPictureLegacy}`;\n key += `_gridColumns:${gridColumns}`;\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_showAdBadge:${showAdBadge}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n\n private _generateVastAttributesString(): string {\n const { adConfiguration } = this.props;\n const vastAttributes = adConfiguration?.vastAttributes ?? '';\n if (!vastAttributes) {\n return '';\n }\n\n let resultString = '';\n for (const attribute of vastAttributes) {\n if (resultString.length > 0) {\n resultString += '_';\n }\n resultString += `${attribute.name ?? ''}:${attribute.value}`;\n }\n\n return resultString;\n }\n\n private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n if (\n videoFeedConfiguration.gridColumns &&\n Math.floor(videoFeedConfiguration.gridColumns!) !==\n videoFeedConfiguration.gridColumns\n ) {\n return {\n ...videoFeedConfiguration,\n gridColumns: Math.floor(videoFeedConfiguration.gridColumns!),\n };\n } else {\n return videoFeedConfiguration;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWLoggerUtil","FWVideoFeed","NativeComponentName","VideoFeed","Component","createRef","log","JSON","stringify","props","nativeNodeHandle","nativeComponentRef","current","commandId","getViewManagerConfig","Commands","refresh","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","componentDidMount","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","adConfiguration","enablePictureInPicture","videoFeedConfiguration","_getVideoFeedConfiguration","titleHidden","title","hidden","titlePosition","shareBaseURL","getInstance","getShareBaseURL","adBadgeConfiguration","getAdBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","enableAutoplay","gridColumns","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","showAdBadge","videoLaunchBehavior","getVideoLaunchBehavior","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length","vastAttributes","attribute","Math","floor"],"mappings":";;;;AAAA,OAAOA,KAA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Content":["import React from 'react';\n\nimport {\n EmitterSubscription,\n findNodeHandle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\n/**\n * The props of VideoFeed component.\n */\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.The playlistGroup is only supported on iOS\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);\n\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh;\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedLoadFinished } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n if (reason) {\n onVideoFeedLoadFinished({ name, reason });\n } else {\n onVideoFeedLoadFinished({ name });\n }\n } else {\n onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);\n }\n\n componentWillUnmount() {\n FWLoggerUtil.log(\n `VideoFeed componentWillUnmount ${JSON.stringify(this.props)}`\n );\n\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n FWLoggerUtil.log(`VideoFeed render ${JSON.stringify(this.props)}`);\n\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n adConfiguration,\n enablePictureInPicture = false,\n } = this.props;\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const shareBaseURL = FireworkSDK.getInstance().getShareBaseURL() ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;\n\n const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;\n const requiresAds = adConfiguration?.requiresAds ?? false;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;\n const vastAttributesString = this._generateVastAttributesString();\n const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;\n const videoLaunchBehavior =\n FireworkSDK.getInstance().getVideoLaunchBehavior() ?? 'default';\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_enableAutoplay:${enableAutoplay}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_gridColumns:${gridColumns}`;\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_showAdBadge:${showAdBadge}`;\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n\n private _generateVastAttributesString(): string {\n const { adConfiguration } = this.props;\n const vastAttributes = adConfiguration?.vastAttributes ?? '';\n if (!vastAttributes) {\n return '';\n }\n\n let resultString = '';\n for (const attribute of vastAttributes) {\n if (resultString.length > 0) {\n resultString += '_';\n }\n resultString += `${attribute.name ?? ''}:${attribute.value}`;\n }\n\n return resultString;\n }\n\n private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n if (\n videoFeedConfiguration.gridColumns &&\n Math.floor(videoFeedConfiguration.gridColumns!) !==\n videoFeedConfiguration.gridColumns\n ) {\n return {\n ...videoFeedConfiguration,\n gridColumns: Math.floor(videoFeedConfiguration.gridColumns!),\n };\n } else {\n return videoFeedConfiguration;\n }\n }\n}\n\nexport default VideoFeed;\n"]}
|
package/lib/module/index.js
CHANGED
|
@@ -8,5 +8,5 @@ import LiveStreamEventName from './models/LiveStreamEventName';
|
|
|
8
8
|
import VideoPlaybackEventName from './models/VideoPlaybackEventName';
|
|
9
9
|
import VideoShopping from './VideoShopping';
|
|
10
10
|
export default FireworkSDK;
|
|
11
|
-
export { FWNavigator, LiveStream, LiveStreamChatEventName, LiveStreamEventName, StoryBlock, VideoFeed, VideoPlaybackEventName, VideoShopping };
|
|
11
|
+
export { FireworkSDK, FWNavigator, LiveStream, LiveStreamChatEventName, LiveStreamEventName, StoryBlock, VideoFeed, VideoPlaybackEventName, VideoShopping };
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["StoryBlock","VideoFeed","FireworkSDK","FWNavigator","LiveStream","LiveStreamChatEventName","LiveStreamEventName","VideoPlaybackEventName","VideoShopping"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["StoryBlock","VideoFeed","FireworkSDK","FWNavigator","LiveStream","LiveStreamChatEventName","LiveStreamEventName","VideoPlaybackEventName","VideoShopping"],"mappings":"AACA,OAAOA,UAAP,MAAuB,yBAAvB;AAEA,OAAOC,SAAP,MAAsB,wBAAtB;AAOA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AAyBA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;AAwBA,OAAOC,sBAAP,MAAmC,iCAAnC;AAeA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,eAAeN,WAAf;AAEA,SAeEA,WAfF,EAiBEC,WAjBF,EAwBEC,UAxBF,EA0BEC,uBA1BF,EA6BEC,mBA7BF,EAyCEN,UAzCF,EA+CEC,SA/CF,EA6DEM,sBA7DF,EAqEEC,aArEF","sourcesContent":["import type { IStoryBlockProps } from './components/StoryBlock';\nimport StoryBlock from './components/StoryBlock';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n SDKInitCallback,\n VideoFeedClickCallback,\n VideoPlaybackCallback,\n} from './FireworkSDK';\nimport FireworkSDK from './FireworkSDK';\nimport FWNavigator from './FWNavigator';\nimport type {\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n} from './LiveStream';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport type { AdBadgeTextType } from './models/AdBadgeConfiguration';\nimport type AdConfiguration from './models/AdConfiguration';\nimport type { VastAttribute } from './models/AdConfiguration';\nimport type AddToCartResult from './models/AddToCartResult';\nimport type AndroidFontInfo from './models/AndroidFontInfo';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n AddToCartEvent,\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type IOSFontInfo from './models/IOSFontInfo';\nimport type {\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n} from './models/IOSFontInfo';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n AddToCartButtonConfiguration,\n LinkButtonConfiguration,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedContentPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n} from './models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from './models/VideoFeedSource';\nimport type VideoPlaybackDetails from './models/VideoPlaybackDetails';\nimport type { VideoPlayerSize } from './models/VideoPlaybackDetails';\nimport VideoPlaybackEventName from './models/VideoPlaybackEventName';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCompleteAction,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerStyle,\n} from './models/VideoPlayerConfiguration';\nimport type {\n AddToCartCallback,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n UpdateProductDetailsCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AdConfiguration,\n AddToCartButtonConfiguration,\n AddToCartCallback,\n AddToCartEvent,\n AddToCartResult,\n AndroidFontInfo,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\n IOSFontInfo,\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n IStoryBlockProps,\n IVideoFeedProps,\n LinkButtonConfiguration,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n StoryBlock,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedContentPadding,\n VideoFeedMode,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -11,6 +11,7 @@ export let FWEventName;
|
|
|
11
11
|
FWEventName["LiveStream"] = "fw:livestream";
|
|
12
12
|
FWEventName["LiveStreamChat"] = "fw:livestream-chat";
|
|
13
13
|
FWEventName["ShareBaseURLUpdated"] = "fw:share-base-url-updated";
|
|
14
|
+
FWEventName["VideoLaunchBehaviorUpdated"] = "fw:video-launch-behavior-updated";
|
|
14
15
|
FWEventName["AdBadgeConfigurationUpdated"] = "fw:ad-badge-configuration-updated";
|
|
15
16
|
FWEventName["LogMessage"] = "fw:log-message";
|
|
16
17
|
FWEventName["CustomLinkButtonClick"] = "fw:shopping:custom-link-button-click";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":"AAAA,WAAYA,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n LogMessage = 'fw:log-message',\n CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":"AAAA,WAAYA,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n LogMessage = 'fw:log-message',\n CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { NativeEventEmitter } from 'react-native';
|
|
2
|
-
import { NativeModules } from 'react-native';
|
|
1
|
+
import { NativeEventEmitter, NativeModules } from 'react-native';
|
|
3
2
|
import { LINKING_ERROR } from '../constants/FWErrorMessage';
|
|
4
3
|
const FireworkSDKModule = NativeModules.FireworkSDK ? NativeModules.FireworkSDK : new Proxy({}, {
|
|
5
4
|
get() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","FireworkSDKModule","FireworkSDK","Proxy","get","Error","FireworkSDKModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,
|
|
1
|
+
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","FireworkSDKModule","FireworkSDK","Proxy","get","Error","FireworkSDKModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,EAA2CC,aAA3C,QAAgE,cAAhE;AAEA,SAASC,aAAT,QAA8B,6BAA9B;AAMA,MAAMC,iBAAiB,GAAGF,aAAa,CAACG,WAAd,GACtBH,aAAa,CAACG,WADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUL,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAuBA,MAAMM,6BAA6B,GAAG,IAAIR,kBAAJ,CAAuBG,iBAAvB,CAAtC;AACA,SAASK,6BAAT;AACA,eAAeL,iBAAf","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type AdBadgeConfiguration from '../models/AdBadgeConfiguration';\nimport type SDKInitOptions from '../models/SDKInitOptions';\nimport type TrackPurchaseParameters from '../models/TrackPurchaseParameters';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\n\nconst FireworkSDKModule = NativeModules.FireworkSDK\n ? NativeModules.FireworkSDK\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IFireworkSDKModule extends NativeModule {\n init(options?: SDKInitOptions): Promise<any>;\n openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;\n setCustomCTAClickEnabled(enabled: boolean): void;\n setShareBaseURL(url?: string): Promise<any>;\n setVideoPlaybackEventEnabled(enabled: boolean): void;\n setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;\n trackPurchase(parameters: TrackPurchaseParameters): void;\n changeAppLanguage(language: string): Promise<boolean>;\n restart(): Promise<any>;\n}\n\nconst FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);\nexport { FireworkSDKModuleEventEmitter };\nexport default FireworkSDKModule as IFireworkSDKModule;\n"]}
|
|
@@ -2,15 +2,17 @@ import FWNavigator from './FWNavigator';
|
|
|
2
2
|
import LiveStream from './LiveStream';
|
|
3
3
|
import type AdBadgeConfiguration from './models/AdBadgeConfiguration';
|
|
4
4
|
import type { CustomCTAClickEvent, SDKInitEvent, VideoFeedClickEvent, VideoPlaybackEvent } from './models/FWEvents';
|
|
5
|
+
import type SDKInitOptions from './models/SDKInitOptions';
|
|
6
|
+
import type { VideoLaunchBehavior } from './models/SDKInitOptions';
|
|
5
7
|
import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
|
|
6
8
|
import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
|
|
7
9
|
import VideoShopping from './VideoShopping';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type SDKInitCallback = (event: SDKInitEvent) => void;
|
|
11
|
+
export type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;
|
|
12
|
+
export type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;
|
|
13
|
+
export type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* Firework SDK.
|
|
14
16
|
*/
|
|
15
17
|
declare class FireworkSDK {
|
|
16
18
|
private static _instance?;
|
|
@@ -35,16 +37,18 @@ declare class FireworkSDK {
|
|
|
35
37
|
set onVideoPlayback(value: VideoPlaybackCallback | undefined);
|
|
36
38
|
private _onVideoPlayback?;
|
|
37
39
|
/**
|
|
38
|
-
*
|
|
40
|
+
* Get share base URL.
|
|
39
41
|
*/
|
|
40
|
-
|
|
41
|
-
set shareBaseURL(value: string | undefined);
|
|
42
|
+
getShareBaseURL(): string | undefined;
|
|
42
43
|
private _shareBaseURL;
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
+
* Get the configuration for ad badges. Only supported on iOS.
|
|
45
46
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
getAdBadgeConfiguration(): AdBadgeConfiguration | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Set the configuration for ad badges. Only supported on iOS.
|
|
50
|
+
*/
|
|
51
|
+
setAdBadgeConfiguration(value: AdBadgeConfiguration | undefined): Promise<void>;
|
|
48
52
|
private _adBadgeConfiguration;
|
|
49
53
|
/**
|
|
50
54
|
* Defaults to false.
|
|
@@ -52,6 +56,11 @@ declare class FireworkSDK {
|
|
|
52
56
|
*/
|
|
53
57
|
get debugLogsEnabled(): boolean;
|
|
54
58
|
set debugLogsEnabled(value: boolean);
|
|
59
|
+
/**
|
|
60
|
+
* Get video launch behavior.
|
|
61
|
+
*/
|
|
62
|
+
getVideoLaunchBehavior(): VideoLaunchBehavior | undefined;
|
|
63
|
+
private _videoLaunchBehavior;
|
|
55
64
|
private get eventEmitter();
|
|
56
65
|
/**
|
|
57
66
|
* Get VideoShopping object.
|
|
@@ -76,9 +85,9 @@ declare class FireworkSDK {
|
|
|
76
85
|
private constructor();
|
|
77
86
|
/**
|
|
78
87
|
* Initializes Firework SDK.
|
|
79
|
-
* @param {
|
|
88
|
+
* @param {SDKInitOptions?} options
|
|
80
89
|
*/
|
|
81
|
-
init(
|
|
90
|
+
init(options?: SDKInitOptions): Promise<void>;
|
|
82
91
|
/**
|
|
83
92
|
* Open Video URL.
|
|
84
93
|
* @param {string} url
|
|
@@ -93,7 +102,7 @@ declare class FireworkSDK {
|
|
|
93
102
|
/**
|
|
94
103
|
* Change App level language. Only supported on Android.
|
|
95
104
|
* @param {string} language Such as en, ar and en-US
|
|
96
|
-
* @returns
|
|
105
|
+
* @returns {Promise<boolean>}
|
|
97
106
|
*/
|
|
98
107
|
changeAppLanguage(language: string): Promise<boolean>;
|
|
99
108
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LiveStreamChatEvent, LiveStreamEvent } from './models/FWEvents';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type onLiveStreamEventCallback = (event: LiveStreamEvent) => void;
|
|
3
|
+
export type onLiveStreamChatEventCallback = (event: LiveStreamChatEvent) => void;
|
|
4
4
|
/**
|
|
5
5
|
* The entry class of live stream.
|
|
6
6
|
*/
|
|
@@ -2,10 +2,10 @@ import type AddToCartResult from './models/AddToCartResult';
|
|
|
2
2
|
import type { AddToCartEvent, CustomClickLinkButtonEvent, UpdateProductDetailsEvent } from './models/FWEvents';
|
|
3
3
|
import type Product from './models/Product';
|
|
4
4
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
5
|
+
export type AddToCartCallback = (event: AddToCartEvent) => Promise<AddToCartResult | undefined | null>;
|
|
6
|
+
export type CustomClickCartIconCallback = () => Promise<void>;
|
|
7
|
+
export type UpdateProductDetailsCallback = (event: UpdateProductDetailsEvent) => Promise<Product[] | undefined | null>;
|
|
8
|
+
export type CustomClickLinkButtonCallback = (event: CustomClickLinkButtonEvent) => Promise<void>;
|
|
9
9
|
/**
|
|
10
10
|
* The entry class of video shopping.
|
|
11
11
|
*/
|
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import type { EmitterSubscription, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import type FWError from '../models/FWError';
|
|
4
4
|
import type { StoryBlockSource } from '../models/StoryBlockSource';
|
|
5
|
+
/**
|
|
6
|
+
* The props type of StoryBlock component.
|
|
7
|
+
*/
|
|
5
8
|
export interface IStoryBlockProps {
|
|
6
9
|
/**
|
|
7
10
|
* Standard React Native View Style.
|
|
@@ -35,9 +38,9 @@ export interface IStoryBlockProps {
|
|
|
35
38
|
onStoryBlockLoadFinished?: (error?: FWError) => void;
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
|
-
* Only supported on iOS.
|
|
41
|
+
* StoryBlock component. Only supported on iOS.
|
|
39
42
|
*/
|
|
40
|
-
|
|
43
|
+
declare class StoryBlock extends React.Component<IStoryBlockProps> {
|
|
41
44
|
nativeComponentRef: React.RefObject<any>;
|
|
42
45
|
subscriptions: EmitterSubscription[];
|
|
43
46
|
componentDidMount(): void;
|
|
@@ -47,3 +50,4 @@ export default class StoryBlock extends React.Component<IStoryBlockProps> {
|
|
|
47
50
|
private _generateKey;
|
|
48
51
|
private _generateDynamicContentParametersString;
|
|
49
52
|
}
|
|
53
|
+
export default StoryBlock;
|
|
@@ -5,7 +5,10 @@ import type AdConfiguration from '../models/AdConfiguration';
|
|
|
5
5
|
import type VideoFeedConfiguration from '../models/VideoFeedConfiguration';
|
|
6
6
|
import type { VideoFeedSource } from '../models/VideoFeedSource';
|
|
7
7
|
import type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';
|
|
8
|
-
export
|
|
8
|
+
export type VideoFeedMode = 'row' | 'column' | 'grid';
|
|
9
|
+
/**
|
|
10
|
+
* The props of VideoFeed component.
|
|
11
|
+
*/
|
|
9
12
|
export interface IVideoFeedProps {
|
|
10
13
|
/**
|
|
11
14
|
* Standard React Native View Style.
|
|
@@ -58,7 +61,10 @@ export interface IVideoFeedProps {
|
|
|
58
61
|
*/
|
|
59
62
|
onVideoFeedLoadFinished?: (error?: FWError) => void;
|
|
60
63
|
}
|
|
61
|
-
|
|
64
|
+
/**
|
|
65
|
+
* VideoFeed component.
|
|
66
|
+
*/
|
|
67
|
+
declare class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
62
68
|
static defaultProps: {
|
|
63
69
|
mode: string;
|
|
64
70
|
};
|
|
@@ -76,3 +82,4 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
76
82
|
private _generateVastAttributesString;
|
|
77
83
|
private _getVideoFeedConfiguration;
|
|
78
84
|
}
|
|
85
|
+
export default VideoFeed;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IStoryBlockProps } from './components/StoryBlock';
|
|
1
2
|
import StoryBlock from './components/StoryBlock';
|
|
2
3
|
import type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';
|
|
3
4
|
import VideoFeed from './components/VideoFeed';
|
|
@@ -11,9 +12,10 @@ import type { AdBadgeTextType } from './models/AdBadgeConfiguration';
|
|
|
11
12
|
import type AdConfiguration from './models/AdConfiguration';
|
|
12
13
|
import type { VastAttribute } from './models/AdConfiguration';
|
|
13
14
|
import type AddToCartResult from './models/AddToCartResult';
|
|
15
|
+
import type AndroidFontInfo from './models/AndroidFontInfo';
|
|
14
16
|
import type FeedItemDetails from './models/FeedItemDetails';
|
|
15
17
|
import type FWError from './models/FWError';
|
|
16
|
-
import type { AddToCartEvent, CustomClickLinkButtonEvent, CustomCTAClickEvent, LiveStreamChatEvent, LiveStreamEvent, SDKInitEvent, UpdateProductDetailsEvent, VideoPlaybackEvent } from './models/FWEvents';
|
|
18
|
+
import type { AddToCartEvent, CustomClickLinkButtonEvent, CustomCTAClickEvent, LiveStreamChatEvent, LiveStreamEvent, SDKInitEvent, UpdateProductDetailsEvent, VideoFeedClickEvent, VideoPlaybackEvent } from './models/FWEvents';
|
|
17
19
|
import type IOSFontInfo from './models/IOSFontInfo';
|
|
18
20
|
import type { IOSSystemFontStyle, IOSSystemFontWeight } from './models/IOSFontInfo';
|
|
19
21
|
import LiveStreamChatEventName from './models/LiveStreamChatEventName';
|
|
@@ -25,6 +27,8 @@ import type ProductInfoViewConfiguration from './models/ProductInfoViewConfigura
|
|
|
25
27
|
import type { AddToCartButtonConfiguration, LinkButtonConfiguration } from './models/ProductInfoViewConfiguration';
|
|
26
28
|
import type ProductUnit from './models/ProductUnit';
|
|
27
29
|
import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
|
|
30
|
+
import type SDKInitOptions from './models/SDKInitOptions';
|
|
31
|
+
import type { VideoLaunchBehavior } from './models/SDKInitOptions';
|
|
28
32
|
import type { StoryBlockSource } from './models/StoryBlockSource';
|
|
29
33
|
import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
|
|
30
34
|
import type VideoFeedConfiguration from './models/VideoFeedConfiguration';
|
|
@@ -34,8 +38,8 @@ import type VideoPlaybackDetails from './models/VideoPlaybackDetails';
|
|
|
34
38
|
import type { VideoPlayerSize } from './models/VideoPlaybackDetails';
|
|
35
39
|
import VideoPlaybackEventName from './models/VideoPlaybackEventName';
|
|
36
40
|
import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
|
|
37
|
-
import type {
|
|
41
|
+
import type { VideoPlayerCompleteAction, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerStyle } from './models/VideoPlayerConfiguration';
|
|
38
42
|
import type { AddToCartCallback, CustomClickCartIconCallback, CustomClickLinkButtonCallback, UpdateProductDetailsCallback } from './VideoShopping';
|
|
39
43
|
import VideoShopping from './VideoShopping';
|
|
40
44
|
export default FireworkSDK;
|
|
41
|
-
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AddToCartButtonConfiguration, AddToCartCallback, AddToCartEvent, AddToCartResult, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FWError, FWNavigator, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, SDKInitCallback, SDKInitEvent, StoryBlock, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedConfiguration, VideoFeedContentPadding, VideoFeedMode, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
45
|
+
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AddToCartButtonConfiguration, AddToCartCallback, AddToCartEvent, AddToCartResult, AndroidFontInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, SDKInitCallback, SDKInitEvent, SDKInitOptions, StoryBlock, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedContentPadding, VideoFeedMode, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Only supported on Android.
|
|
3
|
+
*/
|
|
4
|
+
export default interface AndroidFontInfo {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to use a custom font. Default is false.
|
|
7
|
+
*/
|
|
8
|
+
isCustom?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The Android system typeface name, such as "DEFAULT", "DEFAULT_BOLD", "SANS_SERIF", "SERIF", "MONOSPACE".
|
|
11
|
+
* Or custom font name, such as: "fonts/kaushanscript_regular.ttf". (You need to set the isCustom=true and put the font file in the "assets" directory: app/src/main/assets/fonts/kaushanscript_regular.ttf)
|
|
12
|
+
*/
|
|
13
|
+
typefaceName?: string;
|
|
14
|
+
}
|
|
@@ -9,6 +9,7 @@ export declare enum FWEventName {
|
|
|
9
9
|
LiveStream = "fw:livestream",
|
|
10
10
|
LiveStreamChat = "fw:livestream-chat",
|
|
11
11
|
ShareBaseURLUpdated = "fw:share-base-url-updated",
|
|
12
|
+
VideoLaunchBehaviorUpdated = "fw:video-launch-behavior-updated",
|
|
12
13
|
AdBadgeConfigurationUpdated = "fw:ad-badge-configuration-updated",
|
|
13
14
|
LogMessage = "fw:log-message",
|
|
14
15
|
CustomLinkButtonClick = "fw:shopping:custom-link-button-click"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type IOSSystemFontStyle = 'normal' | 'italic';
|
|
2
|
+
export type IOSSystemFontWeight = 'ultraLight' | 'thin' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy' | 'black';
|
|
3
3
|
export default interface IOSFontInfo {
|
|
4
4
|
/**
|
|
5
5
|
* The iOS font name, such as "Helvetica", "Helvetica-Bold".
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type IOSFontInfo from './IOSFontInfo';
|
|
2
|
+
import type AndroidFontInfo from './AndroidFontInfo';
|
|
2
3
|
export interface VideoFeedTitleConfiguration {
|
|
3
4
|
/**
|
|
4
5
|
* Specifies if the video feed title is hidden.
|
|
@@ -13,17 +14,23 @@ export interface VideoFeedTitleConfiguration {
|
|
|
13
14
|
*/
|
|
14
15
|
fontSize?: number;
|
|
15
16
|
/**
|
|
16
|
-
* The iOS font info of
|
|
17
|
+
* The iOS font info of video feed title.
|
|
17
18
|
* The property is ignored when fontSize is not set.
|
|
18
19
|
* Only supported on iOS.
|
|
19
20
|
*/
|
|
20
21
|
iOSFontInfo?: IOSFontInfo;
|
|
22
|
+
/**
|
|
23
|
+
* The Android font info of "VideoFeedTitle".
|
|
24
|
+
* The property is ignored when fontSize is not set.
|
|
25
|
+
* Only supported on Android.
|
|
26
|
+
*/
|
|
27
|
+
androidFontInfo?: AndroidFontInfo;
|
|
21
28
|
}
|
|
22
29
|
export interface VideoFeedPlayIconConfiguration {
|
|
23
30
|
hidden?: boolean;
|
|
24
31
|
iconWidth?: number;
|
|
25
32
|
}
|
|
26
|
-
export
|
|
33
|
+
export type VideoFeedTitlePosition = 'stacked' | 'nested';
|
|
27
34
|
export interface VideoFeedContentPadding {
|
|
28
35
|
top?: number;
|
|
29
36
|
right?: number;
|
|
@@ -55,10 +62,6 @@ export default interface VideoFeedConfiguration {
|
|
|
55
62
|
* Indicates if the video feed item shows ad badge.
|
|
56
63
|
*/
|
|
57
64
|
showAdBadge?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Custom layout name for video feed item. Only supported on Android. Deprecate
|
|
60
|
-
*/
|
|
61
|
-
customLayoutName?: string;
|
|
62
65
|
/**
|
|
63
66
|
* The aspect ratio(width / height) for video feed item. Only supported on iOS.
|
|
64
67
|
*/
|
|
@@ -81,10 +84,4 @@ export default interface VideoFeedConfiguration {
|
|
|
81
84
|
* The property value needs to be an integer and greater than 0.
|
|
82
85
|
*/
|
|
83
86
|
gridColumns?: number;
|
|
84
|
-
/**
|
|
85
|
-
* Please use the enablePictureInPicture in IVideoFeedProps. Deprecate
|
|
86
|
-
*
|
|
87
|
-
* @deprecated The property will be deprecated since RN SDK V2.
|
|
88
|
-
*/
|
|
89
|
-
enablePictureInPicture?: boolean;
|
|
90
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type IOSFontInfo from './IOSFontInfo';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type VideoPlayerStyle = 'full' | 'fit';
|
|
3
|
+
export type VideoPlayerCompleteAction = 'loop' | 'advanceToNext';
|
|
4
4
|
export interface VideoPlayerCTAStyle {
|
|
5
5
|
/**
|
|
6
6
|
* The background color of CTA button.
|
|
@@ -15,13 +15,13 @@ export interface VideoPlayerCTAStyle {
|
|
|
15
15
|
*/
|
|
16
16
|
fontSize?: number;
|
|
17
17
|
/**
|
|
18
|
-
* The iOS font info of
|
|
18
|
+
* The iOS font info of CTA button.
|
|
19
19
|
* The property is ignored when fontSize is not set.
|
|
20
20
|
* Only supported on iOS.
|
|
21
21
|
*/
|
|
22
22
|
iOSFontInfo?: IOSFontInfo;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export type VideoPlayerCTADelayType = 'constant' | 'percentage';
|
|
25
25
|
export interface VideoPlayerCTADelay {
|
|
26
26
|
type: VideoPlayerCTADelayType;
|
|
27
27
|
/**
|
|
@@ -32,7 +32,6 @@ export interface VideoPlayerCTADelay {
|
|
|
32
32
|
*/
|
|
33
33
|
value: number;
|
|
34
34
|
}
|
|
35
|
-
export declare type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
|
|
36
35
|
export default interface VideoPlayerConfiguration {
|
|
37
36
|
/**
|
|
38
37
|
* Sets the proportion of the video player to its container.
|
|
@@ -58,10 +57,6 @@ export default interface VideoPlayerConfiguration {
|
|
|
58
57
|
* Indicates if the video player shows mute button.
|
|
59
58
|
*/
|
|
60
59
|
showMuteButton?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Specifies the video player launch behavior. Only supported on iOS.
|
|
63
|
-
*/
|
|
64
|
-
launchBehavior?: VideoLaunchBehavior;
|
|
65
60
|
/**
|
|
66
61
|
* Indicates if Firework branding should be showed or not.
|
|
67
62
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModule } from 'react-native';
|
|
2
2
|
import type AdBadgeConfiguration from '../models/AdBadgeConfiguration';
|
|
3
|
-
import type
|
|
3
|
+
import type SDKInitOptions from '../models/SDKInitOptions';
|
|
4
4
|
import type TrackPurchaseParameters from '../models/TrackPurchaseParameters';
|
|
5
|
+
import type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';
|
|
5
6
|
interface IFireworkSDKModule extends NativeModule {
|
|
6
|
-
init(
|
|
7
|
+
init(options?: SDKInitOptions): Promise<any>;
|
|
7
8
|
openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;
|
|
8
9
|
setCustomCTAClickEnabled(enabled: boolean): void;
|
|
9
10
|
setShareBaseURL(url?: string): Promise<any>;
|
|
@@ -11,7 +12,7 @@ interface IFireworkSDKModule extends NativeModule {
|
|
|
11
12
|
setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;
|
|
12
13
|
trackPurchase(parameters: TrackPurchaseParameters): void;
|
|
13
14
|
changeAppLanguage(language: string): Promise<boolean>;
|
|
14
|
-
restart(): Promise<
|
|
15
|
+
restart(): Promise<any>;
|
|
15
16
|
}
|
|
16
17
|
declare const FireworkSDKModuleEventEmitter: NativeEventEmitter;
|
|
17
18
|
export { FireworkSDKModuleEventEmitter };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-firework-sdk",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.5",
|
|
4
4
|
"description": "Firework React Native SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -18,13 +18,15 @@
|
|
|
18
18
|
"!ios/build",
|
|
19
19
|
"!**/__tests__",
|
|
20
20
|
"!**/__fixtures__",
|
|
21
|
-
"!**/__mocks__"
|
|
21
|
+
"!**/__mocks__",
|
|
22
|
+
"!docs/"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
25
|
"test": "jest",
|
|
25
26
|
"typescript": "tsc --noEmit",
|
|
26
27
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
27
|
-
"prepare": "bob build"
|
|
28
|
+
"prepare": "bob build",
|
|
29
|
+
"generate-doc": "rm -rf docs && npx typedoc"
|
|
28
30
|
},
|
|
29
31
|
"keywords": [
|
|
30
32
|
"react-native",
|
|
@@ -57,7 +59,8 @@
|
|
|
57
59
|
"react": "17.0.2",
|
|
58
60
|
"react-native": "0.66.4",
|
|
59
61
|
"react-native-builder-bob": "^0.18.0",
|
|
60
|
-
"
|
|
62
|
+
"typedoc": "^0.23.27",
|
|
63
|
+
"typescript": "^4.6.2"
|
|
61
64
|
},
|
|
62
65
|
"peerDependencies": {
|
|
63
66
|
"react": "*",
|