Skip to content

Commit

Permalink
Update sample codes for v2.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
linjie-firework committed Apr 18, 2024
1 parent 3abd376 commit 1628171
Show file tree
Hide file tree
Showing 614 changed files with 882 additions and 665 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## [2.8.1]

### Fixed

- [Android] [SingleTask Activity is launched in their own affinities](https://groups.google.com/g/ima-sdk/c/PfAnye3Hhww/m/08N6YyFsBAAJ), which is caused by [the Google IMA SDK v3.32.0](https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/history)

## [2.8.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion FireworkFlutterSDKSample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "2.8.0"
versionName "2.8.1"
}

compileOptions {
Expand Down
44 changes: 22 additions & 22 deletions FireworkFlutterSDKSample/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PODS:
- AmazonIVSPlayer (1.8.3)
- FirebaseCore (10.23.0):
- FirebaseCore (10.24.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreExtension (10.23.0):
- FirebaseCoreExtension (10.24.0):
- FirebaseCore (~> 10.0)
- FirebaseCoreInternal (10.23.0):
- FirebaseCoreInternal (10.24.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseCrashlytics (10.23.0):
- FirebaseCrashlytics (10.24.0):
- FirebaseCore (~> 10.5)
- FirebaseInstallations (~> 10.0)
- FirebaseRemoteConfigInterop (~> 10.23)
Expand All @@ -17,31 +17,31 @@ PODS:
- GoogleUtilities/Environment (~> 7.8)
- nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesObjC (~> 2.1)
- FirebaseInstallations (10.23.0):
- FirebaseInstallations (10.24.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebaseRemoteConfigInterop (10.23.0)
- FirebaseSessions (10.23.0):
- FirebaseRemoteConfigInterop (10.24.0)
- FirebaseSessions (10.24.0):
- FirebaseCore (~> 10.5)
- FirebaseCoreExtension (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleDataTransport (~> 9.2)
- GoogleUtilities/Environment (~> 7.10)
- nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesSwift (~> 2.1)
- FireworkVideo (1.20.1)
- FireworkVideo (1.20.2)
- FireworkVideoIVSSupport (0.4.0):
- AmazonIVSPlayer (~> 1.8.3)
- FireworkVideoUI (0.1.0):
- FireworkVideo
- Flutter (1.0.0)
- FMDB (2.7.9):
- FMDB/standard (= 2.7.9)
- FMDB/standard (2.7.9)
- FMDB (2.7.10):
- FMDB/standard (= 2.7.10)
- FMDB/standard (2.7.10)
- fw_flutter_sdk (1.0.0):
- FireworkVideo (= 1.20.1)
- FireworkVideo (= 1.20.2)
- FireworkVideoUI (= 0.1.0)
- Flutter
- GoogleDataTransport (9.4.1):
Expand Down Expand Up @@ -120,19 +120,19 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
AmazonIVSPlayer: ce792b427a4fe466d6ea32b3ce8abe391d9242d0
FirebaseCore: 63efb128decaebb04c4033ed4e05fb0bb1cccef1
FirebaseCoreExtension: cb88851781a24e031d1b58e0bd01eb1f46b044b5
FirebaseCoreInternal: 6a292e6f0bece1243a737e81556e56e5e19282e3
FirebaseCrashlytics: b7aca2d52dd2440257a13741d2909ad80745ac6c
FirebaseInstallations: 42d6ead4605d6eafb3b6683674e80e18eb6f2c35
FirebaseRemoteConfigInterop: cbc87ffa4932719a7911a08e94510f18f026f5a7
FirebaseSessions: f06853e30f99fe42aa511014d7ee6c8c319f08a3
FireworkVideo: 138be8b4f5a4a8c57151e553cb2496ad7ea3925d
FirebaseCore: 11dc8a16dfb7c5e3c3f45ba0e191a33ac4f50894
FirebaseCoreExtension: af5fd85e817ea9d19f9a2659a376cf9cf99f03c0
FirebaseCoreInternal: bcb5acffd4ea05e12a783ecf835f2210ce3dc6af
FirebaseCrashlytics: af38ea4adfa606f6e63fcc22091b61e7938fcf66
FirebaseInstallations: 8f581fca6478a50705d2bd2abd66d306e0f5736e
FirebaseRemoteConfigInterop: 6c349a466490aeace3ce9c091c86be1730711634
FirebaseSessions: 2651b464e241c93fd44112f995d5ab663c970487
FireworkVideo: 28bbdef4c9dabb06d454fab56d2e22ac7c26b54e
FireworkVideoIVSSupport: c75d204e55afab922899e2ff90242a5ec6d4ad20
FireworkVideoUI: af83909d6d20c0d8158221cdd716c1c1f5afac8d
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
FMDB: aa44149f6fb634b1ac54f64f47064bb0d0c5a032
fw_flutter_sdk: 6e7af165e798caf0136fcbfd79a2a9fe54e56575
FMDB: eae540775bf7d0c87a5af926ae37af69effe5a19
fw_flutter_sdk: b425498fbc092d898236f3f1863b2908f03f1a8b
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: d053d902a8edaa9904e1bd00c37535385b8ed152
nanopb: 438bc412db1928dac798aa6fd75726007be04262
Expand Down
8 changes: 4 additions & 4 deletions FireworkFlutterSDKSample/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.8.1;
PRODUCT_BUNDLE_IDENTIFIER = com.loopnow.fondor;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = fondor;
Expand Down Expand Up @@ -521,7 +521,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.8.1;
PRODUCT_BUNDLE_IDENTIFIER = com.loopnow.fondor;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = fondor;
Expand Down Expand Up @@ -658,7 +658,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.8.1;
PRODUCT_BUNDLE_IDENTIFIER = com.loopnow.fondor;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -687,7 +687,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.8.1;
PRODUCT_BUNDLE_IDENTIFIER = com.loopnow.fondor;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = fondor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ feedId: $feedId""");
extension VideoFeedClickEventExtension on VideoFeedClickEvent {
void logMessage() {
final id = info.id;
final feedId = info.feedId;
final duration = info.duration;
final index = info.index;
final title = info.title;
Expand All @@ -54,6 +55,7 @@ extension VideoFeedClickEventExtension on VideoFeedClickEvent {
final dynamicContentParameters = info.dynamicContentParameters;

FWExampleLoggerUtil.log("""onVideoFeedClick id: $id
feedId: $feedId
duration: $duration
index: $index
title: $title
Expand Down
12 changes: 8 additions & 4 deletions FireworkFlutterSDKSample/lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ class MessageLookup extends MessageLookupByLibrary {

static String m5(min, max) => "Please enter height in [${min}, ${max}]";

static String m6(url) => "The page url is ${url}.";
static String m6(url, iOSUrl, androidUrl) =>
"The base url is ${url}.\nThe iOS url is ${iOSUrl}.\nThe Android url is ${androidUrl}.";

static String m7(min, max) => "Please enter width in [${min}, ${max}]";
static String m7(url) => "The page url is ${url}.";

static String m8(min, max) => "Please enter width in [${min}, ${max}]";

final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
Expand Down Expand Up @@ -223,6 +226,7 @@ class MessageLookup extends MessageLookupByLibrary {
"loop": MessageLookupByLibrary.simpleMessage("loop"),
"more": MessageLookupByLibrary.simpleMessage("More"),
"multiFeeds": MessageLookupByLibrary.simpleMessage("Multi-feeds"),
"multiplePageUrlsToastText": m6,
"muteOnFirstLaunch":
MessageLookupByLibrary.simpleMessage("muteOnFirstLaunch"),
"name": MessageLookupByLibrary.simpleMessage("Name"),
Expand All @@ -238,7 +242,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Please enter grid columns in [1, 5]"),
"open": MessageLookupByLibrary.simpleMessage("Open"),
"openVideoURL": MessageLookupByLibrary.simpleMessage("Open Video URL"),
"pageUrlToastText": m6,
"pageUrlToastText": m7,
"pause": MessageLookupByLibrary.simpleMessage("Pause"),
"percentage": MessageLookupByLibrary.simpleMessage("percentage"),
"play": MessageLookupByLibrary.simpleMessage("Play"),
Expand Down Expand Up @@ -483,6 +487,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Video Launch Behavior"),
"widthError":
MessageLookupByLibrary.simpleMessage("Please enter correct width"),
"widthRangeError": m7
"widthRangeError": m8
};
}
11 changes: 11 additions & 0 deletions FireworkFlutterSDKSample/lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion FireworkFlutterSDKSample/lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,6 @@
"shadowHeightHint": "e.g. 0",
"shadowHeightError": "Please enter correct shadow height",
"shadowHeightRangeError": "Please enter shadow height in [0, 100]",
"pageUrlToastText": "The page url is {url}."
"pageUrlToastText": "The page url is {url}.",
"multiplePageUrlsToastText": "The base url is {url}.\nThe iOS url is {iOSUrl}.\nThe Android url is {androidUrl}."
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,21 @@ class _StoryBlockConfigurationScreenState
const SizedBox(
height: 20,
),
if (defaultTargetPlatform == TargetPlatform.android)
Row(
children: [
Expanded(
child: _buildMuteButtonShow(context),
),
Row(
children: [
Expanded(
child: _buildPlaybackButtonShow(context),
),
if (defaultTargetPlatform == TargetPlatform.android)
const SizedBox(
width: 20,
),
if (defaultTargetPlatform == TargetPlatform.android)
Expanded(
child: _buildPlaybackButtonShow(context),
child: _buildMuteButtonShow(context),
),
],
),
],
),
const SizedBox(
height: 20,
),
Expand Down
80 changes: 71 additions & 9 deletions FireworkFlutterSDKSample/lib/screens/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart';
import 'package:fw_flutter_sdk/fw_flutter_sdk.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fw_flutter_sdk_example/utils/host_app_service.dart';

import '../../extensions/fw_error_extension.dart';
import '../../generated/l10n.dart';
Expand Down Expand Up @@ -359,10 +360,25 @@ class _HomeScreenState extends State<HomeScreen> {
List<Widget> _buildMultiFeeds(BuildContext context) {
List<Widget> widgetList = <Widget>[];

var storyBlockIndex = 0;

for (var e in _defaultHomeStoryBlockPlaylistInfoArray) {
storyBlockIndex++;
final title = "Story Block $storyBlockIndex";
FWExampleLoggerUtil.log(
"_buildMultiFeeds channelId: ${e.channelId} playlistId: ${e.playlistId}");
widgetList.addAll([
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Text(
title,
style: const TextStyle(
fontSize: 20,
),
),
),
const SizedBox(
height: 20,
),
Expand All @@ -380,6 +396,12 @@ class _HomeScreenState extends State<HomeScreen> {
FWExampleLoggerUtil.log(
"onStoryBlockEmpty error ${error?.displayString()}");
},
onStoryBlockGetFeedId: (feedId) {
HostAppService.getInstance().widgetInfoMap[feedId] = WidgetInfo(
title: title,
type: "StoryBlock",
);
},
),
),
const SizedBox(
Expand All @@ -389,15 +411,52 @@ class _HomeScreenState extends State<HomeScreen> {
const SizedBox(
height: 20,
),
_buildListItemPlaceholder(context),
const SizedBox(
height: 20,
),
]);
}

Map<String, WidgetInfo> globalWidgetInfoMap = {};
VideoFeed(
height: 220,
source: VideoFeedSource.playlist,
channel: "your encoded channel id",
playlist: "your encoded playlist id",
enablePictureInPicture: true,
onVideoFeedGetFeedId: (feedId) {
globalWidgetInfoMap[feedId] = WidgetInfo(
title: "VideoFeed 1",
type: "VideoFeed",
);
},
);
StoryBlock(
cornerRadius: 20,
height: 400,
source: StoryBlockSource.playlist,
channel: "your encoded channel id",
playlist: "your encoded playlist id",
enablePictureInPicture: true,
onStoryBlockGetFeedId: (feedId) {
globalWidgetInfoMap[feedId] = WidgetInfo(
title: "StoryBlock 1",
type: "StoryBlock",
);
},
);
var videoFeedIndex = 0;
for (var e in _defaultHomeVideoFeedPlaylistInfoArray) {
videoFeedIndex++;
final title = "Video Feed $videoFeedIndex";
widgetList.addAll([
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Text(
title,
style: const TextStyle(
fontSize: 20,
),
),
),
const SizedBox(
height: 20,
),
Expand All @@ -412,6 +471,13 @@ class _HomeScreenState extends State<HomeScreen> {
channel: e.channelId,
playlist: e.playlistId,
enablePictureInPicture: _enablePip,
onVideoFeedGetFeedId: (feedId) {
FWExampleLoggerUtil.log("onVideoFeedGetFeedId feedId: $feedId");
HostAppService.getInstance().widgetInfoMap[feedId] = WidgetInfo(
title: title,
type: "VideoFeed",
);
},
),
),
const SizedBox(
Expand All @@ -421,10 +487,6 @@ class _HomeScreenState extends State<HomeScreen> {
const SizedBox(
height: 20,
),
_buildListItemPlaceholder(context),
const SizedBox(
height: 20,
),
]);
}

Expand Down
Loading

0 comments on commit 1628171

Please sign in to comment.