Repository navigation
Releases: shoplive/shoplive-sdk-flutter
Release list
3.0.3
Shoplive SDK for Flutter 3.0.3 is built on Shoplive Android SDK 3.0.3 and iOS SDK 3.0.3.
There is no Dart breaking change from 3.0.2. Update all three packages to the same version.
Highlights
- Streamer web page.
ShopliveStreamer.instance.start(campaignKey, webPageUrl: ...)shows a web page when the broadcaster swipes on the broadcast screen (Android and iOS). The URL must start withhttp://orhttps://and have a host. An invalid URL fails withINVALID_ARGUMENTbefore the broadcast screen opens.nullkeeps the 3.0.2 behavior. - PIP drag-out to close. New
ShoplivePipOptions.isDragOutToCloseEnabledsets whether the in-app PIP window closes when it is dragged off the screen (Android and iOS). If you omit it, the current value stays (SDK default:true). - Player restart fix.
startwhile a session is open (or afterclose) now opens a new player with the configuration of that call. Before, Android reused the previous player and ignored the new settings (for example, alivestart after apreviewsession showed a black preview screen). iOS now also closes the current player and opens a new one. To change the campaign and keep the current settings, useplay. - Same coupon / custom-action default on both platforms. If you omit
alertTypeinrespond, both platforms now usetoast. Before, Android sent no value.
Changes
shoplive_core
ShopliveConfiguration.appVersionis deprecated and ignored. SDK 3.0.3 reads the app version itself. A warning is logged if you set it.ShopliveError.rawCodeis now set on both platforms.- Error
codevalues are the SDK 3.0.3 constant names. Android 3.0.3 removedNOT_INITIALIZED_CONFIGandNOT_INITIALIZED_CAMPAIGN_KEYand added new codes (for example,AUTHENTICATION_FAILEDandPIP_*). Treatcodeas an opaque string.
shoplive_player
- Added
ShoplivePipOptions.isDragOutToCloseEnabled.getConfiguration()returns it. - Fixed:
starton an open session now applies the new configuration (see Highlights). - iOS:
ShoplivePlayerType.previewalso sets the SDK 3.0.3ShoplivePlayerConfiguration.type. - Error events:
rawCodeis now always set on iOS. The event keys (code,message,rawCode,recoverable) are unchanged. - An omitted
alertTypenow meanstoaston both platforms. The fallback result is unchanged (success: false, status: keep, alertType: toast).
shoplive_streamer
- Added the named parameter
webPageUrltostart. - Error events:
rawCodeis now always set on iOS.
Note
Existing calls to start still compile. But if your test double implements ShopliveStreamer and overrides start(String), change its signature to start(String campaignKey, {String? webPageUrl}).
Installation
dependencies:
shoplive_player: 3.0.3 # player, includes shoplive_core
# shoplive_streamer: 3.0.3 # broadcast, includes shoplive_coreRequirements
No change from 3.0.2.
| Minimum | |
|---|---|
| Flutter / Dart | 3.22 / 3.4 |
| Android Gradle Plugin / Gradle / JDK | 8.7 / 8.9 / 17 |
| Android minSdk / compileSdk | 23 / 36 |
| iOS | 15.0 (Xcode with Swift 5.9 or later) |
Upgrade notes
Android
- The SDK 3.0.3 artifacts are only in
https://sdk.shoplive.cloud/maven-repo(not in Maven Central). Keep theexclusiveContentrule for thecloud.shoplivegroup. Theshoplive-media3conflict of 3.0.2 no longer applies.
iOS
- During
pod install, the plugins download the iOS SDK 3.0.3 XCFrameworks and verify the new sha256 checksums. Runpod install(orflutter run) again after you update.
For the full list, refer to the CHANGELOG of each package: shoplive_core · shoplive_player · shoplive_streamer.
Links
- Integration guide: https://developer.shoplive.cloud/mobile
- Native SDK release notes: Android · iOS
- Contact: ask@shoplive.cloud
Full Changelog: 3.0.2...3.0.3
1.9.0
What's changed
- Updated Shoplive iOS/Android SDK from 1.8.13 to 1.9.0.
- Android:
shoplive_sdk_version1.9.0, ExoPlayer2.19.1.20 - iOS:
ShopLiveandShopliveSDKCommon1.9.0
- Android:
- Removed the shortform API. Shortform is not in SDK 1.9.0. The
ShopLiveShortformclass and its data classes are removed, and the plugin no longer depends on the Shoplive shortform SDK (ShopliveShortformSDKon iOS,shoplive-short-formon Android). - Minimum iOS version is now 15.0 (was 11.0).
Breaking changes
- If your app uses
ShopLiveShortform, remove that code before you upgrade, or stay on 1.8.14. - Set
platform :ios, '15.0'inios/Podfile.
Required setup
Android
-
The plugin now gets the SDK from
https://sdk.shoplive.cloud/maven-repo. If your project declares repositories itself, add this repository:allprojects { repositories { google() mavenCentral() maven { url = uri("https://sdk.shoplive.cloud/maven-repo") } } }
Installation
dependencies:
shoplive_player: ^1.9.0Note
1.9.0 is a maintenance release of the 1.x line. For new integrations, use 3.0.3.
Full Changelog: 1.8.14...1.9.0
pub.dev: https://pub.dev/packages/shoplive_player/versions/1.9.0
1.8.14
What's changed
- Added
ShopLivePlayer.setResizeMode(). It passes the nativesetResizeModeAPI through for the live player (ShopLiveResizeMode.auto/centerCrop/fit). - Updated Shoplive iOS/Android SDK from 1.8.11 to 1.8.13.
Example
final player = ShopLivePlayer();
player.setResizeMode(mode: ShopLiveResizeMode.centerCrop);
player.play(data: ShopLivePlayerData(campaignKey: '<campaign key>'));Installation
dependencies:
shoplive_player: ^1.8.14Note
The native ShopLiveResizeMode enums declare their values in a different order on iOS and Android. For this reason, the plugin sends the value as a name string, not as an integer. You only use the Dart enum. No other step is necessary.
Full Changelog: 1.8.13...1.8.14
pub.dev: https://pub.dev/packages/shoplive_player/versions/1.8.14
3.0.2
Shoplive SDK for Flutter 3.0.2 is built on Shoplive Android SDK 3.0.2 and iOS SDK 3.0.2.
Important
This is a major rewrite. The 1.x Dart API is removed. To upgrade from 1.x, read Migrating from 1.x before you update your dependencies.
Highlights
-
Three packages. Add only the packages your app needs. All three must use the same version.
Package Provides shoplive_coreShoplive.initialize, user, stream token, logout, conversion eventsshoplive_playerShoplivePlayerlive/VOD player (re-exportsshoplive_core)shoplive_streamerShopliveStreamerbroadcast (re-exportsshoplive_core)An app that only plays videos adds only
shoplive_player. The streamer binaries are then not included in the app. -
Async API with typed errors. All methods return a
Future. Failures throw aPlatformExceptionwith a code:INVALID_ARGUMENT,NO_HOST_SCREEN,NOT_RUNNINGorSDK_ERROR. In 1.x, somevoidmethods ignored errors. -
Coupon and custom-action responses. Listen to
couponRequests/customWebActionRequestsand callrequest.respond(...). In 1.x, coupon requests got no response. Custom actions are no longer answered with success automatically: if there is no listener, or norespondbefore the timeout (default 10 s, range 1–120 s), the SDK receivessuccess: false. -
Configuration.
start/setConfigurationmerge the given configuration with the current settings. The newgetConfigurationreturns the current settings. -
In-app PIP fixes on Android.
- Playback no longer stops when the player changes from fullscreen to in-app PIP on a default
FlutterActivityhost. You do not need to changeMainActivity. - The
ClassCastExceptionduring the PIP transition is fixed.
- Playback no longer stops when the player changes from fullscreen to in-app PIP on a default
-
Streamer.
shoplive_streameris now a separate package (it was part ofshoplive_player).
Installation
dependencies:
shoplive_player: 3.0.2 # player, includes shoplive_core
# shoplive_streamer: 3.0.2 # broadcast, includes shoplive_coreimport 'package:shoplive_player/shoplive_player.dart';
await Shoplive.initialize(const ShopliveConfiguration(accessKey: 'YOUR_ACCESS_KEY'));
await Shoplive.setUser(const ShopliveUser.guest());
final player = ShoplivePlayer.instance;
player.events.listen((event) { /* ShoplivePlayerEvent */ });
await player.start('CAMPAIGN_KEY');Requirements
| Minimum | |
|---|---|
| Flutter / Dart | 3.22 / 3.4 |
| Android Gradle Plugin / Gradle / JDK | 8.7 / 8.9 / 17 |
| Android minSdk / compileSdk | 23 / 36 |
| iOS | 15.0 (Xcode with Swift 5.9 or later) |
Required setup
Android
- The plugins get the SDK from
https://sdk.shoplive.cloud/maven-repo. If your project declares repositories itself, restrict thecloud.shoplivegroup to that repository withexclusiveContent. Maven Central has a conflictingshoplive-media3:1.10.1.2. Refer to "Android: Maven repository setup" in the package README. - For in-app PIP to continue as system PIP when the app goes to the background, add
android:supportsPictureInPicture="true"to your host Activity. If you do not, the player reportsPIP_ACTIVITY_NOT_DECLARED.
iOS
- Set
platform :ios, '15.0'inios/Podfile. Duringpod install, the plugins download the iOS SDK 3.0.2 XCFrameworks and verify their sha256 checksums. If you runpod installmanually, use a UTF-8 locale (for example,LANG=en_US.UTF-8). - If you use
shoplive_streamer, addNSCameraUsageDescriptionandNSMicrophoneUsageDescriptiontoInfo.plist. If they are missing, iOS terminates the app when the broadcast screen requests the camera.
Streamer
- Call
Shoplive.setStreamToken(token)beforeShopliveStreamer.instance.start. Without a token, the server returns no ingest address and the broadcast screen shows a "failed to start" dialog.
Migrating from 1.x
Breaking changes:
- The 1.x Dart API (
ShopLivePlayer,ShopLiveCommonand their data and event classes) is removed. Class names change fromShopLive*toShoplive*. ShopLiveCommon(setAccessKey,setAuth,setAuthToken,setUser,setUtm*,clearAuth) is replaced byShoplive.initialize,setUser,setStreamToken,logoutandsendConversionEvent. The profileidis now required.- The Shortform API is removed. Shortform is not available in SDK 3.x.
showPreviewis replaced bystartwithpresentationStyle: pipandconfiguration.type: preview.- These APIs have no SDK 3.0.2 equivalent and are removed:
closeButtonConfig,hidePreview, thepreviewClosestream, and the preview optionspipRadius,enableSwipeOutandpipMaxSize.setResizeModenow supports onlyfillandfit. sendDownloadCouponResult/sendCustomActionResultare replaced byrespondon the request objects.getSdkVersion()moved toShoplive.getSdkVersion().- Sharing: use
configuration.navigation.shareScheme. SDK 3.x has no share handler.
Steps:
- Update your code with the migration table in the
shoplive_playerREADME. - Run
flutter cleanonce after you upgrade. If you do not, old 1.x iOS build products cause the error "'ShoplivePlayerPlugin' has different definitions in different modules".
Known limitations
- You cannot reset nullable settings (
navigation.shareScheme,android.isVolumeKeyEnabled) tonullfrom Dart. - After the Flutter engine is detached and attached again, you cannot control a session that the previous engine left open.
- The streamer does not expose appearance options or the headless streamer API.
For the full list, refer to the CHANGELOG of each package: shoplive_core · shoplive_player · shoplive_streamer.
Links
- Integration guide: https://developer.shoplive.cloud/mobile
- Native SDK release notes: Android · iOS
- Contact: ask@shoplive.cloud
Full Changelog: 1.8.14...3.0.2
1.8.13
What's changed
- Updated Shoplive iOS/Android SDK from 1.8.10 to 1.8.11.
- Android:
shoplive_sdk_version1.8.11, ExoPlayer2.19.1.19 - iOS:
ShopLive,ShopliveSDKCommonandShopliveShortformSDK1.8.11
- Android:
There is no Dart API change.
Installation
dependencies:
shoplive_player: ^1.8.13pub.dev: https://pub.dev/packages/shoplive_player/versions/1.8.13