Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: meteor/cordova-plugin-meteor-webapp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Vilango/cordova-plugin-meteor-webapp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 18 commits
  • 8 files changed
  • 2 contributors

Commits on May 31, 2016

  1. Copy the full SHA
    29f725e View commit details
  2. patched andorid updater

    gerwinbrunner committed May 31, 2016
    Copy the full SHA
    1695de9 View commit details

Commits on Mar 8, 2017

  1. fixing autoupdater

    gerwinbrunner committed Mar 8, 2017
    Copy the full SHA
    adc3919 View commit details
  2. fixed Swift issues

    gerwinbrunner committed Mar 8, 2017
    Copy the full SHA
    fc33ec9 View commit details

Commits on Oct 22, 2017

  1. Copy the full SHA
    e61f97a View commit details

Commits on Feb 6, 2018

  1. Merge tag 'v1.6.0'

    Herwig Brunner committed Feb 6, 2018
    Copy the full SHA
    ea89c72 View commit details
  2. Merge of remote repo, v1.6.0

    Herwig Brunner committed Feb 6, 2018
    Copy the full SHA
    157d394 View commit details
  3. Revert "Merge of remote repo, v1.6.0"

    This reverts commit 157d394.
    gerwinbrunner committed Feb 6, 2018
    Copy the full SHA
    58729b5 View commit details

Commits on Feb 19, 2018

  1. Merge tag 'v1.6.0'

    Herwig Brunner committed Feb 19, 2018
    Copy the full SHA
    2f88b4a View commit details
  2. changed it to publish on npm

    Herwig Brunner committed Feb 19, 2018
    Copy the full SHA
    07aeba9 View commit details

Commits on Nov 2, 2018

  1. Copy the full SHA
    5b1df1b View commit details

Commits on Nov 7, 2018

  1. bumped version

    gerwinbrunner committed Nov 7, 2018
    Copy the full SHA
    2689da6 View commit details
  2. Copy the full SHA
    c3b6552 View commit details
  3. bumped version to c

    gerwinbrunner committed Nov 7, 2018
    Copy the full SHA
    d5f61f1 View commit details
  4. .

    gerwinbrunner committed Nov 7, 2018
    Copy the full SHA
    b1d4018 View commit details
  5. bumped version

    gerwinbrunner committed Nov 7, 2018
    Copy the full SHA
    0779813 View commit details
  6. Copy the full SHA
    567ca71 View commit details

Commits on May 31, 2019

  1. upgraded to master version fix for swift 4.2

    Herwig Brunner committed May 31, 2019
    Copy the full SHA
    ebbc1be View commit details
Showing with 76 additions and 7 deletions.
  1. +1 −1 package.json
  2. +1 −1 plugin.xml
  3. +19 −0 src/android/AssetBundle.java
  4. +4 −1 src/android/WebAppLocalServer.java
  5. +17 −1 src/ios/AssetBundle.swift
  6. +1 −1 src/ios/AssetBundleManager.swift
  7. +22 −0 src/ios/WebAppConfiguration.swift
  8. +11 −2 src/ios/WebAppLocalServer.swift
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/meteor/cordova-plugin-meteor-webapp"
"url": "https://github.com/Vilango/cordova-plugin-meteor-webapp"
},
"keywords": [
"cordova",
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
<keywords>cordova,meteor</keywords>
<author>Meteor Development Group</author>
<license>MIT</license>
<repo>https://github.com/meteor/cordova-plugin-meteor-webapp.git</repo>
<repo>https://github.com/Vilango/cordova-plugin-meteor-webapp.git</repo>

<engines>
<engine name="cordova" version=">=5.4.1" />
19 changes: 19 additions & 0 deletions src/android/AssetBundle.java
Original file line number Diff line number Diff line change
@@ -73,6 +73,9 @@ public String toString() {
private JSONObject runtimeConfig;
private String appId;
private String rootUrlString;
/* Patch for AutoupdateServer */
private String autoupdateServerUrlString;
/* Patch for AutoupdateServer - End */

public AssetBundle(CordovaResourceApi resourceApi, Uri directoryUri) throws WebAppException {
this(resourceApi, directoryUri, null, null);
@@ -200,6 +203,22 @@ public String getRootUrlString() {
return rootUrlString;
}

/* Patch for AutoupdateServer */
public String getAutoupdateServerUrlString() {
if (autoupdateServerUrlString == null) {
JSONObject runtimeConfig = getRuntimeConfig();
if (runtimeConfig != null) {
try {
autoupdateServerUrlString = runtimeConfig.getJSONObject("PUBLIC_SETTINGS").getString("AutoupdateServer");
} catch (JSONException e) {
Log.w(LOG_TAG, "Error reading PUBLIC_SETTINGS.AutoupdateServer from runtime config", e);
}
}
}
return autoupdateServerUrlString;
}
/* Patch for AutoupdateServer - End */

void didMoveToDirectoryAtUri(Uri directoryUri) {
this.directoryUri = directoryUri;
}
5 changes: 4 additions & 1 deletion src/android/WebAppLocalServer.java
Original file line number Diff line number Diff line change
@@ -259,7 +259,10 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
private void checkForUpdates(final CallbackContext callbackContext) {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
HttpUrl rootUrl = HttpUrl.parse(currentAssetBundle.getRootUrlString());
/* Patch for AutoupdateServer */
//HttpUrl rootUrl = HttpUrl.parse(currentAssetBundle.getRootUrlString());
HttpUrl rootUrl = HttpUrl.parse(currentAssetBundle.getAutoupdateServerUrlString());
/* Patch for AutoupdateServer - End */
if (rootUrl == null) {
callbackContext.error("checkForUpdates requires a rootURL to be configured");
return;
18 changes: 17 additions & 1 deletion src/ios/AssetBundle.swift
Original file line number Diff line number Diff line change
@@ -120,7 +120,17 @@ final class AssetBundle {
return nil
}
}


/* Patch for AutoupdateServer */
var autoupdateServerURL: URL? {
if let autoupdateServerURLString = json["PUBLIC_SETTINGS"]!["AutoupdateServer"] as? String {
return URL(string: autoupdateServerURLString)
} else {
return nil
}
}
/* Patch for AutoupdateServer - End */

var autoupdateVersionCordova: String? {
return json["autoupdateVersionCordova"] as? String
}
@@ -145,6 +155,12 @@ final class AssetBundle {
var rootURL: URL? {
return runtimeConfig?.rootURL
}

/* Patch for AutoupdateServer */
var autoupdateServerURL: URL? {
return runtimeConfig?.autoupdateServerURL
}
/* Patch for AutoupdateServer - End */

func didMoveToDirectoryAtURL(_ directoryURL: URL) {
self.directoryURL = directoryURL
2 changes: 1 addition & 1 deletion src/ios/AssetBundleManager.swift
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ final class AssetBundleManager: AssetBundleDownloaderDelegate {
func checkForUpdatesWithBaseURL(_ baseURL: URL) {
let manifestURL = URL(string: "manifest.json", relativeTo: baseURL)!

NSLog("Start downloading asset manifest from: \(manifestURL)")
NSLog("XXX Start downloading asset manifest from: \(manifestURL)")

let dataTask = session.dataTask(with: manifestURL, completionHandler: {
(data, response, error) in
22 changes: 22 additions & 0 deletions src/ios/WebAppConfiguration.swift
Original file line number Diff line number Diff line change
@@ -37,6 +37,28 @@ final class WebAppConfiguration {
}
}

/* Patch for AutoupdateServer */
var autoupdateServerURL: URL? {
get {
let url = userDefaults.url(forKey: "MeteorWebAppAutoupdateServerURL")
NSLog("autoupdateServerURL.get: \(url)")
return url
}
set {
let oldValue = autoupdateServerURL
if newValue != oldValue && newValue != nil {
if oldValue != nil {
NSLog("AutoupdateServerURL seems to have changed, new: \(newValue!), old: \(oldValue!)")
}

userDefaults.set(newValue, forKey: "MeteorWebAppAutoupdateServerURL")
userDefaults.synchronize()
}
}
}
/* Patch for AutoupdateServer - End */


/// The Cordova compatibility version as specified in the asset manifest
var cordovaCompatibilityVersion: String? {
get {
13 changes: 11 additions & 2 deletions src/ios/WebAppLocalServer.swift
Original file line number Diff line number Diff line change
@@ -41,6 +41,12 @@ open class WebAppLocalServer: METPlugin, AssetBundleManagerDelegate {
configuration.cordovaCompatibilityVersion = currentAssetBundle.cordovaCompatibilityVersion

NSLog("Serving asset bundle version: \(currentAssetBundle.version)")

/* Patch for AutoupdateServer */
configuration.autoupdateServerURL = currentAssetBundle.autoupdateServerURL
NSLog("Serving asset bundle autoupdateServerURL: \(currentAssetBundle.autoupdateServerURL)")
/* Patch for AutoupdateServer - End */

}
}
}
@@ -261,8 +267,11 @@ open class WebAppLocalServer: METPlugin, AssetBundleManagerDelegate {
}
}

@objc open func checkForUpdates(_ command: CDVInvokedUrlCommand) {
guard let rootURL = configuration.rootURL else {
@objc open func checkForUpdates(_ command: CDVInvokedUrlCommand) {
/* Patch for AutoupdateServer */
guard let rootURL = configuration.autoupdateServerURL else {
//guard let rootURL = configuration.rootURL else {
/* Patch for AutoupdateServer - End */
let errorMessage = "checkForUpdates requires a rootURL to be configured"
let result = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: errorMessage)
commandDelegate?.send(result, callbackId: command.callbackId)