shorebird_downloader

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

shorebird downloader

shorebird_downloader #
This is a plug-in that supports Shorebird to customize the patch download address and to keep an eye on the download progress.
Of course, in addition to the download function, you still need to get the other patch status related to Shorebird through the shorebird_code_push plugin.
⚠️ At present, an error will be reported when downloading the Android patch through this library and starting it. -> https://github.com/shorebirdtech/shorebird/issues/1449
How To install #
flutter pub add shorebird_downloader
copied to clipboard
How to use #
Now you can use the following methods to detect patches, download, pop-up prompts to restart, etc.
ShorebirdCheckDownloader(
customShowUpdateDialog: (currentPatchNumber, nextPatchNumber) =>
ShorebirdCheckDownloader.showUpdateDialog(
Get.context!,
currentPatchNumber,
nextPatchNumber,
),
).checkPatch();
copied to clipboard
final downloader =
ShorebirdUrlDownloader(appid: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
await downloader.downloadPatch((size,totol) => print("$size/$totol"));
copied to clipboard
How to custom download url #
If you feel that shorebird's CDN access is still slow or inaccessible, you can upload the patch to your own server in advance.
You can customize the following code to implement it.
class ShorebirdCustomUrlDownloader extends ShorebirdDownloader {
ShorebirdUrlDownloader({required super.appid});

@override
Future<Patch?> requestPatchInfo() async {

// TODO: http request custom your server url
// [number] represents the latest patch number
// [downloadUrl] represents the latest patch number
return Patch(number: number, downloadUrl: downloadUrl);
}
}
copied to clipboard
Then you can use it as usual.
final downloader =
ShorebirdCustomUrlDownloader(appid: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
await downloader.downloadPatch((size,totol) => print("$size/$totol"));
copied to clipboard
uploader #
We now support uploading to the Appwrite server
install uploader #
dart pub global activate shorebird_downloader
copied to clipboard
uploader to appwrite server #
The first step is to configure your factory files
# pubspec.yaml
appwrite:
key: xxxxxx
projectId: xxxxx
bucketId: xxxx
copied to clipboard
# shorebird.yaml
app_id: xxxxx
copied to clipboard
You can use the following command to upload the latest patch to Appwrite.
# in current shorebird project
shorebird_patch_uploader appwrite --platform [ios/android]
copied to clipboard
To download updates directly from appwrite, you need to use the following code
final downloader =
ShorebirdAppwriteDownloader(
appid: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
projectId: 'xxxxx',
bucketId: 'bucketId',
key: 'key',
// endPoint: 'custom appwrite endpoint normal is https://cloud.appwrite.io/v1'
);
await downloader.downloadPatch((size,totol) => print("$size/$totol"));
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.

Related Products

More From This Creator