GithubHelp home page GithubHelp logo

nativescript / nativescript-app-sync Goto Github PK

View Code? Open in Web Editor NEW
124.0 13.0 24.0 19.64 MB

♻️ Update your app without going through the app store!

License: MIT License

Shell 0.54% TypeScript 7.22% JavaScript 3.75% Java 1.68% Objective-C 11.87% C 74.62% CSS 0.11% HTML 0.20%
nativescript nativescript-plugin codepush

nativescript-app-sync's Introduction

NativeScript AppSync plugin

Build Status NPM version Downloads Twitter Follow

A live-update service for your NativeScript apps!

📣 NOTE: NativeScript AppSync is currently in beta and is not supported by the core NativeScript team. AppSync is based on Microsoft CodePush and we owe them thanks because this solution builds upon their work. ❤️

Optional reading: what this is, and how it works

A NativeScript app is composed of XML/HTML, CSS and JavaScript files and any accompanying images, which are bundled together by the NativeScript CLI and distributed as part of a platform-specific binary (i.e. an .ipa or .apk file). Once the app is released, updating either the code (e.g. making bug fixes, adding new features) or image assets, requires you to recompile and redistribute the entire binary, which of course, includes any review time associated with the store(s) you are publishing to.

The AppSync plugin helps get product improvements in front of your end users instantly, by keeping your code and images synchronized with updates you release to the AppSync server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available. It's a win-win!

In order to ensure that your end users always have a functioning version of your app, the AppSync plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to roll back on the server. It's a win-win-win!

Architectural overview of the solution - you don't need to worry about all of this

What can (and will) be AppSync'ed?

  • Anything inside your /app folder (but not the App_Resources folder).
  • Anything inside your /node_modules folder.

💁‍♂️ Note that we don't actually use those folders, but the app folder in platforms/ios/<appname>/app and platforms/android/app/src/main/assets/app, the benefit of which is we don't "care" if you use Webpack or Uglify or whatever tools you use to minify or scramble your app's assets.

What can't (and won't):

  • NativeScript platform updates. Example: bumping tns-android from version 2.5.1 to 2.5.2.
  • Plugins updates that also require a different version of a native library it depends on.
  • Contents of the App_Resources folder, because those are part of the native binary as well.

So as long as you don't change versions of dependencies and tns platforms in your package.json you can push happily. And if you do bump a version of a dependency make sure there are no changed platform libraries.

Getting Started

Globally install the NativeScript AppSync CLI

npm i -g nativescript-app-sync-cli

💁‍♂️ This will also add the global nativescript-app-sync command to your machine. You can check the currently installed version with nativescript-app-sync -v.

Login or register with the service

Check if you're already logged in, and with which email address:

nativescript-app-sync whoami

Log in if you already have an account:

nativescript-app-sync login

Register if you don't have an account yet:

nativescript-app-sync register

This will open a browser where you can provide your credentials, after which you can create an access key that you can paste in the console.

You should now have a .nativescript-app-sync.config file in your home folder which will automatically authenticate you with the server on this machine from now on.

Note that you could use a that web interface for managing you apps, but the CLI is much more sophisticated, so it's recommended to use the command line interface.

To log out, you can run nativescript-app-sync logout which will also remove the config file.

To perform a headless login (without opening a browser), you can do: nativescript-app-sync login --accessKey <access key>.

Register your app with the service

Create an app for each platform you target. That way you can roll out release seperately for iOS and Android.

⚠️ The appname must be unique, and should not contain dashes (-).

nativescript-app-sync app add <appname> <platform>

# examples:
nativescript-app-sync app add MyAppIOS ios
nativescript-app-sync app add MyAppAndroid android

💁‍♂️ This will show you your deployment keys you'll need when connecting to the AppSync server. If you want to list those keys at any later time, use nativescript-app-sync deployment ls <appName> --displayKeys.

💁‍♂️ All new apps automatically come with two deployments (Staging and Production) so that you can begin distributing updates to multiple channels. If you need more channels/deployments, simply run: nativescript-app-sync deployment add <appName> <deploymentName>.

💁‍♂️ Want to rename your app? At any time, use the command: nativescript-app-sync app rename <oldName> <newName>

💁‍♂️ Want to delete an app? At any time, use the command: nativescript-app-sync app remove <appName> - this means any apps that have been configured to use it will obviously stop receiving updates.

List your registered apps

nativescript-app-sync app ls

Add this plugin to your app

tns plugin add nativescript-app-sync

⚠️ If you're restricting access to the internet from within your app, make sure you whitelist our AppSync server (https://appsync-server.nativescript.org) and File server (https://s3.eu-west-1.amazonaws.com).

Checking for updates

With the AppSync plugin installed and configured, the only thing left is to add the necessary code to your app to control when it checks for updates.

If an update is available, it will be silently downloaded, and installed.

Then based on the provided InstallMode the plugin either waits until the next cold start (InstallMode.ON_NEXT_RESTART), warm restart (InstallMode.ON_NEXT_RESUME), or a positive response to a user prompt (InstallMode.IMMEDIATE).

Note that Apple doesn't want you to prompt the user to restart your app, so use InstallMode.IMMEDIATE on iOS only for Enterprise-distributed apps (or when testing your app through TestFlight for instance).

💁‍♂️ Check out the demo for a solid example.

// import the main plugin classes
import { AppSync } from "nativescript-app-sync";

// and at some point in your app:
AppSync.sync({
  deploymentKey: "your-deployment-key" // note that this key depends on the platform you're running on (see the example below)
});

There's a few things you can configure - this TypeScript example has all the possible options:

import { AppSync, InstallMode, SyncStatus } from "nativescript-app-sync";
import { isIOS } from "tns-core-modules/platform";

AppSync.sync({
    enabledWhenUsingHmr: false, // this is optional and by default false so AppSync and HMR don't fight over app updates
    deploymentKey: isIOS ? "your-ios-deployment-key" : "your-android-deployment-key",
    installMode: InstallMode.ON_NEXT_RESTART, // this is the default install mode; the app updates upon the next cold boot (unless the --mandatory flag was specified while pushing the update) 
    mandatoryInstallMode: isIOS ? InstallMode.ON_NEXT_RESUME : InstallMode.IMMEDIATE, // the default is InstallMode.ON_NEXT_RESUME which doesn't bother the user as long as the app is in the foreground. InstallMode.IMMEDIATE shows an installation prompt. Don't use that for iOS AppStore distributions because Apple doesn't want you to, but if you have an Enterprise-distributed app, go right ahead!
    updateDialog: { // only used for InstallMode.IMMEDIATE
      updateTitle: "Please restart the app", // an optional title shown in the update dialog 
      optionalUpdateMessage: "Optional update msg",   // a message shown for non-"--mandatory" releases 
      mandatoryUpdateMessage: "Mandatory update msg", // a message shown for "--mandatory" releases
      optionalIgnoreButtonLabel: "Later", // if a user wants to continue their session, the update will be installed on next resume
      mandatoryContinueButtonLabel: isIOS ? "Exit now" : "Restart now", // On Android we can kill and restart the app, but on iOS that's not possible so the user has to manually restart it. That's why we provide a different label in this example.
      appendReleaseDescription: true // appends the description you (optionally) provided when releasing a new version to AppSync
    }
  }, (syncStatus: SyncStatus, updateLabel?: string): void => {
    console.log("AppSync syncStatus: " + syncStatus);
    if (syncStatus === SyncStatus.UP_TO_DATE) {
      console.log(`AppSync: no pending updates; you're running the latest version, which is ${updateLabel}`);
    } else if (syncStatus === SyncStatus.UPDATE_INSTALLED) {
      console.log(`AppSync: update installed (${updateLabel}) - it will be activated upon next cold boot`);
    }
});
Click here to see a JavaScript example
var AppSync = require("nativescript-app-sync").AppSync;
var InstallMode = require("nativescript-app-sync").InstallMode;
var SyncStatus = require("nativescript-app-sync").SyncStatus;
var platform = require("tns-core-modules/platform");

AppSync.sync({
    enabledWhenUsingHmr: false, // this is optional and by default false so AppSync and HMR don't fight over app updates
    deploymentKey: platform.isIOS ? "your-ios-deployment-key" : "your-android-deployment-key",
    installMode: InstallMode.ON_NEXT_RESTART,
    mandatoryInstallMode: platform.isIOS ? InstallMode.ON_NEXT_RESUME : InstallMode.IMMEDIATE,
    updateDialog: {
      optionalUpdateMessage: "Optional update msg",
      updateTitle: "Please restart the app",
      mandatoryUpdateMessage: "Mandatory update msg",
      optionalIgnoreButtonLabel: "Later",
      mandatoryContinueButtonLabel: platform.isIOS ? "Exit now" : "Restart now",
      appendReleaseDescription: true // appends the description you (optionally) provided when releasing a new version to AppSync
    }
}, function (syncStatus, updateLabel) {
    if (syncStatus === SyncStatus.UP_TO_DATE) {
      console.log("AppSync: no pending updates; you're running the latest version, which is: " + updateLabel);
    } else if (syncStatus === SyncStatus.UPDATE_INSTALLED) {
      console.log("AppSync: update (" + updateLabel + ") installed - it will be activated upon next cold boot");
    }
});

When should this check run?

It's recommended to check for updates more than once in a cold boot cycle, so it may be easiest to tie this check to the resume event (which usually also runs on app startup):

import * as application from "tns-core-modules/application";
import { AppSync } from "nativescript-app-sync";

// add this in some central place that's executed once in a lifecycle
application.on(application.resumeEvent, () => {
  AppSync.sync(...);
});
Click here to see a JavaScript example
var application = require("tns-core-modules/application");

application.on(application.resumeEvent, function () {
  // call the sync function
});

Releasing an update

Once your app has been configured and distributed to your users, and you've made some code and/or asset changes, it's time to instantly unleash those changes onto your users!

⚠️ Make sure to create a release build first, so use the same command that you'd use for app store distribution, just don't send it to the AppStore. You can even Webpack and Uglify your app, it's all transparent to this plugin.

💁‍♂️ When releasing updates to AppSync, you do not need to bump your app's version since you aren't modifying the app store version at all. AppSync will automatically generate a "label" for each release you make (e.g. v3) in order to help identify it within your release history.

The easiest way to do this is to use the release command in our AppSync CLI. Its (most relevant) options are:

param alias default description
deploymentName d "Staging" Deploy to either "Staging" or "Production".
description des not set Description of the changes made to the app with this release.
targetBinaryVersion t App_Resources Semver expression that specifies the binary app version(s) this release is targeting (e.g. 1.1.0, ~1.2.3). The default is the exact version in App_Resources/iOS/Info.plist or App_Resources/Android/AndroidManifest.xml.
mandatory m not set This specifies whether or not the update should be considered "urgent" (e.g. it includes a critical security fix). This attribute is simply round tripped to the client, who can then decide if and how they would like to enforce it. If this flag is not set, the update is considered "not urgent" so you may choose to wait for the next cold boot of the app. It does not mean users get to 'opt out' from an update; all AppSync updates will eventually be installed on the client.

Have a few examples for both platforms:

iOS

nativescript-app-sync release <c-ios-appname> ios # deploy to Staging
nativescript-app-sync release <AppSync-ios-appname> ios --d Production # deploy to Production (default: Staging)
nativescript-app-sync release <AppSync-ios-appname> ios --targetBinaryVersion ~1.0.0 # release to users running any 1.x version (default: the exact version in Info.plist)
nativescript-app-sync release <AppSync-ios-appname> ios --mandatory --description "My mandatory iOS version" # a release for iOS that needs to be applied ASAP.

Android

nativescript-app-sync release <AppSync-android-appname> android # deploy to Staging
nativescript-app-sync release <AppSync-android-appname> android --d Production # deploy to Production (default: Staging)
nativescript-app-sync release <AppSync-android-appname> android --targetBinaryVersion ~1.0.0 # release to users running any 1.x version (default: the exact version in AndroidManifest.xml)
Click here to learn more about the --targetBinaryVersion param The `targetBinaryVersion` specifies the store/binary version of the application you are releasing the update for, so that only users running that version will receive the update, while users running an older and/or newer version of the app binary will not. This is useful for the following reasons:
  1. If a user is running an older binary version, it's possible that there are breaking changes in the AppSync update that wouldn't be compatible with what they're running.

  2. If a user is running a newer binary version, then it's presumed that what they are running is newer (and potentially incompatible) with the AppSync update.

If you ever want an update to target multiple versions of the app store binary, we also allow you to specify the parameter as a semver range expression. That way, any client device running a version of the binary that satisfies the range expression (i.e. semver.satisfies(version, range) returns true) will get the update. Examples of valid semver range expressions are as follows:

Range Expression Who gets the update
1.2.3 Only devices running the specific binary app store version 1.2.3 of your app
* Any device configured to consume updates from your AppSync app
1.2.x Devices running major version 1, minor version 2 and any patch version of your app
1.2.3 - 1.2.7 Devices running any binary version between 1.2.3 (inclusive) and 1.2.7 (inclusive)
>=1.2.3 <1.2.7 Devices running any binary version between 1.2.3 (inclusive) and 1.2.7 (exclusive)
1.2 Equivalent to >=1.2.0 <1.3.0
~1.2.3 Equivalent to >=1.2.3 <1.3.0
^1.2.3 Equivalent to >=1.2.3 <2.0.0

*NOTE: If your semver expression starts with a special shell character or operator such as >, ^, or ** , the command may not execute correctly if you do not wrap the value in quotes as the shell will not supply the right values to our CLI process. Therefore, it is best to wrap your targetBinaryVersion parameter in double quotes when calling the release command, e.g. app-sync release MyApp-iOS updateContents ">1.2.3".

NOTE: As defined in the semver spec, ranges only work for non pre-release versions: https://github.com/npm/node-semver#prerelease-tags. If you want to update a version with pre-release tags, then you need to write the exact version you want to update (1.2.3-beta for example).

The following table outlines the version value that AppSync expects your update's semver range to satisfy for each respective app type:

Platform Source of app store version
NativeScript (iOS) The CFBundleShortVersionString key in the App_Resources/iOS/Info.plist file
NativeScript (Android) The android:versionName key in the App_Resources/Android/AndroidManifest.xml file

NOTE: If the app store version in the metadata files are missing a patch version, e.g. 2.0, it will be treated as having a patch version of 0, i.e. 2.0 -> 2.0.0. The same is true for app store version equal to plain integer number, 1 will be treated as 1.0.0 in this case.

Gaining insight in past releases

Here are a few AppSync CLI commands you may find useful:

Which releases did I create and what are the install metrics?

Using a command like this will tell you how many apps have the update installed:

nativescript-app-sync deployment history <appsync-appname> Staging

Which produces something like this:

Label Release Time App Version Mandatory Description Install Metrics
v2 an hour ago 1.0.0 Yes Mandatory iOS version! Active: 11% (2 of 19)
Total: 2
v1 2 hours ago 1.0.0 No Awesome iOS version! Active: 26% (5 of 19)
Total: 5

Give me the details of the current release!

This dumps the details of the most recent release for both the Staging and Production environments of your app:

nativescript-app-sync deployment ls <appsync-appname>

And if you want to dump your deployment keys as well, use:

nativescript-app-sync deployment ls <appsync-appname> --displayKeys

Which produces something like this:

Name Deployment Key Update Metadata Install Metrics
Production r1DVaLfKjc0Y5d6BzqX4.. No updates released No installs recorded
Staging YTmVMy0GLCknVu3GVIyn.. Label: v5 Active: 11% (2 of 19)
App Version: 1.0.0 Total: 2
Mandatory: Yes
Release Time: an hour ago
Released By: [email protected]
Description: Mandatory iOS version!

Clearing the release history

This won't roll back any releases, but it cleans up the history metadata (of the Staging app, in this case):

nativescript-app-sync deployment clear <appsync-appname> Staging

Advanced topics

Testing AppSync packages during development

You may want to play with AppSync before using it in production (smart move!). Perform these steps once you've pushed an update and added the sync command to your app:

  • $ tns run <platform>. On an iOS device add the --release flag so LiveSync doesn't interfere.
  • kill and restart the app after the update is installed

Running the demo app

You may also play with AppSync by using its demo app. Here are the steps you need to perform in order to observe an app update:

  • register with the service (nativescript-app-sync register) and add the demo app to your account (nativescript-app-sync app add <appname> <platform> nativescript)
  • once the app is registered you will see its deployment keys in the console, use them to update the ones in the demo
  • go to src and run npm run preparedemo - this will build the plugin and add a reference to the demo app
  • prepare an app that will be used as an "update version" (for example, uncomment one of the APPSYNC labels and comment the APPSTORE label), then run tns build <platform>
  • release the update (nativescript-app-sync release <appname> <platform>)
  • you can ensure it appears in the list with updates (nativescript-app-sync deployment history <appname> Staging)
  • prepare an app that will be used as an "official release version" (for example, comment the APPSYNC label and uncomment the APPSTORE label), then run tns run <platform>
  • when the app is deployed on the device, you should see the "official release version" along with information about an installed update
  • close the app (and remove it from device's recent apps to ensure its next start will be a cold start) and run it again - you should now see the "update version" of the app

Patching Update Metadata

After releasing an update, there may be scenarios where you need to modify one or more of the metadata attributes associated with it (e.g. you forgot to mark a critical bug fix as mandatory.

Read all about patching metadata by clicking here.

You can update metadata by running the following command:

nativescript-app-sync patch <appName> <deploymentName>
[--label <releaseLabel>]
[--mandatory <isMandatory>]
[--description <description>]
[--targetBinaryVersion <targetBinaryVersion>]

⚠️ This command doesn't allow modifying the actual update contents of a release. If you need to respond to a release that has been identified as being broken, you should use the rollback command to immediately roll it back, and then if necessary, release a new update with the approrpriate fix when it is available.

Aside from the appName and deploymentName, all parameters are optional, and therefore, you can use this command to update just a single attribute or all of them at once. Calling the patch command without specifying any attribute flag will result in a no-op.

# Mark the latest production release as mandatory
nativescript-app-sync patch MyAppiOS Production -m

# Add a "mina and max binary version" to an existing release
nativescript-app-sync patch MyAppiOS Staging -t "1.0.0 - 1.0.5"

Promoting Updates

Read this if you want to easily promote releases from Staging to Production

Once you've tested an update against a specific deployment (e.g. Staging), and you want to promote it (e.g. dev->staging, staging->production), you can simply use the following command to copy the release from one deployment to another:

nativescript-app-sync promote <appName> <sourceDeploymentName> <destDeploymentName>
[--description <description>]
[--label <label>]
[--mandatory]
[--targetBinaryVersion <targetBinaryVersion]

# example
nativescript-app-sync promote AppSyncDemoIOS Staging Production --description 'Promoted from Staging to Production'

The promote command will create a new release for the destination deployment, which includes the exact code and metadata (description, mandatory and target binary version) from the latest release of the source deployment. While you could use the release command to "manually" migrate an update from one environment to another, the promote command has the following benefits:

  1. It's quicker, since you don't need to reassemble the release assets you want to publish or remember the description/app store version that are associated with the source deployment's release.

  2. It's less error-prone, since the promote operation ensures that the exact thing that you already tested in the source deployment (e.g. Staging) will become active in the destination deployment (e.g. Production).

💁‍♂️ Unless you need to make changes to your code, the recommended workflow is taking advantage of the automatically created Staging and Production environments, and do all releases directly to Staging, and then perform a promote from Staging to Production after performing the appropriate testing.

Rolling Back Updates

Read this if you want to learn all about rollbacks

A deployment's release history is immutable, so you cannot delete or remove individual updates once they have been released without deleting all of the deployment's release history. However, if you release an update that is broken or contains unintended features, it is easy to roll it back using the rollback command:

nativescript-app-sync rollback <appName> <deploymentName>

#example
nativescript-app-sync rollback MyAppiOS Production

This has the effect of creating a new release for the deployment that includes the exact same code and metadata as the version prior to the latest one. For example, imagine that you released the following updates to your app:

Release Description Mandatory
v1 Initial release! Yes
v2 Added new feature No
v3 Bug fixes Yes

If you ran the rollback command on that deployment, a new release (v4) would be created that included the contents of the v2 release.

Release Description Mandatory
v1 Initial release! Yes
v2 Added new feature No
v3 Bug fixes Yes
v4 (Rollback from v3 to v2) Added new feature No

End-users that had already acquired v3 would now be "moved back" to v2 when the app performs an update check. Additionally, any users that were still running v2, and therefore, had never acquired v3, wouldn't receive an update since they are already running the latest release (this is why our update check uses the package hash in addition to the release label).

If you would like to rollback a deployment to a release other than the previous (e.g. v3 -> v2), you can specify the optional --targetRelease parameter:

nativescript-app-sync rollback MyAppiOS Production --targetRelease v34

⚠️ This rolls back the release to the previous AppSync version, NOT the AppStore version (if there was one in between).

💁‍♂️ The release produced by a rollback will be annotated in the output of the deployment history command to help identify them more easily.

App Collaboration

Working on one app with multiple developers? Click here!

If you will be working with other developers on the same AppSync app, you can add them as collaborators using the following command:

nativescript-app-sync collaborator add <appName> <collaboratorEmail>

NOTE: This expects the developer to have already registered with AppSync using the specified e-mail address, so ensure that they have done that before attempting to share the app with them.

Once added, all collaborators will immediately have the following permissions with regards to the newly shared app:

  1. View the app, its collaborators, deployments and release history.
  2. Release updates to any of the app's deployments.
  3. Rollback any of the app's deployments

Inversely, that means that an app collaborator cannot do any of the following:

  1. Rename or delete the app
  2. Create, rename or delete new deployments within the app
  3. Clear a deployment's release history
  4. Add or remove collaborators from the app (although a developer can remove themself as a collaborator from an app that was shared with them).

Over time, if someone is no longer working on an app with you, you can remove them as a collaborator using the following command:

nativescript-app-sync collaborator rm <appName> <collaboratorEmail>

If at any time you want to list all collaborators that have been added to an app, you can simply run the following command:

nativescript-app-sync collaborator ls <appName>

Using AppSync behind a proxy

Click here to read all about Proxy Support By default, the `login` command will automatically look for a system-wide proxy, specified via an `HTTPS_PROXY` or `HTTP_PROXY` environment variable, and use that to connect to the server. If you'd like to disable this behavior, and have the CLI establish a direct connection, simply specify the `--noProxy` parameter when logging in:
nativescript-app-sync login --noProxy

I'd you like to explicitly specify a proxy server that the CLI should use, without relying on system-wide settings, you can instead pass the --proxy parameter when logging in:

nativescript-app-sync login --proxy https://foo.com:3454

Once you've logged in, any inferred and/or specified proxy settings are persisted along with your user session. This allows you to continue using the CLI without needing to re-authenticate or re-specify your preferred proxy. If at any time you want to start or stop using a proxy, simply logout, and then log back in with the newly desired settings.

Troubleshooting

nativescript-app-sync's People

Contributors

eddyverbruggen avatar mayerlench avatar nathanwalker avatar rdlauer avatar rosen-vladimirov avatar tdermendjiev avatar tgpetrov avatar weathered-fire-2600 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nativescript-app-sync's Issues

what service can we use here?

Hi Eddy,
What service can we use with this plugin? AppCenter?

Thanks in advance, let me know if you need help creating this plugin 👍

LiveSync - failed to write file: fonts/fa-regular-400.ttf

Hi, @EddyVerbruggen
I get this error
when I run
tns run android

application.on(application.resumeEvent, () => {
    AppSync.sync({
        deploymentKey: 'myKey' ,
        updateDialog: { // only used for InstallMode.IMMEDIATE
            updateTitle: 'Please restart the app',
            optionalUpdateMessage: 'Optional update msg',
        }
    }, (syncStatus, updateLabel?: string): void => {
        console.log(syncStatus);
        console.log(updateLabel);
    });
});
Unable to apply changes on device: emulator-5554. Error is: Error: Error while LiveSyncing: java.io.IOException: 
LiveSync: failed to write file: fonts/fa-regular-400.ttf
Original Exception: java.io.IOException: write failed: ENOSPC (No space left on device).

the font inside src

src {
app
assets
fonts
main.tns
...
}

Cannot install app-sync

i did
tns plugin add nativescript-app-sync
but

npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/EddyVerbruggen/nativescript-zip.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Quang.LHQ.000\AppData\Roaming\npm-cache_logs\2019-07-30T02_17_49_691Z-debug.log
Command npm.cmd failed with exit code 1

please help

2019-07-30_091914

The nativescript-app-sync is not compatible with Sidekick iOS cloud build

To recreate:

  1. add the nativescript-app-sync to the project (with tns plugin add nativescript-app-sync
  2. start a cloud iOS build in Sidekick.
  3. the build fails on npm install...

The error looks the same as described here ProgressNS/sidekick-feedback#288, nativescript-app-sync's postinstall hook is trying to install something into '/usr/local/lib/node_modules', which it is not allowed...

Detailed sidekick log available here https://gist.github.com/miiihi/3967f3ced0210a1d7297fbfebc7e4016

Android: Update not pushing to production

The code is live in the play store.

What's odd is that if I install the same apk to the emulator on the local dev environment that also gets pushed live, the emulator gets the updates and the devices with the same code from the play store do not.

I feel like I'm missing something somewhere but I'm not sure of the issue.

I thought maybe my versioning scheme for android:versionName could be the issue so I changed it from 9 to 9.0 as you can see in the manifest below.

The deployment history shows that the code is being pushed somewhere but no active installs.

Android Manifest:

<manifest
        android:versionCode="18" 
        android:versionName="9.0"
...

main.ts

import { platformNativeScriptDynamic } from 'nativescript-angular/platform';
import { AppModule } from './app.module';
import * as application from 'tns-core-modules/application';
import { AppSyncService } from './services/app-sync.service';

const appSyncService: AppSyncService = new AppSyncService;

platformNativeScriptDynamic().bootstrapModule(AppModule);

application.on(application.resumeEvent, () => {
    // Check for updates when the app is loaded or resumed
    appSyncService.syncWithAppSyncServer();
});

Custom App Sync Service

export class AppSyncService {

    private static APPSYNC_IOS_PRODUCTION_KEY = 'production_key_ios';

    private static APPSYNC_ANDROID_PRODUCTION_KEY = 'production_key_android';

    syncOptions = {
        deploymentKey: isIOS ? AppSyncService.APPSYNC_IOS_PRODUCTION_KEY : AppSyncService.APPSYNC_ANDROID_PRODUCTION_KEY,
        installMode: InstallMode.ON_NEXT_RESTART, // default InstallMode.ON_NEXT_RESTART
        mandatoryInstallMode: isIOS ? InstallMode.ON_NEXT_RESUME : InstallMode.IMMEDIATE, // default InstallMode.ON_NEXT_RESUME
        updateDialog: { // only used for InstallMode.IMMEDIATE
            optionalUpdateMessage: localize('@@AppSync_OptionalUpdateMessage'),
            updateTitle: localize('@@AppSync_UpdateTitle'),
            mandatoryUpdateMessage: localize('@@AppSync_MandatoryUpdateMessage'),
            optionalIgnoreButtonLabel: localize('@@AppSync_OptionalIgnoreButtonLabel'),
            mandatoryContinueButtonLabel: isIOS ? localize('@@AppSync_MandatoryContinueButtonLabel_iOS') : localize('@@AppSync_MandatoryContinueButtonLabel_Android'),
            appendReleaseDescription: true // appends the description you (optionally) provided when releasing a new version to AppSync
        }
    }

    constructor() { }

    syncWithAppSyncServer(): void {
        console.log("Querying AppSync...");
        AppSync.sync(this.syncOptions, (syncStatus: SyncStatus): void => {
            if (syncStatus === SyncStatus.UP_TO_DATE) {
                console.log("AppSync: up to date.");
            } else if (syncStatus === SyncStatus.UPDATE_INSTALLED) {
                console.log("AppSync: update installed.");
            }
        });
    }
}

Using AppSync in a dev environment

Not sure if this is normal behavior or not, but didn't notice it the first time I added app-sync. It came to my intention after upgrading tns-cli from 6.0.4 to 6.1.2 and xcode to 11.

Environment

  • CLI: 6.1.2
  • Cross-platform modules: 6.1.1
  • iOS Runtime: Tested on 6.0.4 & 6.1.1
  • Plugin(s): nativescript-app-sync (1.0.5)
  • Xcode 11
  • iOS 12/13 Simulator

Describe the bug
It seems that there are some issues with hmr & app-sync if the app crashes due to a coding mistake. hmr stops reloading the app & applying new changes, and it shows the app from the last app-sync patch. Any new changes are not applied, and one has to stop the app & nuke the platforms folder and run again.

Using just tns run ios does not work, it just shows the app from the last patch and not applying any new changes.

I did try stopping the app, doing first tns build ios and then tns run ios. That worked, but stopping the app, and running again, made the issue reappear.

If I disable app-sync, hmr works as expected.

EDIT: Also noticed both in iOS & Android, if I close the running app and re-open it. It just applies the latest patch, ignoring all local changes.

To Reproduce

  1. Enable App-sync & run the app on iOS simulator.
    App-sync tells you the latest patch version, let's say: v5.

  2. Do a change in app and save
    hmr refreshes app normally and the change is applied. *See Log nr 1 for details

  3. Do another change in the app but that causes a crash, like invalid color value color="#white"
    App crashes and the log shows the error.

  4. Fix the error in the app and save
    App loads but is showing the app in the v5-patch state, not showing any changes you made since then. *See Log nr 2 for details

  5. Do another change and save
    App refreshes but still, showing only v5-patch version, change not applied.

  6. Stop the app (CTRL+C) and do tns run build then tns run ios
    App runs and shows the latest changes.

  7. Stop the app (CTRL+C) and do tns run ios
    App runs but showing the app from v5-patch state. No changes applied.

  8. Stop the app (CTRL+C) and do rm -rf platforms then tns run ios
    App runs normally and hmr applies new changes

Expected behavior
That hmr & app-sync play nice together. Or perhaps a flag to disable app-sync when in dev mode.

Workaround
Disable App-sync in app.ts when developing. Enable it when ready for publish.

Additional context
Here are loggs related to the reproduce-steps above.

Log nr 1 (reproduce step 2)

File change detected. Starting incremental webpack compilation...
Hash: 7536a98cd09efedf58f7
Version: webpack 4.27.1
Time: 388ms
Built at: 09/22/2019 6:20:08 PM
                                            Asset       Size                                          Chunks             Chunk Names
             5ffc82675a2e078d2249.hot-update.json   48 bytes                                                  [emitted]
        bundle.5ffc82675a2e078d2249.hot-update.js   28.7 KiB                                          bundle  [emitted]  bundle
                                        bundle.js    851 KiB                                          bundle  [emitted]  bundle
                                       runtime.js   71.4 KiB                                         runtime  [emitted]  runtime
tns_modules/tns-core-modules/inspector_modules.js  955 bytes  tns_modules/tns-core-modules/inspector_modules  [emitted]  tns_modules/tns-core-modules/inspector_modules
 + 1 hidden asset
Entrypoint bundle = runtime.js vendor.js bundle.js bundle.5ffc82675a2e078d2249.hot-update.js
Entrypoint tns_modules/tns-core-modules/inspector_modules = runtime.js vendor.js tns_modules/tns-core-modules/inspector_modules.js
[./ sync ^\.\/app\.(css|scss|less|sass)$] . sync nonrecursive ^\.\/app\.(css|scss|less|sass)$ 174 bytes {bundle} [built]
[./ sync recursive (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$] . sync (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$ 2.78 KiB {bundle} [built]
[./views/fixtures/fixtures.xml] 2.21 KiB {bundle} [built]
[./views/main-view.xml] 8.61 KiB {bundle} [optional] [built]
    + 488 hidden modules
Webpack compilation complete. Watching for file changes.
Webpack build done!
Successfully transferred bundle.5ffc82675a2e078d2249.hot-update.js on device BE27BBD4-59BD-4382-B6AB-2535EC8E3C57.
Successfully transferred 5ffc82675a2e078d2249.hot-update.json on device BE27BBD4-59BD-4382-B6AB-2535EC8E3C57.
NativeScript debugger has opened inspector socket on port 18183 for com.myawesomeapp.
Refreshing application on device BE27BBD4-59BD-4382-B6AB-2535EC8E3C57...
CONSOLE LOG file:///node_modules/tns-core-modules/inspector_modules.js:1:0 Loading inspector modules...
CONSOLE LOG file:///node_modules/tns-core-modules/inspector_modules.js:6:0 Finished loading inspector modules.
NativeScript debugger attached.
CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Checking for updates to the bundle with hmr hash 5ffc82675a2e078d2249.
CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: The following modules were updated:
CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0 HMR:          ↻ ./views/fixtures/fixtures.xml
CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0 HMR:          ↻ ./views/main-view.xml
CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Successfully applied update with hmr hash 5ffc82675a2e078d2249. App is up to date.
Successfully synced application com.myawesomeapp on device BE27BBD4-59BD-4382-B6AB-2535EC8E3C57.

Log nr 2 (reproduce step 4)

File change detected. Starting incremental webpack compilation...
Hash: 167ac25931c761387b99
Version: webpack 4.27.1
Time: 434ms
Built at: 09/22/2019 6:36:20 PM
                                            Asset       Size                                          Chunks             Chunk Names
             7c9cca8fca3349af29ce.hot-update.json   48 bytes                                                  [emitted]
        bundle.7c9cca8fca3349af29ce.hot-update.js   28.7 KiB                                          bundle  [emitted]  bundle
                                        bundle.js    851 KiB                                          bundle  [emitted]  bundle
                                       runtime.js   71.4 KiB                                         runtime  [emitted]  runtime
tns_modules/tns-core-modules/inspector_modules.js  955 bytes  tns_modules/tns-core-modules/inspector_modules  [emitted]  tns_modules/tns-core-modules/inspector_modules
 + 1 hidden asset
Entrypoint bundle = runtime.js vendor.js bundle.js bundle.7c9cca8fca3349af29ce.hot-update.js
Entrypoint tns_modules/tns-core-modules/inspector_modules = runtime.js vendor.js tns_modules/tns-core-modules/inspector_modules.js
[./ sync ^\.\/app\.(css|scss|less|sass)$] . sync nonrecursive ^\.\/app\.(css|scss|less|sass)$ 174 bytes {bundle} [built]
[./ sync recursive (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$] . sync (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$ 2.78 KiB {bundle} [built]
[./views/fixtures/fixtures.xml] 2.21 KiB {bundle} [built]
[./views/main-view.xml] 8.61 KiB {bundle} [optional] [built]
    + 488 hidden modules
Webpack compilation complete. Watching for file changes.
Webpack build done!
Successfully transferred bundle.7c9cca8fca3349af29ce.hot-update.js on device BE27BBD4-59BD-4382-B6AB-2535EC8E3C57.
Successfully transferred 7c9cca8fca3349af29ce.hot-update.json on device BE27BBD4-59BD-4382-B6AB-2535EC8E3C57.
Refreshing application on device BE27BBD4-59BD-4382-B6AB-2535EC8E3C57...
Successfully synced application com.myawesomeapp on device BE27BBD4-59BD-4382-B6AB-2535EC8E3C57.

Unable to release later updates

Hi everyone, I just installed AppSync to my app and successfully release my first update (even if nothing seems to have happened). So I decided to make some minor changes and release another updates but the cli always give me this error
[Error] The uploaded package is identical to the contents of the specified deployment's current release.
Can someone help me? Thanks

[TIP] [SOLVED] Nativescript Zip error on tns run ios and android

When I run tns run ios I get the following message and the app terminates:

ERROR in ../node_modules/nativescript-app-sync/TNSLocalPackage.js
Module not found: Error: Can't resolve 'nativescript-zip' in '/{homefolder}/{App}/{App-Name}/node_modules/nativescript-app-sync'
 @ ../node_modules/nativescript-app-sync/TNSLocalPackage.js 3:25-52
 @ ../node_modules/nativescript-app-sync/app-sync.js
 @ ./main.ts

The following is the stacktrace:

***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x10bffe91f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x10c044d1f -[TNSRuntime executeModule:referredBy:]
3   0x10b845be3 main
4   0x10ffce541 start
JavaScript stack trace:
1   ../node_modules/properties/lib/stringify.js@file:///node_modules/properties/lib/stringify.js:9:17
2   __webpack_require__@file:///app/webpack/bootstrap:750:0
3   fn@file:///app/webpack/bootstrap:120:0
4   ../node_modules/properties/lib/write.js@file:///node_modules/properties/lib/write.js:4:23
5   __webpack_require__@file:///app/webpack/bootstrap:750:0
6   fn@file:///app/webpack/bootstrap:120:0
7   ../node_modules/properties/lib/index.js@file:///node_modules/properties/lib/index.js:7:19
8   __webpack_require__@file:///app/webpack/bootstrap:750:0
9   fn@file:///app/webpack/bootstrap:120:0
10  @file:///node_modules/tns-core-modules/ui/core/bindable/bindable.js:2:27
11  ../node_modules/tns-core-modules/ui/core/bindable/bindable.js@file:///app/vendor.js:176900:34
12  __webpack_require__@file:///app/webpack/bootstrap:750:0
13  fn@file:///app/webpack/bootstrap:120:0
14  @file:///node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js:2:25
15  ../node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js@file:///app/vendor.js:176000:34
16  __webpack_require__@file:///app/webpack/bootstrap:750:0
17  fn@file:///app/webpack/bootstrap:120:0
18  @file:///node_modules/tns-core-modules/ui/builder/builder.js:5:34
<…>
JavaScript error:
file:///node_modules/properties/lib/stringify.js:9:17 JS ERROR TypeError: undefined is not an object (evaluating 'global.process.platform')
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: undefined is not an object (evaluating 'global.process.platform')
at
1   ../node_modules/properties/lib/stringify.js@file:///node_modules/properties/lib/stringify.js:9:17
2   __webpack_require__@file:///app/webpack/bootstrap:750:0
3   fn@file:///app/webpack/bootstrap:120:0
4   ../node_modules/properties/lib/write.js@file:///node_modules/properties/lib/write.js:4:23
5   __webpack_require__@file:///app/webpack/bootstrap:750:0
6   fn@file:///app/webpack/bootstrap:120:0
7   ../node_modules/properties/lib/index.js@file:///node_modules/properties/lib/index.js:7:19
8   __webpack_require__@file:///app/webpack/bootstrap:750:0
9   fn@file:///app/webpack/bootstrap:120:0
10  @file:///node_modules/tns-core-modules/ui/core/bindable/bindable.js:2:27
11  ../node_modules/tns-core-modules/ui/core/bindable/bindable.js@file:///app/vendor.js:176900:34
12  __webpack_require__@file:///app/webpack/bootstrap:750:0
13  fn@file:///app/webpack/bootstrap:120:0
14  @file:///node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js:2:25
15  ../node_modules/tns-core-modules/ui/builder/component-builder/component-bu<…>
NativeScript caught signal 6.
Native Stack:
1   0x10c04384f sig_handler(int)
2   0x11032db5d _sigtramp
3   0xffff00001fa5
4   0x1100b001d abort
5   0x10fe499d1 __cxa_bad_cast
6   0x10fe49b6f default_unexpected_handler()
7   0x10efbbe2d _objc_terminate()
8   0x10fe55a2e std::__terminate(void (*)())
9   0x10fe554eb __cxa_get_exception_ptr
10  0x10fe554b2 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
11  0x10efbbbfa _objc_exception_destructor(void*)
12  0x10bffed58 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13  0x10c044d1f -[TNSRuntime executeModule:referredBy:]
14  0x10b845be3 main
15  0x10ffce541 start
JS Stack:
Successfully synced application com.nativescript.{appname} on device 6A1095F3-58DF-4F18-9B22-C284166E3E55.
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x106a8e91f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x106ad4d1f -[TNSRuntime executeModule:referredBy:]
3   0x1062d5be3 main
4   0x10a98e541 start
JavaScript stack trace:
1   ../node_modules/properties/lib/stringify.js@file:///node_modules/properties/lib/stringify.js:9:17
2   __webpack_require__@file:///app/webpack/bootstrap:750:0
3   fn@file:///app/webpack/bootstrap:120:0
4   ../node_modules/properties/lib/write.js@file:///node_modules/properties/lib/write.js:4:23
5   __webpack_require__@file:///app/webpack/bootstrap:750:0
6   fn@file:///app/webpack/bootstrap:120:0
7   ../node_modules/properties/lib/index.js@file:///node_modules/properties/lib/index.js:7:19
8   __webpack_require__@file:///app/webpack/bootstrap:750:0
9   fn@file:///app/webpack/bootstrap:120:0
10  @file:///node_modules/tns-core-modules/ui/core/bindable/bindable.js:2:27
11  ../node_modules/tns-core-modules/ui/core/bindable/bindable.js@file:///app/vendor.js:176900:34
12  __webpack_require__@file:///app/webpack/bootstrap:750:0
13  fn@file:///app/webpack/bootstrap:120:0
14  @file:///node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js:2:25
15  ../node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js@file:///app/vendor.js:176000:34
16  __webpack_require__@file:///app/webpack/bootstrap:750:0
17  fn@file:///app/webpack/bootstrap:120:0
18  @file:///node_modules/tns-core-modules/ui/builder/builder.js:5:34
<…>
JavaScript error:
file:///node_modules/properties/lib/stringify.js:9:17 JS ERROR TypeError: undefined is not an object (evaluating 'global.process.platform')
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: undefined is not an object (evaluating 'global.process.platform')
at
1   ../node_modules/properties/lib/stringify.js@file:///node_modules/properties/lib/stringify.js:9:17
2   __webpack_require__@file:///app/webpack/bootstrap:750:0
3   fn@file:///app/webpack/bootstrap:120:0
4   ../node_modules/properties/lib/write.js@file:///node_modules/properties/lib/write.js:4:23
5   __webpack_require__@file:///app/webpack/bootstrap:750:0
6   fn@file:///app/webpack/bootstrap:120:0
7   ../node_modules/properties/lib/index.js@file:///node_modules/properties/lib/index.js:7:19
8   __webpack_require__@file:///app/webpack/bootstrap:750:0
9   fn@file:///app/webpack/bootstrap:120:0
10  @file:///node_modules/tns-core-modules/ui/core/bindable/bindable.js:2:27
11  ../node_modules/tns-core-modules/ui/core/bindable/bindable.js@file:///app/vendor.js:176900:34
12  __webpack_require__@file:///app/webpack/bootstrap:750:0
13  fn@file:///app/webpack/bootstrap:120:0
14  @file:///node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js:2:25
15  ../node_modules/tns-core-modules/ui/builder/component-builder/component-bu<…>
NativeScript caught signal 6.
Native Stack:
1   0x106ad384f sig_handler(int)
2   0x10acf2b5d _sigtramp
3   0xffff
4   0x10aa7501d abort
5   0x10a8099d1 __cxa_bad_cast
6   0x10a809b6f default_unexpected_handler()
7   0x10997be2d _objc_terminate()
8   0x10a815a2e std::__terminate(void (*)())
9   0x10a8154eb __cxa_get_exception_ptr
10  0x10a8154b2 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
11  0x10997bbfa _objc_exception_destructor(void*)
12  0x106a8ed58 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13  0x106ad4d1f -[TNSRuntime executeModule:referredBy:]
14  0x1062d5be3 main
15  0x10a98e541 start
JS Stack:

In main.ts:

import { platformNativeScriptDynamic } from 'nativescript-angular/platform';
import { AppModule } from './app.module';
import { isIOS } from "tns-core-modules/platform";

import * as application from "tns-core-modules/application";
import { AppSync, InstallMode/*, SyncStatus*/ } from 'nativescript-app-sync';

platformNativeScriptDynamic().bootstrapModule(AppModule);

application.on(application.resumeEvent, () => {
  AppSync.sync({
        deploymentKey: isIOS ? 'key1' : 'key2',
        installMode: InstallMode.ON_NEXT_RESTART, // default InstallMode.ON_NEXT_RESTART
        mandatoryInstallMode: isIOS ? InstallMode.ON_NEXT_RESUME : InstallMode.IMMEDIATE, // default InstallMode.ON_NEXT_RESUME
        updateDialog: { // only used for InstallMode.IMMEDIATE
          optionalUpdateMessage: "Updates Available.",
          updateTitle: "Please restart the app",
          mandatoryUpdateMessage: "This app needs to be updated.  Please restart the app.",
          optionalIgnoreButtonLabel: "Later",
          mandatoryContinueButtonLabel: isIOS ? "Exit now" : "Restart now",
          appendReleaseDescription: true // appends the description you (optionally) provided when releasing a new version to AppSync
        }
      });
  });

Any ideas? This also happens with Android, although with a different stacktrace but similar errors.

Can't register, register page throws an error and red-screens

First, not sure if this is the right place for this, but I couldn't find another place to

I attempted to do a nativescript-app-sync register this morning and was taken to https://appsync-server.nativescript.org/auth/register?hostname=MY_HOSTNAME_HERE when I was greeted with the following after a brief second:

image

I've tried just hiding that error div, but it looks like the whole react app is crashing, preventing me from registering. I see #7 was closed, but this is still an issue. I tried Edgium, Firefox, and Edge and none of those worked. Chrome let me get to the last step (Step 4, the 🚀), but then it crashed out there and I had to do a nativescript-app-sync loginand then log in and generate an Access key there.

The error is actually coming from the react-devtools-inspector package, and I'm seeing a lot of stuff log that looks like maybe this isn't a production build?

iOS Crash when using "--mandatory" with NativeScript-Vue

The app crashes on an appsync update when using NativeScript Vue. I've created a repo based on the vue template app for reproducing this: https://github.com/vpulim/appsync-crash

I ran the following commands:

nativescript-app-sync app add AppSyncCrash ios
tns run ios --release
# modify App.vue
tns build ios --release
nativescript-app-sync release AppSyncCrash ios --mandatory

The stack trace is here:

Cannot be called with asCopy = NO on non-main thread.
Cannot be called with asCopy = NO on non-main thread.
Cannot be called with asCopy = NO on non-main thread.
+[UIView setAnimationsEnabled:] being called from a background thread. Performing any operation from a background thread on UIView or a subclass is not supported and may result in unexpected and insidious behavior. trace=(
0   UIKitCore                           0x000000019f252c40 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 15633472
1   UIKitCore                           0x000000019f252cd8 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 15633624
2   libdispatch.dylib                   0x000000019a951fd8 0C7A69CD-F2EE-3426-BFD8-742C903D3D07 + 12248
3   libdispatch.dylib                   0x000000019a9536c0 0C7A69CD-F2EE-3426-BFD8-742C903D3D07 + 18112
4   UIKitCore                           0x000000019f252bc4 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 15633348
5   UIKitCore                           0x000000019f252d44 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 15633732
6   UIKitCore                           0x000000019f1734c4 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 14718148
7   UIKitCore                           0x000000019f173408 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 14717960
8   UIKitCore                           0x000000019e3a20ac AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 229548
9   UIKitCore                           0x000000019e3a1494 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 226452
10  UIKitCore                           0x000000019e38f9f4 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 154100
11  UIKitCore                           0x000000019e38cf30 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 143152
12  UIKitCore                           0x000000019e38d00c AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 143372
13  UIKitCore                           0x000000019e3b80c4 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 319684
14  UIKitCore                           0x000000019e3d8c08 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 453640
15  UIKitCore                           0x000000019e3d7dbc AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 449980
16  UIKitCore                           0x000000019e3d7d38 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 449848
17  UIKitCore                           0x000000019e3c1224 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 356900
18  UIKitCore                           0x000000019e768a1c AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4188700
19  UIKitCore                           0x000000019e769104 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4190468
20  UIKitCore                           0x000000019e77f214 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4280852
21  UIKitCore                           0x000000019e777d08 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4250888
22  UIKitCore                           0x000000019e77975c AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4257628
23  UIKitCore                           0x000000019e77bd0c AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4267276
24  UIKitCore                           0x000000019e77c270 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4268656
25  UIKitCore                           0x000000019e77bc58 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4267096
26  UIKitCore                           0x000000019e77beec AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 4267756
27  NativeScript                        0x00000001059e0044 ffi_call_SYSV + 68
28  NativeScript                        0x00000001059dd780 ffi_call_int + 1272
29  NativeScript                        0x00000001059dd27c ffi_call + 56
30  NativeScript                        0x0000000104e80f54 _ZN12NativeScript15FunctionWrapper4callEPN3JSC9ExecStateE + 752
31  NativeScript                        0x00000001059dc488 llint_entry + 89928
32  NativeScript                        0x00000001059da804 llint_entry + 82628
33  NativeScript                        0x00000001059da804 llint_entry + 82628
34  NativeScript                        0x00000001059da804 llint_entry + 82628
35  NativeScript                        0x00000001059c62ac vmEntryToJavaScript + 268
36  NativeScript                        0x0000000105653ebc _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 548
37  NativeScript                        0x0000000105016b50 _ZN3JSC9JSPromise10initializeEPNS_9ExecStateEPNS_14JSGlobalObjectENS_7JSValueE + 264
38  NativeScript                        0x0000000105017508 _ZN3JSCL16constructPromiseEPNS_9ExecStateE + 340
39  NativeScript                        0x00000001059dc5d0 llint_entry + 90256
40  NativeScript                        0x00000001059db1f8 llint_entry + 85176
41  NativeScript                        0x00000001059da804 llint_entry + 82628
42  NativeScript                        0x00000001059da804 llint_entry + 82628
43  NativeScript                        0x00000001059da804 llint_entry + 82628
44  NativeScript                        0x00000001059c62ac vmEntryToJavaScript + 268
45  NativeScript                        0x0000000105653ebc _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 548
46  NativeScript                        0x0000000104e80074 _ZN12NativeScript11FFICallbackINS_17ObjCBlockCallbackEE12callFunctionERKN3JSC7JSValueERKNS3_7ArgListEPv + 148
47  NativeScript                        0x0000000104ed1f44 _ZN12NativeScript17ObjCBlockCallback18ffiClosureCallbackEPvPS1_S1_ + 200
48  NativeScript                        0x0000000104ed23c8 _ZN12NativeScript11FFICallbackINS_17ObjCBlockCallbackEE18ffiClosureCallbackEP7ffi_cifPvPS5_S5_ + 104
49  NativeScript                        0x00000001059de05c ffi_closure_SYSV_inner + 996
50  NativeScript                        0x00000001059e01b4 .Ldo_closure + 20
51  AppSync                             0x0000000104c0255c +[SSZipArchive unzipFileAtPath:toDestination:preserveAttributes:overwrite:password:error:delegate:progressHandler:completionHandler:] + 7896
52  AppSync                             0x0000000104c004d0 +[SSZipArchive unzipFileAtPath:toDestination:progressHandler:completionHandler:] + 204
53  AppSync                             0x0000000104c1c9f8 __66+[TNSAppSync unzipFileAtPath:toDestination:onProgress:onComplete:]_block_invoke + 184
54  libdispatch.dylib                   0x000000019a950b7c 0C7A69CD-F2EE-3426-BFD8-742C903D3D07 + 7036
55  libdispatch.dylib                   0x000000019a951fd8 0C7A69CD-F2EE-3426-BFD8-742C903D3D07 + 12248
56  libdispatch.dylib                   0x000000019a954414 0C7A69CD-F2EE-3426-BFD8-742C903D3D07 + 21524
57  libdispatch.dylib                   0x000000019a960bd4 0C7A69CD-F2EE-3426-BFD8-742C903D3D07 + 72660
58  libdispatch.dylib                   0x000000019a961384 0C7A69CD-F2EE-3426-BFD8-742C903D3D07 + 74628
59  libsystem_pthread.dylib             0x000000019a9b7690 _pthread_wqthread + 216
60  libsystem_pthread.dylib             0x000000019a9bd9e8 start_wqthread + 8
)
Unsupported use of UIKit view-customization API off the main thread. -setHasDimmingView: sent to <_UIAlertControllerView: 0x105f24350; frame = (0 0; 375 812); layer = <CALayer: 0x2822a6360>>
Unsupported use of UIKit view-customization API off the main thread. -setShouldHaveBackdropView: sent to <_UIAlertControllerView: 0x105f24350; frame = (0 0; 375 812); layer = <CALayer: 0x2822a6360>>
Cannot be called with asCopy = NO on non-main thread.
Unsupported use of UIKit view-customization API off the main thread. -setAlignsToKeyboard: sent to <_UIAlertControllerView: 0x105f24350; frame = (0 0; 375 812); layer = <CALayer: 0x2822a6360>>
This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
Stack:(
0   Foundation                          0x000000019b198550 7A7A96AF-79E4-3DB1-8904-42E61CAE8999 + 2331984
1   Foundation                          0x000000019af87828 7A7A96AF-79E4-3DB1-8904-42E61CAE8999 + 165928
2   UIKitCore                           0x000000019f186250 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 14795344
3   UIKitCore                           0x000000019f187648 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 14800456
4   UIKitCore                           0x000000019e3dfd74 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 482676
5   UIKitCore                           0x000000019e3db4b8 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 464056
6   UIKitCore                           0x000000019e3db72c AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 464684
7   UIKitCore                           0x000000019e3dba6c AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 465516
8   UIKitCore                           0x000000019e3e0630 AAFEFEBE-C172-3346-8972-810EB8F2F2C6 + 484912
9   UIKitCore                           0x000000019e3
NativeScript caught signal 11.
Native Stack:
1   0x104efcb18 sig_handler(int)
2   0x19a9b3424 <redacted>
3   0x1045cf894
4   0x1045cf894
5   0x19acacc7c <redacted>
6   0x19a9c52fc <redacted>
7   0x19aa6b634 <redacted>
8   0x19aa6af58 __cxa_get_exception_ptr
9   0x19aa6af10 <redacted>
10  0x19a9c5158 <redacted>
11  0x19b1985e0 <redacted>
12  0x19af87828 <redacted>
13  0x19f186250 <redacted>
14  0x19f187648 <redacted>
15  0x19e3dfd74 <redacted>
16  0x19e3db4b8 <redacted>
17  0x19e3db72c <redacted>
18  0x19e3dba6c <redacted>
19  0x19e3e0630 <redacted>
20  0x19e3e0474 <redacted>
21  0x19e3c1364 <redacted>
22  0x19e768a1c <redacted>
23  0x19e769104 <redacted>
24  0x19e77f214 <redacted>
25  0x19e777d08 <redacted>
26  0x19e77975c <redacted>
27  0x19e77bd0c <redacted>
28  0x19e77c270 <redacted>
29  0x19e77bc58 <redacted>
30  0x19e77beec <redacted>
31  0x1059e0044 ffi_call_SYSV

The only change I made to the sample vue app is:

<script >
  import { AppSync, InstallMode, SyncStatus } from 'nativescript-app-sync'
  import * as application from 'tns-core-modules/application'

  export default {
    data() {
      return {
        msg: 'Hello World!'
      }
    },
    created () {
      application.on(application.resumeEvent, () => {
        AppSync.sync({
          deploymentKey: 'INSERT KEY HERE',
          installMode: InstallMode.ON_NEXT_RESUME,
          mandatoryInstallMode: InstallMode.IMMEDIATE
        }, (syncStatus, updateLabel) => {
          console.log('**** APPSYNC STATUS:', syncStatus)
          if (syncStatus === SyncStatus.UP_TO_DATE) {
            console.log('**** APPSYNC: UP-TO-DATE')
          } else if (syncStatus === SyncStatus.UPDATE_INSTALLED) {
            console.log('**** APPSYNC: UPDATE INSTALLED:', updateLabel)
          }
        })
      })
    }
  }
</script>

Still in Pending?

I've deployed an app thru Play, now I've released a patch using nativescript-app-sync release android --d Production. I then successfully "patched" it to be mandatory. But the app's install metrics (nativescript-app-sync deployment history Production) continue to show 0% active, 6 Pending. The AppSync check in the app runs on resume, so I've caused that to happen on multiple devices, multiple times. The "pending" remains resolutely unchanged and I'm not getting the update on the devices. What am I doing wrong? And how can I figure out what's wrong here?

Re: nativescript-code-push release <codepush-android-appname> android

After try to release app using code-push getting an error.

[Error] Unable to find or read "E:\project\New folder\demoTesting\app\App_Resources\Android\AndroidManifest.xml".

My new project manifest file path : E:\project\New folder\demoTesting\app\App_Resources\Android\src\AndroidManifest.xml

Old project working fine.

[Error] <!DOCTYPE html>

I'm recieving this error after using app sync release command:

[Error]




<title>Application Error</title>
<style media="screen">
html,body,iframe {
margin: 0;
padding: 0;
}
html,body {
height: 100%;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: 0;
}
</style>


<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>

there were no errors installing before this

Images added to App_Resources not synced

  • CLI: 6.1.2
  • Cross-platform modules: 6.1.1
  • Android Runtime: 6.0.1
  • iOS Runtime: 6.0.1
  • Plugin(s): nativescript-app-sync 1.0.5
  • Xcode 11

Added a new image (.png) to the android & ios App_Resources folder. It worked in the simulator and on device. But after publishing the patch via app-sync, the image did not appear on my device after restarting. Had to upload the image to online service and link it.

too many superfluous files

nativescript-app-sync plugin contain all of nativescript-app-sync-cli dependencies whitch contain nativescript-app-sync-sdk and too many superfluous dependencies.such as executable file.But with nativescript-app-sync-cli , I found out that you just need the version of it.with these superfluous files specially executable file like files in node_modules/term-size/vendor/macos got apple refuse to deploy to appstore.And also make our application unexpected bigger.

Hope to be improved.

And I am sorry with my bad english,i am chinese.😄

Server Setup

Hi There!

This looks like a cool plugin! I'm interested to try it out for an app I took over and maintaining now.

I had a question about the server setup. I know it is mentioned in an overview in the readme. And I see a mention in the code for being able to change the server URL.

So, I had a few questions:

  • Is the server setup available for download and setup (not just the client side) for this?
  • Can it be used with Microsoft CodePush (This comment seems to imply so)?

I'm sure you all have a great setup on your cloud server at appsync-server.nativescript.org, but I'd probably feel better long-term about this being able to use a paid service or roll my own for longevity.

Objective-C class name "t" is already in use

When the update installed I receive this in console (Simulator)

CONSOLE WARN file: node_modules/@nativescript/core/css/parser.js:1117:0: Objective-C class name "t" is already in use - using "t1" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css/parser.js:1120:0: Objective-C class name "t" is already in use - using "t2" instead.
CONSOLE WARN file:///app/vendor.js:817:314: Objective-C class name "t" is already in use - using "t3" instead.
CONSOLE WARN file:///app/vendor.js:818:290: Objective-C class name "t" is already in use - using "t4" instead.
CONSOLE WARN file: node_modules/@nativescript/core/debugger/debugger.js:29:0: Objective-C class name "t" is already in use - using "t5" instead.
CONSOLE WARN file: node_modules/@nativescript/core/debugger/debugger.js:29:0: Objective-C class name "t" is already in use - using "t6" instead.
CONSOLE WARN file: node_modules/@nativescript/core/debugger/debugger.js:47:0: Objective-C class name "t" is already in use - using "t7" instead.
CONSOLE WARN file: node_modules/@nativescript/core/image-source/image-source.ios.js:38:0: Objective-C class name "t" is already in use - using "t8" instead.
CONSOLE WARN file: node_modules/@nativescript/core/color/color-common.js:75:0: Objective-C class name "t" is already in use - using "t9" instead.
CONSOLE WARN file: node_modules/@nativescript/core/color/color-common.js:78:0: Objective-C class name "t" is already in use - using "t10" instead.
CONSOLE WARN file: node_modules/@nativescript/core/color/color-common.js:86:5: Objective-C class name "t" is already in use - using "t11" instead.
CONSOLE WARN file:///app/vendor.js:3608:103: Objective-C class name "t" is already in use - using "t12" instead.
CONSOLE WARN file: node_modules/@nativescript/core/data/observable/observable.js:44:0: Objective-C class name "t" is already in use - using "t13" instead.
CONSOLE WARN file: node_modules/@nativescript/core/fetch/fetch.js:135:0: Objective-C class name "t" is already in use - using "t14" instead.
CONSOLE WARN file: node_modules/@nativescript/core/fetch/fetch.js:146:0: Objective-C class name "t" is already in use - using "t15" instead.
CONSOLE WARN file: node_modules/@nativescript/core/fetch/fetch.js:151:0: Objective-C class name "t" is already in use - using "t16" instead.
CONSOLE WARN file: node_modules/@nativescript/core/image-source/image-source.ios.js:69:0: Objective-C class name "t" is already in use - using "t17" instead.
CONSOLE WARN file: node_modules/@nativescript/core/data/observable/observable.js:33:0: Objective-C class name "t" is already in use - using "t18" instead.
CONSOLE WARN file: node_modules/@nativescript/core/fetch/fetch.js:223:0: Objective-C class name "t" is already in use - using "t19" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css/parser.js:412:87: Objective-C class name "t" is already in use - using "t20" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:30:0: Objective-C class name "t" is already in use - using "t21" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:32:0: Objective-C class name "t" is already in use - using "t22" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system.js:22:0: Objective-C class name "t" is already in use - using "t23" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system.js:27:0: Objective-C class name "t" is already in use - using "t24" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system.js:35:0: Objective-C class name "t" is already in use - using "t25" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system.js:42:0: Objective-C class name "t" is already in use - using "t26" instead.
CONSOLE WARN file: node_modules/@nativescript/core/application/application.ios.js:101:0: Objective-C class name "t" is already in use - using "t27" instead.
CONSOLE WARN file: node_modules/@nativescript/core/data/observable/observable.js:138:0: Objective-C class name "t" is already in use - using "t28" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:72:0: Objective-C class name "t" is already in use - using "t29" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:78:0: Objective-C class name "t" is already in use - using "t30" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:115:0: Objective-C class name "t" is already in use - using "t31" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:134:0: Objective-C class name "t" is already in use - using "t32" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:149:0: Objective-C class name "t" is already in use - using "t33" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:166:0: Objective-C class name "t" is already in use - using "t34" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:174:0: Objective-C class name "t" is already in use - using "t35" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:179:44: Objective-C class name "t" is already in use - using "t36" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:244:0: Objective-C class name "t" is already in use - using "t37" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:249:0: Objective-C class name "t" is already in use - using "t38" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:250:0: Objective-C class name "t" is already in use - using "t39" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:271:0: Objective-C class name "t" is already in use - using "t40" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:280:0: Objective-C class name "t" is already in use - using "t41" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css/parser.js:293:0: Objective-C class name "t" is already in use - using "t42" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css/parser.js:306:0: Objective-C class name "t" is already in use - using "t43" instead.
CONSOLE WARN file: node_modules/@nativescript/core/data/observable/observable.js:110:0: Objective-C class name "t" is already in use - using "t44" instead.
CONSOLE WARN file: node_modules/@nativescript/core/data/observable/observable.js:120:0: Objective-C class name "t" is already in use - using "t45" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system.js:5:0: Objective-C class name "t" is already in use - using "t46" instead.
CONSOLE WARN file: node_modules/@nativescript/core/file-system/file-system-access.ios.js:366:0: Objective-C class name "t" is already in use - using "t47" instead.
CONSOLE WARN file: node_modules/@nativescript/core/js-libs/easysax/easysax.js:713:0: Objective-C class name "t" is already in use - using "t48" instead.
CONSOLE WARN file: node_modules/@nativescript/core/js-libs/easysax/easysax.js:713:0: Objective-C class name "t" is already in use - using "t49" instead.
CONSOLE WARN file: node_modules/@nativescript/core/js-libs/easysax/easysax.js:713:0: Objective-C class name "t" is already in use - using "t50" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css/lib/parse/index.js:511:0: Objective-C class name "t" is already in use - using "t51" instead.
CONSOLE WARN file: node_modules/@nativescript/core/js-libs/esprima/esprima.js:214:0: Objective-C class name "t" is already in use - using "t52" instead.
CONSOLE WARN file: node_modules/@nativescript/core/debugger/webinspector-network.ios.js:137:0: Objective-C class name "r" is already in use - using "r1" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css-value/reworkcss-value.js:103:0: Objective-C class name "t" is already in use - using "t53" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css/lib/parse/index.js:17:0: Objective-C class name "t" is already in use - using "t54" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css/lib/parse/index.js:27:0: Objective-C class name "t" is already in use - using "t55" instead.
CONSOLE WARN file: node_modules/@nativescript/core/css/lib/parse/index.js:36:0: Objective-C class name "t" is already in use - using "t56" instead.

Plugin causes Angular apps to crash

Hey @EddyVerbruggen,

Went to add this plugin to a new app today and noticed that it causes the app to crash at runtime with a somewhat cryptic error.

JavaScript error:
file:///node_modules/properties/lib/stringify.js:9:17: JS ERROR TypeError: undefined is not an object (evaluating 'global.process.platform')
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: undefined is not an object (evaluating 'global.process.platform')
at
../node_modules/properties/lib/stringify.js(file:///node_modules/properties/lib/stringify.js:9:17)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)

You can recreate the problem pretty simply.

  1. Start a new app. (I used the default Angular drawer template.)
  2. tns plugin add nativescript-app-sync
  3. tns run ios --emulator

I’ll try to debug a bit and see if this is related to the new version, or maybe the type of app.

Handling Testflight and Android Beta deployments

Is there a recommended way to handle the different app-sync environments based on if the app was installed from the app store or through testflight? Same for android, either the play store or the Android Beta program?

The problem is that the normal flow is to promote builds from beta to production. This means we don't create a new binary and don't have the ability to inject the app-sync environment keys.

Error on app reopen after an update is installed

Hello,

I get that error when I add a new release using release command and close the app and reopen on iOS simulator. I test it on local. tns build ios command is successful.
What could be the cause of the error?

JavaScript stack trace:
copyEntriesInFolderDestFolderError(file:///node_modules/nativescript-app-sync/TNSLocalPackage.js:36:48)
at onUnzipComplete(file:///node_modules/nativescript-app-sync/TNSLocalPackage.js:36:48)
at file:///node_modules/nativescript-app-sync/TNSLocalPackage.js:90:35
at UIApplicationMain([native code])
at _start(file:///node_modules/tns-core-modules/application/application.js:295:26)
at run(file:///node_modules/tns-core-modules/application/application.js:323:11)
at $start(file:///node_modules/nativescript-vue/dist/index.js:14050:2)
at file:///app/bundle.js:4373:10
at ./main.js(file:///app/bundle.js:4377:34)
at __webpack_require__(file:///app/webpack/bootstrap:74:0)
at checkDeferredModules(file:///app/webpack/bootstrap:43:0)
at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at promiseReactionJob([native code])
JavaScript error:
file:///node_modules/nativescript-app-sync/TNSLocalPackage.js:36:48: JS ERROR NSErrorWrapper: The folder “5720a69d6efaf9154f960105a59a75b08467452bb792b779bba221cb1d73692d” doesn’t exist.
NativeScript caught signal 11.
Native Stack:
1   0x10fb9bcb1 sig_handler(int)
2   0x113206b1d _sigtramp
3   0x10fab70a8
4   0x11312db85 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
5   0x113131e58 _Unwind_RaiseException
6   0x112c6f8bd __cxa_throw
7   0x1121dec44 _objc_exception_destructor(void*)
8   0x10fb51bbf NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
9   0x10fb684e9 NativeScript::FFICallback<NativeScript::ObjCBlockCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
10  0x110539756 ffi_closure_unix64_inner
11  0x11053a17a ffi_closure_unix64
12  0x111e8458d +[SSZipArchive unzipFileAtPath:toDestination:progressHandler:completionHandler:]
13  0x111e9fba9 __66+[TNSAppSync unzipFileAtPath:toDestination:onProgress:onComplete:]_block_invoke
14  0x112da3848 _dispatch_call_block_and_release
15  0x112da47b9 _dispatch_client_callout
16  0x112da6861 _dispatch_queue_override_invoke
17  0x112db3bf9 _dispatch_root_queue_drain
18  0x112db439b _dispatch_worker_thread2
19  0x11321871d _pthread_wqthread
20  0x1132185c3 start_wqthread
JS Stack unavailable. Current thread hasn't initialized a {N} runtime.
JS ERROR NSErrorWrapper: The folder “5720a69d6efaf9154f960105a59a75b08467452bb792b779bba221cb1d73692d” doesn’t exist.

Tried both on ON_NEXT_RESUME and IMMEDIATE install modes. I test the app while tns run ios --emulator --no-watch --no-hmr command is running. It only happens sometimes.

Registration failing with below error.

TypeError: Cannot read property 'length' of null
getShortTypeString
webpack:////redux-devtools-inspector/lib/tabs/getItemString.js:54
https://nativescript-codepush-web.herokuapp.com/assets/vendor.js:33441:29
getText
webpack:///
/redux-devtools-inspector/lib/tabs/getItemString.js:153
getItemString
webpack:////redux-devtools-inspector/lib/tabs/getItemString.js:176
JSONDiff._this.getItemString
webpack:///
/redux-devtools-inspector/lib/tabs/JSONDiff.js:148
JSONNestedNode.render
webpack:////react-json-tree/lib/JSONNestedNode.js:162
https://nativescript-codepush-web.herokuapp.com/assets/vendor.js:89229:21
measureLifeCyclePerf
webpack:///
/react-dom/lib/ReactCompositeComponent.js:73
ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext
webpack:///~/react-dom/lib/ReactCompositeComponent.js:792

Nativescript-Vue Support

Hi there,

This plugin looks very promising however it doesn't seem to work with Nativescript-Vue iOS.

Currently, I'm using the following:

  "nativescript": {
    "id": "sample.example.id",
    "tns-android": {
      "version": "6.3.1"
    },
    "tns-ios": {
      "version": "6.3.0"
    }
  },

"nativescript-app-sync": "^2.0.0"

Inside my main.js

import * as application from "tns-core-modules/application";
import { AppSync, InstallMode, SyncStatus } from "nativescript-app-sync";
import { isIOS } from "tns-core-modules/platform";

// App Sync
// Add this in some central place that's executed once in a lifecycle
application.on(application.resumeEvent, () => {
  AppSync.sync({
    deploymentKey: isIOS
      ? "{IOS_ID_HERE}"
      : "{ANDROID_ID_HERE}",

    installMode: InstallMode.ON_NEXT_RESTART,

    mandatoryInstallMode: isIOS
      ? InstallMode.ON_NEXT_RESUME
      : InstallMode.IMMEDIATE,

    updateDialog: {
      updateTitle: "Update Available",
      optionalUpdateMessage: "Please update to the latest version of the app.",
      mandatoryUpdateMessage: "Please update to the latest version of the app.",
      optionalIgnoreButtonLabel: "Later",
      mandatoryContinueButtonLabel: isIOS ? "Exit now" : "Restart now",
      appendReleaseDescription: true
    }
  });
});

new Vue({
  store,
  render(h) {
    return h(SideDrawer, [
      h(DrawerContent, {
        slot: "drawerContent"
      }),
      h(routes.RouteExample, {
        slot: "mainContent"
      })
    ]);
  }
}).$start();

Please let me know if there's something I'm doing wrong.

Wrong repeating update ???

Hello, im using app-sync now on few apps and just got wrong update repeatly.
after calling appSettings.clear(), the app will notify to exit/restart to update again.

is this the bug ?? or i have to avoid to call appSettings.clear() ??

thank you

Download error: Error: Could not access local package. Error: The request timed out.

Getting a Download error when trying app-sync on iOS.
Is there any additional configuration required?

We're not whitelisting any domains on Info.plist

Update: AppSync worked on iOS Simulator

On a subsequent launch, I did not get any download error on the device,
I got AppSync: up to date, but the app still showed an older version.

Update: On the simulator, the AppSync works, but HMR livesyncs don't work anymore.
On the device, the hmr livesyncs work fine, but the AppSync doesn't work.

If there is any more info required to debug this, please let me know :)

Update: Just noticed that even on Android, I'm unable to use HMR Livesyncs while using AppSync plugin. AppSync's version always prevails

Failed to open browser

I try using nativescript-code-push register cmd it shows register in a browser. But failed to open the browser. So kindly help me to find url so i can directly enter in a browser

Seemingly unnecessary sub-dependency "properties" causes problems

npm i nativescript-app-sync

... installs sub-dependency node_module "properties". I have 1.0.6 installed. This node_module then conflicts with running nativescript-app-sync and tns commands for different reasons. For tns there is a require(../properties) line in some code that for some reason imports the "properties" node_module instead of the file from the directory within the nativescript code module. I can't remember the problem using the nativescript-app-sync command but its something similar. At any rate, removing the node_modules/properties directory has no ill effect and solves all my problems. So it seems this is an unnecessary sub-dependency.

Anyone else run into this?

NativeScript 6.5 Crash [NativeScriptEmbedder.m]

Hi,

Help me, please.

Tell us about the problem
I can't archive the application, but I can run it on the device.

Which platform(s) does your issue occur on?
iOS

Please tell us how to recreate the issue in as much detail as possible.
Update to Nativescript 6.5.
I can run the application without problems
When I try to archive the application

Please, provide the details below:
error: error reading '/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/@nativescript/core/platforms/ios/src/NativeScriptEmbedder.m'

Full console
CompileC /Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/Objects-normal/arm64/NativeScriptEmbedder.o /Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/@nativescript/core/platforms/ios/src/NativeScriptEmbedder.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'PeuBreton' from project 'PeuBreton') cd /Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios export LANG=en_US.US-ASCII /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target arm64-apple-ios9.0 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -gmodules -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DCOCOAPODS=1 -DGPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 -DPB_FIELD_32BIT=1 -DPB_NO_PACKED_STRUCTS=1 -DPB_ENABLE_MALLOC=1 -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion -Wno-infinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-semicolon-before-method-body -iquote /Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/PeuBreton-generated-files.hmap -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/PeuBreton-own-target-headers.hmap -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/PeuBreton-all-target-headers.hmap -iquote /Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/PeuBreton-project-headers.hmap -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/include -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/nativescript-sqlite/platforms/ios -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/BEMCheckBox/BEMCheckBox.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseCore/FirebaseCore.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseInstallations/FirebaseInstallations.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseInstanceID/FirebaseInstanceID.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseMessaging/FirebaseMessaging.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/GoogleDataTransport/GoogleDataTransport.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/GoogleUtilities/GoogleUtilities.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/MDFInternationalization/MDFInternationalization.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/MaterialComponents/MaterialComponents.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/PromisesObjC/FBLPromises.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/Protobuf/protobuf.framework/Headers -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/nanopb/nanopb.framework/Headers -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/Pods/Headers/Public -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/Pods/Headers/Public/Firebase -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/Pods/Headers/Public/FirebaseAnalyticsInterop -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/Pods/Headers/Public/FirebaseCoreDiagnosticsInterop -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/Pods/Firebase/CoreOnly/Sources -I/Sources/FBLPromises/include -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/internal/Swift-Modules -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/internal -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/app/App_Resources/iOS/src -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/@nstudio/nativescript-checkbox/platforms/ios/src -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/nativescript-directions/platforms/ios/src -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/nativescript-plugin-firebase/platforms/ios/src -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/nativescript-sqlite/platforms/ios/src -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/@nativescript/core/platforms/ios/src -I/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/tns-core-modules-widgets/platforms/ios/src -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/DerivedSources-normal/arm64 -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/DerivedSources/arm64 -I/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/DerivedSources -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos -F/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/internal -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/BEMCheckBox -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseCore -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseCoreDiagnostics -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseInstallations -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseInstanceID -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/FirebaseMessaging -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/GoogleDataTransport -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/GoogleDataTransportCCTSupport -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/GoogleUtilities -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/MDFInternationalization -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/MaterialComponents -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/PromisesObjC -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/Protobuf -F/Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/BuildProductsPath/Release-iphoneos/nanopb -F/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/platforms/ios/Pods/GoogleAppMeasurement/Frameworks -F/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/nativescript-sqlite/platforms/ios -F/Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/tns-core-modules-widgets/platforms/ios -include /Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/PrecompiledHeaders/SharedPrecompiledHeaders/2375272865283983070/PeuBreton-Prefix.pch -MMD -MT dependencies -MF /Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/Objects-normal/arm64/NativeScriptEmbedder.d --serialize-diagnostics /Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/Objects-normal/arm64/NativeScriptEmbedder.dia -c /Users/franlaz/Desktop/RSK_Nativescript/PeuBreton/node_modules/@nativescript/core/platforms/ios/src/NativeScriptEmbedder.m -o /Users/franlaz/Library/Developer/Xcode/DerivedData/PeuBreton-gjmqdstunrqgsygztszfhiysvzwh/Build/Intermediates.noindex/ArchiveIntermediates/PeuBreton/IntermediateBuildFilesPath/PeuBreton.build/Release-iphoneos/PeuBreton.build/Objects-normal/arm64/NativeScriptEmbedder.o

Thanks

Error: Can't resolve '@nativescript/core'

Using Nativescript Vue and adding nativescript-app-sync, trying to import AppSync I get the following errors

 Can't resolve '@nativescript/core' in '/node_modules/nativescript-app-sync'
 @ ../node_modules/nativescript-app-sync/app-sync.js 9:13-42

as well as

ERROR in ../node_modules/nativescript-app-sync/TNSRemotePackage.js
ERROR in ../node_modules/nativescript-app-sync/TNSLocalPackage.js
ERROR in ../node_modules/nativescript-app-sync/TNSAcquisitionManager.js
ERROR in ../node_modules/nativescript-app-sync/TNSRequester.js

All with

Module not found: Error: Can't resolve '@nativescript/core'

Just an error when create new App .. but the staff is made

Hi @EddyVerbruggen ,

  1. On the step 4 in the registration page, when I click on create (finish) the button was disabled and no think happen, I wait 30 second, then I try to login and it was successful !

  2. The error bellow it appear once on the terminal when create new app (I have created 3 apps, the error appear for the last one only) .. but the app was created.

Do you think I can use the Beta version on the Prod App ?

nativescript-app-sync app add LightPAYMerchantIOS ios
[Error]  <!DOCTYPE html>
	<html>
	  <head>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta charset="utf-8">
		<title>Application Error</title>
		<style media="screen">
		  html,body,iframe {
			margin: 0;
			padding: 0;
		  }
		  html,body {
			height: 100%;
			overflow: hidden;
		  }
		  iframe {
			width: 100%;
			height: 100%;
			border: 0;
		  }
		</style>
	  </head>
	  <body>
		<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
	  </body>
	</html>

Add Angular demo

Not that it's too different from the regular demo, but still useful.

Local App doesn't get updates

@EddyVerbruggen
when I change something in my app nothing happens until i comment out this code

application.on(application.resumeEvent, () => {
    AppSync.sync({
        deploymentKey: token,
    });
});

[Update translate] Synchronize nativescript-app-sync with nativescript-localize

Hi @EddyVerbruggen,

I use currently this plugin on my prod App, since we can not edit the Resources file and the translate wont be affected by the update. I've thought about how we can update the text or the translate on the app. I have done a little test, it work but I dont know how much it is a good solution !!

The idea is :
On the nativescript-app-sync side :
add a new options syncWithNsLocalize if it is set, create new boolean on the application settings __SYNC_NS_LOCALIZE__

On the nativescript-localize side :
1- if __SYNC_NS_LOCALIZE__ is set, we will import the json file __app__language__.json into localize.android.ts and localize.ios.ts
2- Override the string if the value that come from the json file dont match with the value from the resources file

I know the parser it is bizarre but I haven't thought about it yet if there is a better way to achieve this

// here it is the localize.ios.ts

const data = require('__app__language__.json');
let str = parser.parse(data, key, args);

if(str !== null && str  !== vsprintf(convertAtSignToStringSign(localizedString), args)) {
        console.log("VALUE ARE NOT SAME !")
        return str;
}

return vsprintf(convertAtSignToStringSign(localizedString), args);

const parser = {
    parse: (data: any, key: string, args?: any): string => {
        try {
            let splits = key.split(".");
            let value = null;
            for(let i = 0; i < splits.length; i++) {
                switch(i) {
                    case 0:
                        value = parser.value(data[splits[0]]);
                        break;
                    case 1:
                        value = parser.value(data[splits[0]][splits[1]]);
                        break;
                    case 2:
                        value = parser.value(data[splits[0]][splits[1]][splits[2]]);
                        break;
                    case 3:
                        value = parser.value(data[splits[0]][splits[1]][splits[2]][splits[3]]);
                        break;
                    case 4:
                        value = parser.value(data[splits[0]][splits[1]][splits[2]][splits[3]][splits[4]]);
                        break;
                    case 5:
                        value = parser.value(data[splits[0]][splits[1]][splits[2]][splits[3]][splits[4]][splits[5]]);
                        break;
                }
            }
            return vsprintf(value, args);
        } catch(e) {
            console.log(e)
            return null;
        }
    },
    value: (data) => {
        return data !== "undefined" ? data : null;
    }
}

Rename to AppSync

We currently call this product 'CodePush', but we don't want to step on anyone's toes, nor confuse folks in case they are also familiar with Microsoft's CodePush product.

App doesn't change after UPDATE_INSTALLED and restart on Android with {N} Angular

nativescript-code-push works really well with {N} Core Android/iOS and {N} Angular iOS, however it doesn't seem to work with {N} Angular with Android.

The app indicates triggers events with SyncStatus.UPDATE_INSTALLED, however when I restart the app the expected changes are not there. CodePush.sync returns SyncStatus.UP_TO_DATE.

Re: changes file list logs

Hello All,

I created a release request and it successfully completed. but I want to see what changes have been deployed on code push server. As screenshot attached.

image

Unable to resolve host "appsync-server.nativescript.org"

I am testing with an nativescript angular app and I get the following error

: ERROR Error: Uncaught (in promise): Error: java.net.UnknownHostException: Unable to resolve host "appsync-server.nativescript.org": No address associated with hostname
JS: Error: java.net.UnknownHostException: Unable to resolve host "appsync-server.nativescript.org": No address associated with hostname
JS: at new ZoneAwareError (file:///node_modules@nativescript\angular\zone-js\dist\zone-nativescript.js:1298:0)
JS: at onRequestComplete (file:///node_modules@nativescript\core\http\http-request\http-request.js:54:0)
JS: at Object.onComplete (file:///node_modules@nativescript\core\http\http-request\http-request.js:43:0)

I can access to that website through a browser - so access is not an issue.
I am testing it through an emulator

Feature Request: Version label in the Sync success callback

I've noticed that all the app-sync updates get published with a label v1, v2, v3.. and so on,
it would be nice to receive this label as the 2nd parameter on the AppSync.sync()'s success callback.

AppSync.sync({ ... }, (syncStatus, updateLabel) => {
  if (syncStatus === SyncStatus.UP_TO_DATE) {
    console.log("AppSync: up to date", updateLabel);
  } else if (syncStatus === SyncStatus.UPDATE_INSTALLED) {
    console.log("AppSync: update installed", updateLabel);
  }
});

If not, it would be nice to let the developer pass a version tag during the release that gets returned here.

[iOS] Not getting any updates

I'm having a hard time in getting any updates in my iOS app even tho the logs state that the updated has been applied. This is what I did:

  1. Installed the app-sync-cli & app-sync plugin. configured appsync in my app.ts in the application.resumeEvent.
  2. Added deployment keys for each platform, sat installMode to ON_NEXT_RESTART\ON_NEXT_RESUME
  3. Configured the updateDialog & Added syncStatus logs.
  4. Build the app, and ran it on my iPhone Xs Max running iOS 12.4
  5. The logs state No pending updates; you’re running the latest version. Good.
  6. I made a small change in one of my views and ran a new build.
  7. Published a release with appsync nativescript-app-sync release myAppIOS ios --d Production
  8. The website doesn't show any releases, but the cli does. Label V1. Good.
  9. Used the app a bit, closed it, opened it again. This time log states: Update found and installed. It will be activated upon next cold reboot. (No update dialog showed up...)
  10. Checked the view I modified, no update applied.
  11. Closed the app, restarted it again, log states: No pending updates; you’re running the latest version
  12. Checked the view I modified, no update applied.

What am I missing here? Is there a debug mode or something in particular I should look for?
Do all builds have to be release-builds?

NS 6.0.2
ios-platform: 6.0.1
core-modules: 6.0.4
app-sync: 1.0.4

Allow an arbitrary server URL

Currently, the server URL is hardcoded to our custom backend, but there is nothing stopping users from cloning the server repo and hosting their own. So this issue will allow folks to configure the plugin to use their own backend.

Re: Debug apk

Hello,

Did we need to create build or release APK?
And how much time it takes to reflect on a client application?

Thanks,

How do I know AppSync.sync is finished?

I want to display dialog when sync is finished, but when I added show modal function (Nativesciprt +Angular) in SuccessCallback using ModalDialogService, ios is not working.

I tried to set timeout for showing dialog (I tried 300, 500, 1000, even 3000), but it's not work. And I moved show modal out SuccessCallback it's ok.

But I can't try add it after App.Sync...because it's a void.

How could I do for this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.