Files
react-native-code-push/windows/CodePush.Shared/CodePushConstants.cs
Alexander Bodalevsky be96f07eda Added React Native Windows dotNet46 support (#684)
Added support react-native-windows dotNet
Added example for react-native-windows UWP based
Added example for react-native-windows dotNet based

Project structure:

CodePush.Shared - shared code between UWP and dotNet
CodePush - UWP specific code
CodePush.Net46 - dotNet specific code

For UWP solution it needs to be added the following projects:

CodePush.Shared
CodePush
For dotNet solution it needs to be added the following projects:

CodePush.Shared
CodePush.Net46
Examples:

Examples\CodePushDemoApp\windows\CodePushDemoApp.sln the solution contains both examples (UWP and dotNet).

Notes

Example for ARM configuration has not been tested. Since there is no changes in UWP part of implementation, there is low risk of failure.

In this implementation we tried to reuse UWP library as much as possible. The following issues are relevant for both platforms:

ZipFile.ExtractToDirectory is not reliable and throws exception if:
folder exists already
path is too long (> 250 chars)
Un-zipping is quite long operation. Does it make sense for async?
await UpdateUtils.UnzipBundleAsync(downloadFile.Path, unzippedFolder.Path);
2017-02-13 16:23:20 -08:00

36 lines
2.0 KiB
C#

namespace CodePush.ReactNative
{
internal class CodePushConstants
{
internal const string BinaryModifiedTimeKey = "binaryModifiedTime";
internal const string CodePushServerUrl = "https://codepush.azurewebsites.net/";
internal const string CodePushFolderPrefix = "CodePush";
internal const string CodePushPreferences = "CodePush";
internal const string CurrentPackageKey = "currentPackage";
internal const string DefaultJsBundleName = "index.windows.bundle";
internal const string DiffManifestFileName = "hotcodepush.json";
internal const string DownloadFileName = "download.zip";
internal const string DownloadProgressEventName = "CodePushDownloadProgress";
internal const string DownloadUrlKey = "downloadUrl";
internal const string FailedUpdatesKey = "CODE_PUSH_FAILED_UPDATES";
internal const string PackageFileName = "app.json";
internal const string PackageHashKey = "packageHash";
internal const string PendingUpdateHashKey = "hash";
internal const string PendingUpdateKey = "CODE_PUSH_PENDING_UPDATE";
internal const string PendingUpdateIsLoadingKey = "isLoading";
internal const string PreviousPackageKey = "previousPackage";
// This needs to be kept in sync with https://github.com/ReactWindows/react-native-windows/blob/master/ReactWindows/ReactNative/DevSupport/DevSupportManager.cs#L22
internal const string ReactDevBundleCacheFileName = "ReactNativeDevBundle.js";
internal const string ReactNativeLogCategory = "ReactNative";
internal const string RelativeBundlePathKey = "bundlePath";
internal const string StatusFileName = "codepush.json";
internal const string UnzippedFolderName = "unzipped";
#if WINDOWS_UWP
internal const string AssetsBundlePrefix = "ms-appx:///ReactAssets/";
internal const string FileBundlePrefix = "ms-appdata:///local";
#else
internal const string AssetsBundlePrefix = "ReactAssets/";
#endif
}
}