Giter VIP home page Giter VIP logo

capacitor-codepush's People

Contributors

alexandergoncharov-zz avatar botatoes avatar buptkang avatar cjonsmith avatar clovel avatar dasmajo avatar dlebu avatar geof90 avatar itoys avatar kamengoranchev avatar leo6104 avatar lincolnthree avatar loban avatar lostintangent avatar matrosov-nikita avatar matt-auckland avatar matthiaswenz avatar msftgits avatar nicktoropov avatar nothankyou1 avatar phyr0s avatar rub8n avatar ruslan-bikkinin avatar ryuyu avatar semantic-release-bot avatar sergey-akhalkov avatar shishirx34 avatar vially avatar yuri-kulikov avatar zakeelm 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

capacitor-codepush's Issues

iOS: Updates extract/say they are installed, but are always rolled back

Description

So, I'm not exactly sure how to report on this one. I've been stuck on it for a few days. I'm wondering if anyone else has observed this behavior.

It seems as if the updates are downloaded and extracted correctly, but when the app restarts, the update is not activated and nothing has changed.

The .sync() method is called again, reporting that the same update is available, but has been rolled back already.

Reproduction

  1. Install app to local iOS device or simulator
  2. Make sure an update is ready on Codepush for the installed bundle version
  3. Start the app & observe logs
  4. Ensure app calls codePush.sync()
  5. Update should install and "waiting until reloaded/restarted" (unless immediate activation is set, at which point it restarts right away)

Screenshot of device filesystem at this point:

Deploy:
image

Download:
image

  1. Restart to activate the update (the update will not be activated at this point, but... continue on)

  2. Ensure application calls "codePush.notifyApplicationReady()"

Device will log:

[Warning] UPDATE: Committing update. (Will not be rolled back.) (vendor-es2015.js, line 86501)
[Warning] UPDATE: Checking for update. (vendor-es2015.js, line 86501)
  1. Ensure app calls codePush.sync() again to verify status
  2. The update will not be available but not activated/not installing, because status is "previously rolled back"

Device will log:

[Log] [CodePush] An update is available. {"isDownloading":false,"appVersion":"10.0.6","deploymentKey":"XXXXXXXXXXX","downloadUrl":"https://codepushupdates.azureedge.net/storagev2/XXXXXXXXXXX","isMandatory":false,"label":"v1","packageHash":"XXXXXXXXXXX","packageSize":7092826,"failedInstall":1} (vendor-es2015.js, line 86501)
[Log] [CodePush] An update is available, but it is being ignored due to have been previously rolled back. (vendor-es2015.js, line 86501)

Screenshot of device filesystem at this point:

image

Additional Information

  • cordova-plugin-code-push version: Latest version from github #capacitor branch.

(The more info the faster we will be able to address it!)

Can not use `sync` method in script

Description

I want to use CodePush in index.html.
But error occurred : Unhandled Promise Rejection: Error: "CodePush.sync()" is not implemented on iOS

<script src="capacitor.js"></script>
<script>
async function onLoad() {
  const { Plugins } = Capacitor;
  const { CodePush } = Plugins;
  document.addEventListener(
    'deviceready',
    async function () {
      await CodePush.sync()
    },
    false
  );
  document.addEventListener(
    'resume',
    function () {
      ...
    },
    false
  );
  document.addEventListener(
    'pause',
    function () {
      ...
    },
    false
  );
}
</script>
...
<body onload="onLoad()">

So I checked CodePush object
but there is no sync method. also API is different from docs.

image

How can I solve this ?

Additional Information

I use vue2 and capacitor3

Plugin Error

appcenter codepush release -a salem/salemandroid -c ./android/app/src/main/assets/public/ --target-binary-version "~1.0" -d Production
Error: Deployment "Production" does not exist.

Error: "Cannot overwrite directory" during install

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Description

After user confirms "Install" (or non-dialog install), the following error occurs during copying of files:

index.js:78 native Filesystem.copy (#35089827):

Object:
{
callbackId: "82559909"
methodName: "copy"
options:
directory: "DATA"
from: "codepush/download/unzipped"
to: "codepush/deploy/versions/e07143b920ba863f8a1d1c909d584963655e6a7df9ee85f7681f0995a76f5ab3"
toDirectory: "DATA"
__proto__: Object
pluginId: "Filesystem"
__proto__: Object
}
    at Object.cap.fromNative (http://10.0.0.3:8100/vendor.js:88789:24)
    at <anonymous>:1:18
logError @ codePushUtil.js:47
push.Yr+L.CodePushUtil.invokeErrorCallback @ codePushUtil.js:59
installError @ localPackage.js:44
(anonymous) @ localPackage.js:70
rejected @ localPackage.js:5
invoke @ zone-evergreen.js:372
onInvoke @ core.js:28579
invoke @ zone-evergreen.js:371
run @ zone-evergreen.js:134
(anonymous) @ zone-evergreen.js:1276
invokeTask @ zone-evergreen.js:406
onInvokeTask @ core.js:28566
invokeTask @ zone-evergreen.js:405
runTask @ zone-evergreen.js:178
drainMicroTaskQueue @ zone-evergreen.js:582
Promise.then (async)
scheduleMicroTask @ zone-evergreen.js:565
scheduleTask @ zone-evergreen.js:396
onScheduleTask @ zone-evergreen.js:283
scheduleTask @ zone-evergreen.js:386
scheduleTask @ zone-evergreen.js:221
scheduleMicroTask @ zone-evergreen.js:241
scheduleResolveOrReject @ zone-evergreen.js:1266
resolvePromise @ zone-evergreen.js:1204
(anonymous) @ zone-evergreen.js:1120
cap.fromNative @ index.js:297
(anonymous) @ VM2627:1
15:22:59.417 codePushUtil.js:47 [CodePush] An error occurred during sync. Cannot overwrite a directory. StackTrace: Error: Cannot overwrite a directory
    at Object.cap.fromNative (http://10.0.0.3:8100/vendor.js:88789:24)
    at <anonymous>:1:18

Reproduction

  1. Ensure update is available in AppCenter
  2. Run the app with this plugin installed
  3. Call codePushUtil.sync()

Additional Information

  • cordova-plugin-code-push version: This repo
  • List of installed plugins:
[info] Found 20 Capacitor plugins for ios:
       @capacitor-community/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       [email protected]
       [email protected]
       [email protected]
[info] Found 2 Cordova plugins for ios:
       [email protected]
       [email protected]
  • Capacitor version: 3.0.0-beta.6
  • iOS/Android/Windows version: iOS 14, Android 11
  • Does this reproduce on a debug build or release build? Both
  • Does this reproduce on a simulator, or only on a physical device? Both

app rolls back to the version before update after closed and opened again

I am testing this on an Ionic/Capacitor/Angular/Firebase project, NOT Cordova.
What I have done so far:

Created new app with appcenter apps create -d <appDisplayName> -o iOS -p Cordova
Created new deployment with appcenter codepush deployment add -a <ownerName>/<appName> Production
Built new app version ready for release with ionic capacitor build
Released new version with appcenter codepush release -a <ownerName>/<appName> -c ./PATH_TO_BUILD -m -t 1.0 -d Production
In the angular app I have this:

codePush
      .sync(
        {
          installMode: InstallMode.ON_NEXT_RESUME,
          mandatoryInstallMode: InstallMode.IMMEDIATE,
          onSyncStatusChanged: (status) => {
            console.log(status)
          },
        },
        (progress) => {
          console.log(progress)
          );
        }
      )
      .then((status) => {
        console.log(status)
      });

If I make an update available via Codepush, the update downloads and installs, the app restarts, I can see the changes, everything works.
But if I close the app and open it again, it loads in the state before the update was applied.
Tested on emulator and real device. Same behavior.
If anyone has a suggestion where I got it wrong, please do let me know.

*UPDATE: Today I tested also on Android, behavior is exactly the same as on iOS.
*UPDATE 2: Another thing that does not work for me are the callbacks that should be returning the update download progress and onSyncStatusChanged. Even though the update gets downloaded and installed these callbacks never seem to fire.

Waiting for @capacitor/filesystem next release

Currenctly, @capacitor/filesystem 0.3.1 has problems

  1. Filesystem.copy in Android
  2. Filesystem.rmdir in iOS

It doesn't give Promise.resolve signal from native side.

I open issue & create PR for them. It will be released to next version 0.3.2

Waiting for next release.

CodePush causes uncaught exceptions when previewing project on a web browser

Description

When debugging or developing an app using a web browser (for example for styling development), CodePush throws an uncaught exception that does not come from the app's source code.

Additional Information

This issue does not happen with other Capacitor plugins that are "mobile-only". A good example is the Firebase notification plugin.

Screenshots

Exception :

Capture_d_écran_2021-06-30_à_15 39 29

Code extract :
Capture_d_écran_2021-06-30_à_15 40 08

Maintenance: Update iOS CAPPluginCall access to use non-deprecated APIs

Description

Per Capacitor team, the NSString, BOOL, and NSNumber accessors for CAPPluginCall will be deprecated going forward, in favor of this api:

https://github.com/ionic-team/capacitor/blob/main/ios/Capacitor/Capacitor/JSTypes.swift
https://github.com/ionic-team/capacitor/blob/main/ios/Capacitor/Capacitor/CAPBridgedJSTypes.h (requires additional import statement)

See: ionic-team/capacitor#4303 (comment)

Resolution steps

The iOS implementation should be refactored to use these new methods:

https://github.com/mapiacompany/capacitor-codepush/blob/capacitor/ios/Plugin/CodePush.m#L177
https://github.com/mapiacompany/capacitor-codepush/blob/capacitor/ios/Plugin/CodePush.m#L190

And other places that reference the deprecated methods.

Will this work in an ionic 5/capacitor 3/angular/firebase project?

Just a quick question if this should work in an ionic 5/capacitor 3/angular/firebase project to have the same functionality as provided by Ionic Appflow Live Updates. Just to be sure if this is viable for my use case before I dive in deeper trying to implement it. Thank you 🙏 .

Default `www` is hardcoded and required

Description

When building with Angular/Ionic/Capacitor for Android, the final assets output is located in ./android/app/src/main/assets/public. The path used in the AppCenter CLI updateContentsPath flag, or -c is apparently relevant to the checks performed internally (or maybe used to name the resulting zip file.) Therefore, executing appcenter codepush release -a "whatever" -c "./android/app/src/main/assets/public" prevents the update files from being found. If you move the files to a www folder (or rename public -> www, it works.

tl;dr www is hardcoded. If the resulting extracted dir is based on the zip filename, that should be used, or otherwise expose a config.

ERROR in node_modules/capacitor-codepush/dist/esm/definitions.d.ts:1:13 - error TS1005: '=' expected.

ERROR in node_modules/capacitor-codepush/dist/esm/definitions.d.ts:1:13 - error TS1005: '=' expected.

1 import type { NativeCodePushPlugin } from "./nativeCodePushPlugin";
~
node_modules/capacitor-codepush/dist/esm/definitions.d.ts:1:43 - error TS1005: ';' expected.

1 import type { NativeCodePushPlugin } from "./nativeCodePushPlugin";
~~~~~~~~~~~~~~~~~~~~~~~~

"dependencies": {
"@agm/core": "^1.1.0",
"@angular/animations": "^8.2.13",
"@angular/cdk": "^8.2.3",
"@angular/common": "^8.2.13",
"@angular/compiler": "^8.2.13",
"@angular/core": "^8.2.13",
"@angular/fire": "^5.4.2",
"@angular/forms": "^8.2.13",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "^8.2.13",
"@angular/platform-browser-dynamic": "^8.2.13",
"@angular/pwa": "^0.901.5",
"@angular/router": "^8.2.13",
"@angular/service-worker": "^8.2.13",
"@capacitor-community/http": "^0.3.0",
"@capacitor/android": "^2.4.7",
"@capacitor/core": "^2.4.7",
"@capacitor/dialog": "^0.4.6",
"@capacitor/filesystem": "^0.5.2",
"@ionic-native/android-permissions": "^5.29.0",
"@ionic-native/app-version": "^5.31.1",
"@ionic-native/core": "^5.25.0",
"@ionic-native/diagnostic": "^5.29.0",
"@ionic-native/file-opener": "^5.28.0",
"@ionic-native/firebase-config": "^5.31.1",
"@ionic-native/geolocation": "^5.29.0",
"@ionic-native/in-app-browser": "^5.28.0",
"@ionic-native/location-accuracy": "^5.29.0",
"@ionic-native/screen-orientation": "^5.28.0",
"@ionic-native/social-sharing": "^5.25.0",
"@ionic-native/splash-screen": "^5.25.0",
"@ionic-native/status-bar": "^5.28.0",
"@ionic/angular": "^5.6.3",
"@ionic/pwa-elements": "^3.0.1",
"@ionic/storage": "2.2.0",
"@nebular/eva-icons": "4.6.0",
"@nebular/theme": "4.6.0",
"@ng-select/ng-select": "^3.7.3",
"@ngxs/store": "^3.6.2",
"@sentry/browser": "^5.22.3",
"angular-fire-schematics": "^1.0.0",
"angular-otp-box": "^1.0.1",
"angularx-qrcode": "^2.1.1",
"blob-util": "^2.0.2",
"blueimp-canvas-to-blob": "^3.28.0",
"capacitor-codepush": "https://github.com/mapiacompany/capacitor-codepush",
"classlist.js": "^1.1.20150312",
"cordova-browser": "^6.0.0",
"cordova-plugin-android-permissions": "^1.1.0",
"cordova-plugin-androidx-adapter": "^1.1.1",
"cordova-plugin-app-version": "^0.1.12",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-file-opener2": "^3.0.4",
"cordova-plugin-firebase-analytics": "4.4.1",
"cordova-plugin-firebase-config": "^5.0.0",
"cordova-plugin-firebase-inappmessaging": "^3.4.0",
"cordova-plugin-geolocation": "^4.1.0",
"cordova-plugin-inappbrowser": "^5.0.0",
"cordova-plugin-ionic": "5.4.7",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.2.1",
"cordova-plugin-request-location-accuracy": "^2.3.0",
"cordova-plugin-screen-orientation": "^3.0.2",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-socialsharing": "^5.6.5",
"cordova-sqlite-storage": "^5.1.0",
"cordova-support-android-plugin": "^1.0.2",
"cordova.plugins.diagnostic": "^6.0.2",
"core-js": "^2.5.4",
"crypto-js": "^3.3.0",
"device-uuid": "^1.0.4",
"es6-promise-plugin": "^4.2.2",
"eva-icons": "1.1.2",
"firebase": "^6.6.2",
"hammerjs": "^2.0.8",
"intl": "^1.2.5",
"jetifier": "^1.6.6",
"lodash": "^1.0.0",
"lottie-web": "^5.7.5",
"ng-connection-service": "^1.0.4",
"ng-image-slider": "2.5.0",
"ng-lazyload-image": "^9.1.0",
"ng-navigator-share": "^1.0.3",
"ng-zorro-antd": "^8.5.2",
"ngx-cookie-service": "^2.4.0",
"ngx-image-compress": "^8.0.4",
"ngx-infinite-scroll": "^9.1.0",
"ngx-lottie": "^6.4.0",
"ngx-mask": "^8.2.0",
"ngx-snackbar": "^2.0.1",
"ngx-timeago": "^1.0.4",
"pdfmake": "^0.1.66",
"primeng": "^8.1.1",
"rxjs": "6.5.2",
"rxjs-compat": "6.3.0",
"time-ago-pipe": "^1.3.2",
"tslib": "^1.11.2",
"web-animations-js": "^2.3.2",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/architect": "^0.803.29",
"@angular-devkit/build-angular": "^0.803.29",
"@angular/cli": "^8.3.26",
"@angular/compiler-cli": "^8.2.13",
"@angular/language-service": "^8.2.13",
"@capacitor/cli": "^2.4.6",
"@ionic/angular-toolkit": "^2.3.3",
"@ionic/lab": "3.0.1",
"@ngxs/devtools-plugin": "^3.6.2",
"@ngxs/logger-plugin": "^3.6.2",
"@types/crypto-js": "^3.1.45",
"@types/googlemaps": "^3.39.13",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/lodash": "^4.14.161",
"@types/node": "~8.9.4",
"@types/swiper": "^5.3.0",
"codelyzer": "^5.2.2",
"cordova-plugin-androidx": "^2.0.0",
"cordova-plugin-device": "^2.0.3",
"gulp": "^4.0.2",
"gulp-gzip": "^1.4.2",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.5.3",
"protractor": "^5.4.4",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
},
"cordova": {
"plugins": {
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-base64-to-gallery": {},
"cordova-plugin-fcm-with-dependecy-updated": {}
},
"platforms": [
"android"
]
}

[NOT A ISSUE] AppCenter CodePush Backend Alternative

Hi, since Cordova retirement on AppCenter and per consequence Capacitor, I started looking for an backend alternative.

I almost started one from scratch, but I found an old (dated 2019) repository made by a guy and one fork with some commits but outdated too (the most recents commits are dependences only). It's pretty outdated since need to use [email protected], but I managed to make it work with latest [email protected] and [email protected] with little adjustments.

I'm currently self-hosting my own CodePush backend and already delivered 224 updates since Oct 30, without rollbacks so far. (I have a small base of users :/)

Since the backend normally works with CodePush and Capacitor I believe it will be a good point to revive that project.

I'm thinking some thing like Integration with OneDrive as "CDN" to host the updates or like so.

Add additional maintainers?

I can't thank you enough for your initial work on this @leo6104.

It seems now however that there are several useful PRs awaiting merge for a couple of months now.

If you have less time to maintain/review these, would it be beneficial adding active contributors such as @Clovel to keep this fork moving?

Docs Update

This repo is forked from cordova project.

We replace all onSuccess/onFailure callback parameter to Promise-pattern.

Let's update README.md .

Cannot read property 'onSyncStatusChanged' of undefined

I am trying to implement CodePush functionality on my app. Followed the readme tutorial line by line but I am receiving the following error

Uncaught (in promise): TypeError: Cannot read property 'onSyncStatusChanged' of undefined
TypeError: Cannot read property 'onSyncStatusChanged' of undefined

Project Info

Ionic:

Ionic CLI : 6.16.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.6.8
@angular-devkit/build-angular : 12.0.2
@angular-devkit/schematics : 12.0.2
@angular/cli : 12.0.2
@ionic/angular-toolkit : 4.0.0

Capacitor:

Capacitor CLI : 3.0.0
@capacitor/android : 3.0.1
@capacitor/core : 3.0.0
@capacitor/ios : not installed

Unable to verify signature for package: PUBLIC_KEY in capacitor.config.json

"CodePush": {
      "IOS_DEPLOY_KEY": "IOS_DEPLOYMENT_KEY",
      "IOS_PUBLIC_KEY": "APP_SECRET_KEY",
      "ANDROID_DEPLOY_KEY": "ANDROID_DEPLOYMENT_KEY",
      "ANDROID_PUBLIC_KEY": "APP_SECRET_KEY",
      "SERVER_URL": "https://codepush.appcenter.ms/"
 }

Hi, in the capacitor.config.json file, what exactly should I put in place of IOS_PUBLIC_KEY and ANDROID_PUBLIC_KEY?
It's mentioned that I put the APP_SECRET_KEY. Is the the one:

<platform name="android">
  <preference name="APP_SECRET" value="key-which-is-shown-here" />
</platform>

^ displayed on appcenter dashboard.

If I put that one, I get the following error:

Unable to verify signature for package: Error: Error occurred while creating the a public keyjava.security.spec.InvalidKeySpecException: com.android.org.conscrypt.OpenSSLX509CertificateFactory$ParsingException: Error parsing public key. StackTrace: Error: Unable to verify signature for package: Error: Error occurred while creating the a public keyjava.security.spec.InvalidKeySpecException: com.android.org.conscrypt.OpenSSLX509CertificateFactory$ParsingException: Error parsing public key
    at decodeSignatureFail

IllegalStateException on Android 7

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Description

Not sure what's happening yet, but some errors occurring in Play Analytics. I will try to investigate.

Reproduction

Screenshot_20210313-091929

Screenshot_20210313-091951

Additional Information

  • cordova-plugin-code-push version: latest
  • List of installed plugins:
  • Cordova version: capacitor 3
  • iOS/Android/Windows version: Android
  • Does this reproduce on a debug build or release build? Release
  • Does this reproduce on a simulator, or only on a physical device? Physical

(The more info the faster we will be able to address it!)

Android build error: Could not get unknown property 'androidxAppCompatVersion'

Description

Im trying to use this capacitor-codepush in an ionic + capacitor app for Android and it fails when building with this error:

A problem occurred evaluating project ':capacitor-codepush'. Could not get unknown property 'androidxAppCompatVersion' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Reproduction

install latest version of capacitor-codepush, then run:
ng build
npx cap copy android
npx cap open android

The error is fired when the app is indexing in Android Studio.

Additional Information

It only happens to Android, in iOS is working

List of installed plugins:

"@capacitor/core": "^3.2.3"
"@capacitor/device": "^1.0.3"
"@capacitor/dialog": "^1.0.3"
"@capacitor/filesystem": "^1.0.3"
"@capacitor/android": "^3.2.3"

Any help? Thanks in advance

CORS error: cannot download the update.zip file during .sync()

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Description

After #8 the plugin starts and syncs with the appcenter. Nonetheless it cannot download the file, apparently due to cors restrictions.
It does create the destination folder but nothing more.

⚡️  [error] - {"message":"Impossibile aprire il file “update.zip” perché non c'è un file di quel tipo.","errorMessage":"Impossibile aprire il file “update.zip” perché non c'è un file di quel tipo."}
⚡️  [error] - [CodePush]  Origin capacitor://localhost is not allowed by Access-Control-Allow-Origin.. StackTrace: capacitor://localhost/js/chunk-vendors.bfede95a.js:1:58326
generatorResume@[native code]
s@capacitor://localhost/js/chunk-vendors.bfede95a.js:1:57492
promiseReactionJob@[native code]

I tried adding @capacitor-community/http but nothing changes.

Any hints?

Maybe bug: User prompted for Filesystem access

Thanks so much for getting this plugin converted to Capacitor!

Description

After installing and configuring the code-push plugin, doing some preliminary testing seems to show that users are required to accept the following permission prompt:

image

Is this normal, or have I done something wrong? It seems this plugin should be able to function without writing to External storage, but I am not an Android permissions expert.

Reproduction

  1. Ensure update is available in AppCenter
  2. Run the app with this plugin installed
  3. Call codePushUtil.sync()

Additional Information

  • cordova-plugin-code-push version: This repo
  • List of installed plugins:
[info] Found 20 Capacitor plugins for ios:
       @capacitor-community/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       [email protected]
       [email protected]
       [email protected]
[info] Found 2 Cordova plugins for ios:
       [email protected]
       [email protected]
  • Capacitor version: 3.0.0-beta.6
  • iOS/Android/Windows version: iOS 14, Android 11
  • Does this reproduce on a debug build or release build? Both
  • Does this reproduce on a simulator, or only on a physical device? Both

(The more info the faster we will be able to address it!)

Public key was provided but there is no JWT signature within app bundle to verify

E/Capacitor/Console: File: http://localhost/vendor.js - Line 131045 - Msg: [CodePush] Error! Public key was provided but there is no JWT signature within app bundle to verify. Possible reasons, why that might happen:
1. You've been released CodePush bundle update using version of CodePush CLI that is not support code signing.
2. You've been released CodePush bundle update without providing --privateKeyPath option.. StackTrace: Error: Error! Public key was provided but there is no JWT signature within app bundle to verify. Possible reasons, why that might happen:
1. You've been released CodePush bundle update using version of CodePush CLI that is not support code signing.
2. You've been released CodePush bundle update without providing --privateKeyPath option.
at verify (http://localhost/vendor.js:131531:32)
at http://localhost/vendor.js:131573:21
at LocalPackage. (http://localhost/vendor.js:131592:17)
at Generator.next ()
at fulfilled (http://localhost/vendor.js:131438:58)
at ZoneDelegate.invoke (http://localhost/polyfills.js:436:30)
at Zone.run (http://localhost/polyfills.js:196:47)
at http://localhost/polyfills.js:1354:38
at ZoneDelegate.invokeTask (http://localhost/polyfills.js:470:35)
at Zone.runTask (http://localhost/polyfills.js:241:51)

NOTE, I am using the latest appcenter-cli
I also provided a private key path

[Critical] Android native updates do not override downloaded CodePush bundle for prior versions.

Description

When app is updated via streaming, if a CodePush update was previously downloaded, it will still be used instead of using the new native bundled code.

Reproduction

  1. Install app version 1.0.0
  2. Prepare a codepush release for 1.0.0 and make sure it is installed via codepush.
  3. Stream / update app version 1.0.1 via native build (adb install -r path/to/release.apk)
  4. The app native version will be 1.0.1, but the code running will still be 1.0.0 (from codepush)

This seems incorrect, as the bundle should use the newer code from the native install/update.

Thoughts on this?

Additional Information

  • cordova-plugin-code-push version: Latest
  • iOS/Android/Windows version: Android 11 (have not tested with others)
  • Does this reproduce on a debug build or release build? Release build streamed via ADB, not sure about prod install from Play Store yet.
  • Does this reproduce on a simulator, or only on a physical device? Physical device.

Report status API error

It has an issue with codePush.reportFailed / codePush.reportSucceeded.
We cannot track the deployment status in AppCenter Dashboard.

It should be fixed.

[CodePush] An error occurred while reporting status: {"status":0,"appVersion":"4.4.4","deploymentKey":"X------------------","lastVersionLabelOrAppVersion":null,"lastVersionDeploymentKey":null} 400: {"status":400,"name":"Error","message":"Missing required body parameter \"release_metadata\""

HTTP methods fail on iOS due to malformed GET request with body (Native)

Description

It appears that the network code for this plugin is incorrectly constructing get requests.

2021-03-03 15:02:22.938979-0500 App[6904:5522939] Task <A2C990DB-1A87-4124-ABA1-B6141979FD3A>.<3> finished with error [-1103] Error Domain=NSURLErrorDomain Code=-1103 "resource exceeds maximum size" UserInfo={NSLocalizedDescription=resource exceeds maximum size, NSErrorFailingURLStringKey=https://codepush.appcenter.ms/v0.1/public/codepush/report_status/download, NSErrorFailingURLKey=https://codepush.appcenter.ms/v0.1/public/codepush/report_status/download, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <A2C990DB-1A87-4124-ABA1-B6141979FD3A>.<3>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <A2C990DB-1A87-4124-ABA1-B6141979FD3A>.<3>, NSUnderlyingError=0x282ca1e00 {Error Domain=kCFErrorDomainCFNetwork Code=-1103 "(null)"}}
2021-03-03 15:02:22.943402-0500 App[6904:5522933] GET method must not have a body
2021-03-03 15:02:22.943573-0500 App[6904:5522933] Task <2FBC8F8C-78F4-4BE7-AEB3-E8EA130F2468>.<4> finished with error [-1103] Error Domain=NSURLErrorDomain Code=-1103 "resource exceeds maximum size" UserInfo={NSLocalizedDescription=resource exceeds maximum size, NSErrorFailingURLStringKey=https://codepush.appcenter.ms/v0.1/public/codepush/report_status/deploy, NSErrorFailingURLKey=https://codepush.appcenter.ms/v0.1/public/codepush/report_status/deploy, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <2FBC8F8C-78F4-4BE7-AEB3-E8EA130F2468>.<4>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <2FBC8F8C-78F4-4BE7-AEB3-E8EA130F2468>.<4>, NSUnderlyingError=0x282cadbf0 {Error Domain=kCFErrorDomainCFNetwork Code=-1103 "(null)"}}

Reproduction

  1. Update available in AppCenter
  2. Run codePush.sync() on an iOS device.
  3. Inspect device logs.

Additional Information

I am already using your fork of @capacitor-community/http#dist, and the latest plugin code for app other @capacitor/* plugins.

CodePush is not implemented on Android

Description

I am trying to run codePush.sync() on button click to try things out. However I get the following error:

CodePush plugin is not implemented on Android How do I resolve this issue?

These are my plugins from capcitor.config.json:

includePlugins: [
    'cordova-plugin-file',
    'cordova-plugin-advanced-http',
    '@ionic-native/http',
    '@capacitor/geolocation',
    '@capacitor/app',
    '@capacitor/filesystem',
    '@capacitor/dialog',
    '@capacitor/device',
    '@capacitor-community/http',
    'capacitor-codepush',
  ],

Here is the capacitor.plugins.json:

[
	{
		"pkg": "@capacitor/geolocation",
		"classpath": "com.capacitorjs.plugins.geolocation.GeolocationPlugin"
	},
	{
		"pkg": "@capacitor/app",
		"classpath": "com.capacitorjs.plugins.app.AppPlugin"
	},
	{
		"pkg": "@capacitor/filesystem",
		"classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin"
	},
	{
		"pkg": "@capacitor/dialog",
		"classpath": "com.capacitorjs.plugins.dialog.DialogPlugin"
	},
	{
		"pkg": "@capacitor/device",
		"classpath": "com.capacitorjs.plugins.device.DevicePlugin"
	},
	{
		"pkg": "@capacitor-community/http",
		"classpath": "com.getcapacitor.plugin.http.Http"
	},
	{
		"pkg": "capacitor-codepush",
		"classpath": "com.microsoft.capacitor.CodePush"
	}
]

Dependencies:

"dependencies": {
    "@capacitor-community/http": "https://github.com/leo6104/capacitor-community-http.git#dist",
    "@capacitor/device": "^0.5.6",
    "@capacitor/dialog": "^0.4.6",
    "@capacitor/filesystem": "^0.5.2",
    "capacitor-codepush": "https://github.com/mapiacompany/capacitor-codepush",
    "code-push": "^4.0.4"
  }

iOS An error occurred when trying to get the hash of the binary contents

Description

iOS, iPhone 12 Mini Simulator + Real Device iPhone 12 Mini

First run, I have deployed several updates to codepush "development" deployment with a target binary of -t '^0.0.0'

appcenter codepush release --app xxx/xxx-xxx -d development -t '^0.0.0' -c dist/

and I initialise it like this:

if (isNative) {
    const { codePush } = await import('capacitor-codepush')
    const { App } = await import('@capacitor/app')

    otaUpdates.sync = () => {
      $log.debug('OTA: Running sync')

      codePush.sync({
        installMode: 'ON_NEXT_RESUME'
      })
    }

    // When the app is brought back to the foreground, let's check for an update
    App.addListener('appStateChange', ({ isActive }) => {
      $log.debug('Native app state changed. Is active?', isActive)

      if (isActive) {
        otaUpdates.sync()
      }
    })

    // Run on first launch
    otaUpdates.sync()
}

Reproduction

⚡️  [log] - OTA: Running sync
⚡️  To Native ->  CodePush notifyApplicationReady 126941029
⚡️  TO JS undefined
⚡️  To Native ->  CodePush getDeploymentKey 126941030
⚡️  TO JS {"value":"xxx-hidden-for-issue-xxx"}

⚡️  To Native ->  CodePush getServerURL 126941032
⚡️  TO JS {"value":"https:\/\/codepush.appcenter.ms\/"}

⚡️  To Native ->  CodePush notifyApplicationReady 126941035

⚡️  To Native ->  CodePush getAppVersion 126941040
⚡️  TO JS {"value":"0.5.0"}

⚡️  To Native ->  CodePush getBinaryHash 126941041
ERROR MESSAGE:  {"errorMessage":"An error occurred when trying to get the hash of the binary contents. ","message":"An error occurred when trying to get the hash of the binary contents. "}

⚡️  [error] - {"errorMessage":"An error occurred when trying to get the hash of the binary contents. ","message":"An error occurred when trying to get the hash of the binary contents. "}
⚡️  [error] - [CodePush] Could not get binary hash.Error: Could not get binary hash. 

⚡️  To Native ->  CodePush getAppVersion 126941042
⚡️  TO JS {"value":"0.5.0"}

Additional Information

  • "capacitor-codepush": "github:mapiacompany/capacitor-codepush" (updated today)
  • List of installed plugins:
    "@capacitor-community/http": "1.0.0-alpha.3",
    "@capacitor/android": "3.0.0-rc.0",
    "@capacitor/app": "0.3.6",
    "@capacitor/browser": "0.4.6",
    "@capacitor/camera": "0.4.3",
    "@capacitor/core": "3.0.0-rc.0",
    "@capacitor/device": "0.5.6",
    "@capacitor/dialog": "0.4.6",
    "@capacitor/ios": "3.0.0-rc.0",
    "@capacitor/keyboard": "0.5.6",
    "@capacitor/push-notifications": "0.3.6",
    "@capacitor/splash-screen": "0.3.6",
    "@capacitor/status-bar": "0.4.6",

Integrating into a standard javascript app

I apologize, my lack of knowledge of how to build modern Javascript apps is showing.

We have a Capacitor app that uses plain Javascript, without any build tools. This works fine. We're trying to add codepush support and we're running into a problem with how to integrate it into our app.

For Capacitor and its' plugins, we use <script> tags to include the plugin.js files from the various node_modules/.../dist directories.

If we do this with node_modules/capacitor-codepush/dist/plugin.js, we get an error about missing acquisitionSdk. Including node_modules/code-push/script/acquisition-sdk.js doesn't help.

Ok, so maybe there are a bunch of dependencies? We tried using rollup to see if we could get that to work, but cannot. Using this simple input file:

import { codePush } from 'capacitor-codepush';

console.log("hello");

we get [!] Error: Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.

Any help would be appreciated.

CodePush Error Could not get the package start page

I am testing this on an Ionic/Capacitor/Angular/Firebase project, NOT Cordova.
What I have done so far:

  1. Created new app with appcenter apps create -d <appDisplayName> -o iOS -p Cordova
  2. Created new deployment with appcenter codepush deployment add -a <ownerName>/<appName> Production
  3. Built new app version ready for release with ng build
  4. Released new version with appcenter codepush release -a <ownerName>/<appName> -c ./PATH_TO_BUILD -m -t 1.0 -d Production
  5. The app displays the modal saying new version is available. I click continue to proceed with install.
  6. During the install in Xcode I get the error CodePush Error Could not get the package start page....
  7. I downloaded the update manually from the appcenter website to check it, unzipped it, it has the following file structure: all files are stored one directory, directory name is my angular project name, the files in this directory are all my built project files, everything seems absolutely fine, index.html is included.

If anyone has a suggestion where I got it wrong, please do let me know.

Cannot sync the xcode project

Description

Hello and thank you for this great plugin. I have some issue installing it on iOS. When I try to sync the native project I get an error with pods. Specifically, I get:

[error] Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "CapacitorCodepush":
  In Podfile:
    CapacitorCodepush (from `../../node_modules/capacitor-codepush`)

Specs satisfying the `CapacitorCodepush (from `../../node_modules/capacitor-codepush`)` dependency were found, but they required a higher minimum deployment target.

Reproduction

npx cap sync

Additional Information

  • cordova-plugin-code-push version: 1.0.0
  • List of installed plugins: @capacitor-community/fcm, @capacitor-community/firebase-analytics
  • iOS version: Deployment target 12.0

*** Update ***

Only solution so far is to comment out the ios.deployment_target line within the pod specs.

The file “currentPackage.json” couldn’t be opened because there is no such file

Description

I created a capacitor project, installed the plugins, and configured the deployment key. From the javascript layer, I invoked the sync() function. I'm getting the following error and the application gets crashed at the end.

ERROR MESSAGE:  {"message":"The file “currentPackage.json” couldn’t be opened because there is no such file.","errorMessage":"The file “currentPackage.json” couldn’t be opened because there is no such file."}
⚡️  [error] - {"message":"The file “currentPackage.json” couldn’t be opened because there is no such file.","errorMessage":"The file “currentPackage.json” couldn’t be opened because there is no such file."}
⚡️  To Native ->  CodePush getAppVersion 52875057
⚡️  TO JS {"value":"1.0"}
⚡️  To Native ->  CodePush getBinaryHash 52875058
ERROR MESSAGE:  {"errorMessage":"An error occurred when trying to get the hash of the binary contents. ","message":"An error occurred when trying to get the hash of the binary contents. "}
⚡️  To Native ->  CodePush getAppVersion 52875059
⚡️  [error] - {"errorMessage":"An error occurred when trying to get the hash of the binary contents. ","message":"An error occurred when trying to get the hash of the binary contents. "}
⚡️  [error] - [CodePush] Could not get binary hash.Error: Could not get binary hash. 
⚡️  TO JS {"value":"1.0"}
⚡️  [log] - [CodePush] Checking for update.
⚡️  To Native ->  Http request 52875060
⚡️  TO JS {"headers":{"Strict-Transport-Security":"max-age=15724800; includeSubDomains","Access-Control-Allow-Origin":"*","Vary":"Accept-Encoding","Content-Type":"application\/json; charset=utf-8","Content-Encoding":"gzip","access-control-allow-methods":"GET","acces
⚡️  To Native ->  CodePush isFailedUpdate 52875061
⚡️  TO JS {"value":0}
⚡️  [log] - [CodePush] An update is available. {"isDownloading":false,"appVersion":"1.0","deploymentKey":"svqcsCjsJhESC0ZmUXYe3nym2mRede7REmeCX","downloadUrl":"https://codepushupdates.azureedge.net/storagev2/5eXOhadabwEgZHnQjkwnW_JlARRK0c894bb4-6419-4a7e-ae5e-6c01025b63ae","isMandatory":false,"label":"v3","packageHash":"048f5e1ca9db0d66c3a9b56c36501db8ab9738a3c27f1002b424cb541bcacca9","packageSize":22793,"failedInstall":0}
⚡️  [log] - [CodePush] Downloading update
⚡️  To Native ->  Filesystem getUri 52875062
⚡️  TO JS {"uri":"file:\/\/\/Users\/\/Library\/Developer\/CoreSimulator\/Devices\/AC8BE0AE-1B17-4507-9CD5-E6098D4B144F\/data\/Containers\/Data\/Application\/E839E370-8FF2-44E8-B97B-0CD4B9EC4EBA\/Documents\/codepush\/download\/update.zip"}
⚡️  To Native ->  Filesystem stat 52875063
ERROR MESSAGE:  {"message":"The file “download” couldn’t be opened because there is no such file.","errorMessage":"The file “download” couldn’t be opened because there is no such file."}
⚡️  [error] - {"message":"The file “download” couldn’t be opened because there is no such file.","errorMessage":"The file “download” couldn’t be opened because there is no such file."}
⚡️  To Native ->  Filesystem mkdir 52875064
⚡️  TO JS undefined
⚡️  To Native ->  Filesystem stat 52875065
ERROR MESSAGE:  {"errorMessage":"The file “update.zip” couldn’t be opened because there is no such file.","message":"The file “update.zip” couldn’t be opened because there is no such file."}
⚡️  [error] - {"errorMessage":"The file “update.zip” couldn’t be opened because there is no such file.","message":"The file “update.zip” couldn’t be opened because there is no such file."}
⚡️  To Native ->  Http downloadFile 52875066
⚡️  TO JS {"status":200,"url":"https:\/\/codepush.appcenter.ms\/v0.1\/public\/codepush\/report_status\/deploy","data":"OK","headers":{"access-control-allow-credentials":"false","Strict-Transport-Security":"max-age=15724800; includeSubDomains","Content-Type":"text\/p
⚡️  To Native ->  CodePush reportSucceeded 52875067
⚡️  [log] - [CodePush] Reported status: {"status":0,"appVersion":"1.0","deploymentKey":"svqcsCjsJhESC0ZmUXYe3nym2mRede7REmeCX","lastVersionLabelOrAppVersion":null,"lastVersionDeploymentKey":null}
⚡️  TO JS undefined
File Dest file:///Users/Library/Developer/CoreSimulator/Devices/AC8BE0AE-1B17-4507-9CD5-E6098D4B144F/data/Containers/Data/Application/E839E370-8FF2-44E8-B97B-0CD4B9EC4EBA/Documents/codepush/download/update.zip
⚡️  TO JS {"path":"file:\/\/\/Users/Library\/Developer\/CoreSimulator\/Devices\/AC8BE0AE-1B17-4507-9CD5-E6098D4B144F\/data\/Containers\/Data\/Application\/E839E370-8FF2-44E8-B97B-0CD4B9EC4EBA\/Documents\/codepush\/download\/update.zip"}
Downloaded file file:///Users/Library/Developer/CoreSimulator/Devices/AC8BE0AE-1B17-4507-9CD5-E6098D4B144F/data/Containers/Data/Application/E839E370-8FF2-44E8-B97B-0CD4B9EC4EBA/tmp/CFNetworkDownload_BknJec.tmp
⚡️  To Native ->  CodePush isFailedUpdate 52875068
⚡️  TO JS {"value":0}
⚡️  [log] - [CodePush] Package download success: {"deploymentKey":"svqcsCjsJhESC0ZmUXYe3nym2mRede7REmeCX","label":"v3","appVersion":"1.0","isMandatory":false,"packageHash":"048f5e1ca9db0d66c3a9b56c36501db8ab9738a3c27f1002b424cb541bcacca9","isFirstRun":false,"failedInstall":0,"localPath":"file:///Users/Library/Developer/CoreSimulator/Devices/AC8BE0AE-1B17-4507-9CD5-E6098D4B144F/data/Containers/Data/Application/E839E370-8FF2-44E8-B97B-0CD4B9EC4EBA/Documents/codepush/download/update.zip"}
⚡️  [log] - [CodePush] Installing update
⚡️  To Native ->  Filesystem stat 52875069
⚡️  To Native ->  Http request 52875070
ERROR MESSAGE:  {"message":"The file “unzipped” couldn’t be opened because there is no such file.","errorMessage":"The file “unzipped” couldn’t be opened because there is no such file."}
⚡️  [error] - {"message":"The file “unzipped” couldn’t be opened because there is no such file.","errorMessage":"The file “unzipped” couldn’t be opened because there is no such file."}
⚡️  To Native ->  Filesystem mkdir 52875071
⚡️  TO JS undefined
⚡️  To Native ->  Filesystem getUri 52875072
⚡️  TO JS {"uri":"file:\/\/\/Users\/Library\/Developer\/CoreSimulator\/Devices\/AC8BE0AE-1B17-4507-9CD5-E6098D4B144F\/data\/Containers\/Data\/Application\/E839E370-8FF2-44E8-B97B-0CD4B9EC4EBA\/Documents\/codepush\/download\/unzipped\/"}
⚡️  To Native ->  CodePush unzip 52875073
⚡️  TO JS undefined
⚡️  To Native ->  Filesystem stat 52875074
ERROR MESSAGE:  {"message":"The file “hotcodepush.json” couldn’t be opened because there is no such file.","errorMessage":"The file “hotcodepush.json” couldn’t be opened because there is no such file."}
⚡️  To Native ->  ⚡️  [error] - {"message":"The file “hotcodepush.json” couldn’t be opened because there is no such file.","errorMessage":"The file “hotcodepush.json” couldn’t be opened because there is no such file."}
Filesystem stat 52875075
ERROR MESSAGE:  {"errorMessage":"The file “versions” couldn’t be opened because there is no such file.","message":"The file “versions” couldn’t be opened because there is no such file."}
⚡️  To Native ->  Filesystem mkdir 52875076
⚡️  [error] - {"errorMessage":"The file “versions” couldn’t be opened because there is no such file.","message":"The file “versions” couldn’t be opened because there is no such file."}
⚡️  TO JS undefined
⚡️  To Native ->  Filesystem stat 52875077
ERROR MESSAGE:  {"errorMessage":"The file “048f5e1ca9db0d66c3a9b56c36501db8ab9738a3c27f1002b424cb541bcacca9” couldn’t be opened because there is no such file.","message":"The file “048f5e1ca9db0d66c3a9b56c36501db8ab9738a3c27f1002b424cb541bcacca9” couldn’t be opened because there is no such file."}
⚡️  [error] - {"errorMessage":"The file “048f5e1ca9db0d66c3a9b56c36501db8ab9738a3c27f1002b424cb541bcacca9” couldn’t be opened because there is no such file.","message":"The file “048f5e1ca9db0d66c3a9b56c36501db8ab9738a3c27f1002b424cb541bcacca9” couldn’t be opened because there is no such file."}
⚡️  To Native ->  Filesystem copy 52875078
⚡️  TO JS undefined
⚡️  To Native ->  CodePush getPublicKey 52875079
⚡️  [log] - [CodePush] Applying full update
2021-03-12 10:56:22.857960+0530 App[63556:7336508] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff23c7127e __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff513fbb20 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff23d03ab1 _CFThrowFormattedException + 194
	3   CoreFoundation                      0x00007fff23d0e4c6 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.4 + 38
	4   CoreFoundation                      0x00007fff23cced97 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 247
	5   CoreFoundation                      0x00007fff23c6d12b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
	6   CapacitorCodepush                   0x000000010e56ea27 -[CodePushPlugin getPublicKey:] + 167
	7   Capacitor                           0x000000010e4381b6 $s9Capacitor0A6BridgeC12handleJSCall4callyAA0D0V_tFyycfU_ + 1318
	8   Capacitor                           0x000000010e42be8d $sIeg_IeyB_TR + 45
	9   libdispatch.dylib                   0x000000010edf4dd4 _dispatch_call_block_and_release + 12
	10  libdispatch.dylib                   0x000000010edf5d48 _dispatch_client_callout + 8
	11  libdispatch.dylib                   0x000000010edfc5ef _dispatch_lane_serial_drain + 788
	12  libdispatch.dylib                   0x000000010edfd17f _dispatch_lane_invoke + 422
	13  libdispatch.dylib                   0x000000010ee08a4e _dispatch_workloop_worker_thread + 719
	14  libsystem_pthread.dylib             0x00007fff5245f611 _pthread_wqthread + 421
	15  libsystem_pthread.dylib             0x00007fff5245f3fd start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Additional Information

"@capacitor-community/http": "^1.0.0-alpha.2",
"@capacitor/cli": "^3.0.0-rc.0",
"@capacitor/core": "^3.0.0-rc.0",
"@capacitor/device": "^0.5.6",
"@capacitor/dialog": "^0.4.6",
"@capacitor/filesystem": "^0.5.2",
"@capacitor/ios": "^3.0.0-rc.0",
"@capacitor/splash-screen": "^0.3.6",
"capacitor-codepush": "github:mapiacompany/capacitor-codepush"

Repository Info

https://github.com/UserSG/CodePushWithCapacitor.git

TypeError: undefined is not an object (evaluating 'window.codePush.reportStatus')

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Description

I'm not sure why this is happening, but a small subset of devices the codePush instance seems unavailable in the window context. Possibly a timing issue? This is strange though because our app waits a solid 4-5s before attempting any CodePush actions.

TypeError: undefined is not an object (evaluating 'window.codePush.reportStatus')
  at ionic:(//localhost:1:71)
  at ? (ionic://localhost/polyfills-es2015.6efff9e9e083b048c166.js:1:40938)
  at runTask(ionic://localhost/polyfills-es2015.6efff9e9e083b048c166.js:1:11465)
  at invokeTask(ionic://localhost/polyfills-es2015.6efff9e9e083b048c166.js:1:17103)

Reproduction

No reproduction available currently. Just production logging messages.

Additional Information

  • cordova-plugin-code-push version: latest
  • List of installed plugins:
  • Cordova version:
  • iOS/Android/Windows version:
  • Does this reproduce on a debug build or release build? release build
  • Does this reproduce on a simulator, or only on a physical device? physical & unknown

(The more info the faster we will be able to address it!)

Publish on NPM

Will this package be published to NPM? Using Yarn v2, I'm having difficulties adding a package from the GitHub url (it expects the branch to be called "master" - the option to customize will come in Yarn v3).

I noticed another capacitor-codepush on npmjs.com. Have there been any attempts to contact that package publisher and consolidate efforts?

After downloading, while installation, app goes white and says `cordova is not defined`

Description

After downloading, while installation, app goes white and says cordova is not defined

Reproduction

  1. Run app on android
  2. Make minor text changes in the code (i made in index.html)
  3. build, sync and release to codepush via: appcenter codepush release -a ashish141199/Intract-Android -c public/ --target-binary-version "*"
  4. Restart the app, it says "Checking for update" and then Downloaded, will be installed on next restart
  5. When I restart the app, the screen goes white and nothing happens at all. In chrome://inspect I was able to see cordova is not defined and then nothing.

Additional Information

  • cordova-plugin-code-push version:
  • Cordova version: 10.0.0
  • iOS/Android/Windows version: Android 9
  • Does this reproduce on a debug build or release build? both
  • Does this reproduce on a simulator, or only on a physical device? physical device

CodePush.addListener() not implemented

Description

Currently there is no way to register for/observe status updates from the sync process. The method exists, but it does not look like there is anything publishing events on the "codePushStatus" channel:

https://github.com/mapiacompany/capacitor-codepush/blob/capacitor/src/nativeCodePushPlugin.ts#L70

Reproduction

Register a listener. Nothing happens :) Also it does not appear this is referenced anywhere in the project code (doing a search for 'codePushStatus' only results are this interface.)

CommonJS or AMD dependencies can cause optimization bailouts.

Hi,

Description

When compiling with Angular > 10 than I get this warning:

...\node_modules\capacitor-codepush\dist\esm\codePush.js depends on 'code-push/script/acquisition-sdk'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Additional Information

  • capacitor-plugin-code-push version: "capacitor-codepush": "git+ssh://[email protected]/mapiacompany/capacitor-codepush.git#037174d2c00fa1a095f1ed2a445a31ccd70815df",
  • List of installed plugins:
  • Capacitor version: Capacitor CLI: 3.5.1
  • iOS/Android/Windows version: Build on win10
  • Does this reproduce on a debug build or release build?
  • Does this reproduce on a simulator, or only on a physical device?

(The more info the faster we will be able to address it!)

Is this package still maintained?

I've noticed that questions aren't being answered and PRs not merged for a 4-5 months. We plan to start using Capacitor with Appcenter (coming from Cordova) but we need something more stable than this fork.

If this is an abandoned fork, then we would probably be happy to take responsibility for creating a fork or a version which is properly published to NPM, with some commitment to keeping the community active and the package maintained.

Cannot find module 'capacitor-codepush', webpackMissingModule

Screen Shot 2022-01-21 at 00 20 55

I'm currently facing an error like the image even though the package was already installed in node_modules.

I'm using webpack. I can not find a solution to solve this error.
Someone can help me. Thanks

  • Webpack: 4.39.0
  • React: ^16.9.17
// package.json
"@capacitor/cli": "^3.0.0",
"@capacitor/core": "^3.0.0"
"@capacitor-community/http": "^1.0.0-alpha.5",
"@capacitor/cli": "1.5.2",
"@capacitor/device": "^1.1.2",
"@capacitor/dialog": "^1.0.7",
"@capacitor/filesystem": "^1.1.0",
"capacitor-codepush": "git+https://github.com/mapiacompany/capacitor-codepush.git",

Using with other capacitor versions

Does this only work on capacitor 3? I'm interested in implementing with this but the docs are 100% clear on what version of capacitor you need to use. Do I need to upgrade to capacitor 3?

I tried on capacitor 2 and it wouldn't compile in Android studio. When I googled the error message it talked about incompatibility with capacitor 2. I can share more info if that is not the expected behavior.

"Device" plugin is not implemented on ios. StackTrace: CapacitorException

Description

After installation and build, I always get this error:

[CodePush]  "Device" plugin is not implemented on ios. StackTrace: CapacitorException
createPluginMethod

promiseReactionJob@[native code]
(anonymous function) — index.js:40
(anonymous function) — index.js:40
logError — codePushUtil.js:47
(anonymous function) — codePushUtil.js:59
(anonymous function) — codePush.js:188
generatorResume
rejected — codePush.js:5
promiseReactionJob
index.js:40

The app doesn't crash but apparently there is no way to call execute .sync()

Has anyone managed to run this plugin without errors?

Additional Information

iOS 14.4
Capacitor 3.0

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.